From e69e8b1d09fb579316595b4e6a850e717358a8b1 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sun, 19 Jun 2011 19:03:33 +0000 Subject: TQt4 port kdegraphics This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1237557 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kuickshow/kuickshow.spec | 6 +- kuickshow/src/aboutwidget.cpp | 18 +++--- kuickshow/src/aboutwidget.h | 5 +- kuickshow/src/defaultswidget.cpp | 14 ++--- kuickshow/src/defaultswidget.h | 5 +- kuickshow/src/filecache.cpp | 6 +- kuickshow/src/filecache.h | 2 +- kuickshow/src/filefinder.cpp | 8 +-- kuickshow/src/filefinder.h | 3 +- kuickshow/src/filewidget.cpp | 20 +++---- kuickshow/src/filewidget.h | 5 +- kuickshow/src/generalwidget.cpp | 22 ++++---- kuickshow/src/generalwidget.h | 5 +- kuickshow/src/imagewindow.cpp | 114 +++++++++++++++++++------------------- kuickshow/src/imagewindow.h | 7 ++- kuickshow/src/imlibwidget.cpp | 50 ++++++++--------- kuickshow/src/imlibwidget.h | 24 ++++---- kuickshow/src/kuickconfigdlg.cpp | 4 +- kuickshow/src/kuickconfigdlg.h | 3 +- kuickshow/src/kuickdata.cpp | 4 +- kuickshow/src/kuickfile.cpp | 18 +++--- kuickshow/src/kuickfile.h | 7 ++- kuickshow/src/kuickimage.cpp | 62 ++++++++++----------- kuickshow/src/kuickimage.h | 7 ++- kuickshow/src/kuickshow.cpp | 60 ++++++++++---------- kuickshow/src/kuickshow.h | 7 ++- kuickshow/src/kurlwidget.cpp | 4 +- kuickshow/src/kurlwidget.h | 1 + kuickshow/src/mainwidget.cpp | 6 +- kuickshow/src/mainwidget.h | 5 +- kuickshow/src/printing.cpp | 58 +++++++++---------- kuickshow/src/printing.h | 7 ++- kuickshow/src/slideshowwidget.cpp | 18 +++--- kuickshow/src/slideshowwidget.h | 5 +- 34 files changed, 302 insertions(+), 288 deletions(-) (limited to 'kuickshow') diff --git a/kuickshow/kuickshow.spec b/kuickshow/kuickshow.spec index 0fcba9ea..ca157837 100644 --- a/kuickshow/kuickshow.spec +++ b/kuickshow/kuickshow.spec @@ -55,11 +55,11 @@ make install DESTDIR=$RPM_BUILD_ROOT cd $RPM_BUILD_ROOT -find . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > $RPM_BUILD_DIR/file.list.%{name} +tqfind . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > $RPM_BUILD_DIR/file.list.%{name} -find . -type f | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name} +tqfind . -type f | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name} -find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name} +tqfind . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.%{name} %clean rm -rf $RPM_BUILD_ROOT diff --git a/kuickshow/src/aboutwidget.cpp b/kuickshow/src/aboutwidget.cpp index fc9825fd..f65b522b 100644 --- a/kuickshow/src/aboutwidget.cpp +++ b/kuickshow/src/aboutwidget.cpp @@ -31,17 +31,17 @@ #include "aboutwidget.h" -AboutWidget::AboutWidget( TQWidget *parent, const char *name ) - : TQVBox( parent, name, Qt::WShowModal ) +AboutWidget::AboutWidget( TQWidget *tqparent, const char *name ) + : TQVBox( tqparent, name, TQt::WShowModal ) { KWin::setType( winId(), NET::Override ); KWin::setState( winId(), NET::SkipTaskbar ); setFrameStyle( WinPanel | Raised ); - TQGroupBox *gBox = new TQGroupBox( 1, Horizontal, this); + TQGroupBox *gBox = new TQGroupBox( 1,Qt::Horizontal, this); gBox->setGeometry( 10, 10, width()-20, height()-20 ); - gBox->setAlignment( AlignHCenter ); + gBox->tqsetAlignment( AlignHCenter ); gBox->installEventFilter( this ); gBox->setPalette( TQPalette( TQColor( white ) ) ); @@ -57,14 +57,14 @@ AboutWidget::AboutWidget( TQWidget *parent, const char *name ) TQLabel *authors = new TQLabel("Kuickshow " KUICKSHOWVERSION " was brought to you by", gBox); - authors->setAlignment( AlignCenter ); + authors->tqsetAlignment( AlignCenter ); m_homepage = new KURLWidget("Carsten Pfeiffer", gBox); m_homepage->setURL( "http://devel-home.kde.org/~pfeiffer/kuickshow/" ); - m_homepage->setAlignment( AlignCenter ); + m_homepage->tqsetAlignment( AlignCenter ); TQLabel *copy = new TQLabel("(C) 1998-2006", gBox); - copy->setAlignment( AlignCenter ); + copy->tqsetAlignment( AlignCenter ); ImlibWidget *im = new ImlibWidget( 0L, gBox, "KuickShow Logo" ); if ( im->loadImage( file ) ) @@ -83,8 +83,8 @@ AboutWidget::~AboutWidget() bool AboutWidget::eventFilter( TQObject *o, TQEvent *e ) { if ( e->type() == TQEvent::MouseButtonPress ) { - TQMouseEvent *ev = static_cast( e ); - if ( !m_homepage->geometry().contains( ev->pos() ) ) { + TQMouseEvent *ev = TQT_TQMOUSEEVENT( e ); + if ( !m_homepage->tqgeometry().tqcontains( ev->pos() ) ) { deleteLater(); return true; } diff --git a/kuickshow/src/aboutwidget.h b/kuickshow/src/aboutwidget.h index 0f70ccaa..c3bd487f 100644 --- a/kuickshow/src/aboutwidget.h +++ b/kuickshow/src/aboutwidget.h @@ -24,12 +24,13 @@ class KURLWidget; -class AboutWidget : public QVBox +class AboutWidget : public TQVBox { Q_OBJECT + TQ_OBJECT public: - AboutWidget(TQWidget *parent = 0, const char *name = 0); + AboutWidget(TQWidget *tqparent = 0, const char *name = 0); protected: ~AboutWidget(); diff --git a/kuickshow/src/defaultswidget.cpp b/kuickshow/src/defaultswidget.cpp index 7e94b1b1..c0596784 100644 --- a/kuickshow/src/defaultswidget.cpp +++ b/kuickshow/src/defaultswidget.cpp @@ -31,8 +31,8 @@ #include "imlibwidget.h" #include "defaultswidget.h" -DefaultsWidget::DefaultsWidget( TQWidget *parent, const char *name) - : TQWidget( parent, name ) +DefaultsWidget::DefaultsWidget( TQWidget *tqparent, const char *name) + : TQWidget( tqparent, name ) { imFiltered = 0L; @@ -92,7 +92,7 @@ DefaultsWidget::DefaultsWidget( TQWidget *parent, const char *name) // -- gbPreview = new TQGroupBox( i18n("Preview"), this ); - gbPreview->setAlignment( AlignCenter ); + gbPreview->tqsetAlignment( AlignCenter ); lbImOrig = new TQLabel( i18n("Original"), gbPreview ); imOrig = new ImlibWidget( 0L, gbPreview, "original image" ); @@ -105,13 +105,13 @@ DefaultsWidget::DefaultsWidget( TQWidget *parent, const char *name) //////////////// - // layout management + // tqlayout management TQVBoxLayout *mainLayout = new TQVBoxLayout( this, 0, - KDialog::spacingHint(), "main layout" ); + KDialog::spacingHint(), "main tqlayout" ); - TQVBoxLayout *gbScaleLayout = new TQVBoxLayout( gbScale->layout(), + TQVBoxLayout *gbScaleLayout = new TQVBoxLayout( gbScale->tqlayout(), KDialog::spacingHint()); - TQVBoxLayout *gbGeometryLayout = new TQVBoxLayout(gbGeometry->layout(), + TQVBoxLayout *gbGeometryLayout = new TQVBoxLayout(gbGeometry->tqlayout(), KDialog::spacingHint()); TQGridLayout *gbPreviewLayout = new TQGridLayout(gbPreview, 2, 3, 0, KDialog::spacingHint()); diff --git a/kuickshow/src/defaultswidget.h b/kuickshow/src/defaultswidget.h index 5eeae365..c9f74b67 100644 --- a/kuickshow/src/defaultswidget.h +++ b/kuickshow/src/defaultswidget.h @@ -30,12 +30,13 @@ class TQLabel; class KComboBox; class KIntNumInput; -class DefaultsWidget : public QWidget +class DefaultsWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - DefaultsWidget( TQWidget *parent, const char *name ); + DefaultsWidget( TQWidget *tqparent, const char *name ); ~DefaultsWidget(); void loadSettings( const KuickData& data ); diff --git a/kuickshow/src/filecache.cpp b/kuickshow/src/filecache.cpp index 006bf46e..54403639 100644 --- a/kuickshow/src/filecache.cpp +++ b/kuickshow/src/filecache.cpp @@ -42,7 +42,7 @@ FileCache * FileCache::self() KuickFile * FileCache::getFile( const KURL& url ) { TQString urlString = url.prettyURL(); - KuickFile *file = m_files.find( urlString ); + KuickFile *file = m_files.tqfind( urlString ); if ( !file ) { file = new KuickFile( url ); m_files.insert( urlString, file ); @@ -58,7 +58,7 @@ TQString FileCache::tempDir() if ( !m_tempDir ) { kdWarning() << "Unable to create temporary directory for KuickShow" << endl; - return TQString::null; + return TQString(); } } @@ -68,7 +68,7 @@ TQString FileCache::tempDir() KTempDir * FileCache::createTempDir() { - TQString tmpName = TQString::fromLatin1( KGlobal::instance()->instanceName() ); + TQString tmpName = TQString::tqfromLatin1( KGlobal::instance()->instanceName() ); tmpName.append( TQString::number( getpid() ) ); TQString dirName = locateLocal( "tmp", tmpName ); KTempDir *dir = new KTempDir( dirName ); diff --git a/kuickshow/src/filecache.h b/kuickshow/src/filecache.h index 7cb97526..2152b5f9 100644 --- a/kuickshow/src/filecache.h +++ b/kuickshow/src/filecache.h @@ -27,7 +27,7 @@ public: int getLimit() const { return m_limit; } /** - * @return the temporary directory or TQString::null if none available + * @return the temporary directory or TQString() if none available */ TQString tempDir(); diff --git a/kuickshow/src/filefinder.cpp b/kuickshow/src/filefinder.cpp index 35bb382a..fc00b84c 100644 --- a/kuickshow/src/filefinder.cpp +++ b/kuickshow/src/filefinder.cpp @@ -26,8 +26,8 @@ #include "filefinder.h" -FileFinder::FileFinder( TQWidget *parent, const char *name ) - : KLineEdit( parent, name ) +FileFinder::FileFinder( TQWidget *tqparent, const char *name ) + : KLineEdit( tqparent, name ) { // make this widget just as large, as the font is + 8 Pixels int height = fontMetrics().height() + 8; @@ -49,7 +49,7 @@ FileFinder::FileFinder( TQWidget *parent, const char *name ) comp->setReplaceEnv( true ); setCompletionObject( comp, false ); setAutoDeleteCompletionObject( true ); - setFocusPolicy( ClickFocus ); + setFocusPolicy( TQ_ClickFocus ); KConfig *config = KGlobal::config(); KConfigGroupSaver cs( config, "GeneralConfiguration" ); @@ -87,7 +87,7 @@ void FileFinder::keyPressEvent( TQKeyEvent *e ) void FileFinder::hide() { KLineEdit::hide(); - parentWidget()->setFocus(); + tqparentWidget()->setFocus(); } void FileFinder::slotAccept( const TQString& dir ) diff --git a/kuickshow/src/filefinder.h b/kuickshow/src/filefinder.h index fc94bd71..3ec76797 100644 --- a/kuickshow/src/filefinder.h +++ b/kuickshow/src/filefinder.h @@ -28,9 +28,10 @@ class KURLCompletion; class FileFinder : public KLineEdit { Q_OBJECT + TQ_OBJECT public: - FileFinder( TQWidget *parent=0, const char *name=0 ); + FileFinder( TQWidget *tqparent=0, const char *name=0 ); ~FileFinder(); KURLCompletion *completion() { diff --git a/kuickshow/src/filewidget.cpp b/kuickshow/src/filewidget.cpp index d697db21..18284891 100644 --- a/kuickshow/src/filewidget.cpp +++ b/kuickshow/src/filewidget.cpp @@ -35,8 +35,8 @@ #undef KeyPress #endif -FileWidget::FileWidget( const KURL& url, TQWidget *parent, const char *name ) - : KDirOperator( url, parent, name ), +FileWidget::FileWidget( const KURL& url, TQWidget *tqparent, const char *name ) + : KDirOperator( url, tqparent, name ), m_validCompletion( false ), m_fileFinder( 0L ) { @@ -99,7 +99,7 @@ void FileWidget::initActions() TQPopupMenu *pMenu = menu->popupMenu(); int lastItemId = pMenu->idAt( pMenu->count() - 1 ); - TQMenuItem *mItem = pMenu->findItem( lastItemId ); + TQMenuItem *mItem = pMenu->tqfindItem( lastItemId ); if ( mItem && !mItem->isSeparator() ) menu->insert( sep ); @@ -152,7 +152,7 @@ void FileWidget::activatedMenu( const KFileItem *item, const TQPoint& pos ) void FileWidget::findCompletion( const TQString& text ) { if ( text.at(0) == '/' || text.at(0) == '~' || - text.find('/') != -1 ) { + text.tqfind('/') != -1 ) { TQString t = m_fileFinder->completion()->makeCompletion( text ); if (m_fileFinder->completionMode() == KGlobalSettings::CompletionPopup || @@ -179,7 +179,7 @@ void FileWidget::findCompletion( const TQString& text ) bool FileWidget::eventFilter( TQObject *o, TQEvent *e ) { if ( e->type() == TQEvent::KeyPress ) { - TQKeyEvent *k = static_cast( e ); + TQKeyEvent *k = TQT_TQKEYEVENT( e ); if ( (k->state() & (ControlButton | AltButton)) == 0 ) { int key = k->key(); @@ -196,7 +196,7 @@ bool FileWidget::eventFilter( TQObject *o, TQEvent *e ) } const TQString& text = k->text(); - if ( !text.isEmpty() && text.unicode()->isPrint() ) { + if ( !text.isEmpty() && text.tqunicode()->isPrint() ) { k->accept(); if ( !m_fileFinder ) { @@ -360,7 +360,7 @@ void FileWidget::slotViewChanged() void FileWidget::slotItemsCleared() { - m_currentURL = TQString::null; + m_currentURL = TQString(); } void FileWidget::slotItemDeleted( KFileItem *item ) @@ -399,7 +399,7 @@ void FileWidget::slotReturnPressed( const TQString& t ) setURL( url, true ); } - else if ( text.find('/') != (int) text.length() -1 ) { // relative path + else if ( text.tqfind('/') != (int) text.length() -1 ) { // relative path TQString dir = m_fileFinder->completion()->replacedPath( text ); KURL u( url(), dir ); setURL( u, true ); @@ -444,11 +444,11 @@ void FileWidget::slotFinishedLoading() else if ( !current ) setCurrentItem( view()->items()->getFirst() ); - m_initialName = TQString::null; + m_initialName = TQString(); emit finished(); } -TQSize FileWidget::sizeHint() const +TQSize FileWidget::tqsizeHint() const { return TQSize( 300, 300 ); } diff --git a/kuickshow/src/filewidget.h b/kuickshow/src/filewidget.h index 2022bdbc..8591f9b5 100644 --- a/kuickshow/src/filewidget.h +++ b/kuickshow/src/filewidget.h @@ -29,11 +29,12 @@ class KFileItem; class FileWidget : public KDirOperator { Q_OBJECT + TQ_OBJECT public: enum WhichItem { Previous, Next, Current }; - FileWidget( const KURL& url, TQWidget *parent = 0L, const char *name = 0L ); + FileWidget( const KURL& url, TQWidget *tqparent = 0L, const char *name = 0L ); ~FileWidget(); bool hasFiles() const; @@ -70,7 +71,7 @@ protected: virtual bool eventFilter( TQObject *o, TQEvent * ); virtual void resizeEvent( TQResizeEvent * ); virtual void activatedMenu( const KFileItem *, const TQPoint& ); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; private slots: void slotReturnPressed( const TQString& text ); diff --git a/kuickshow/src/generalwidget.cpp b/kuickshow/src/generalwidget.cpp index 1308885a..3b9b0352 100644 --- a/kuickshow/src/generalwidget.cpp +++ b/kuickshow/src/generalwidget.cpp @@ -33,11 +33,11 @@ #include "generalwidget.h" -GeneralWidget::GeneralWidget( TQWidget *parent, const char *name ) - : TQWidget( parent, name ) +GeneralWidget::GeneralWidget( TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ) { - TQVBoxLayout *layout = new TQVBoxLayout( this ); - layout->setSpacing( KDialog::spacingHint() ); + TQVBoxLayout *tqlayout = new TQVBoxLayout( this ); + tqlayout->setSpacing( KDialog::spacingHint() ); TQPixmap pixmap = UserIcon( "logo" ); KURLLabel *logo = new KURLLabel( this ); @@ -50,7 +50,7 @@ GeneralWidget::GeneralWidget( TQWidget *parent, const char *name ) connect( logo, TQT_SIGNAL( leftClickedURL( const TQString & ) ), TQT_SLOT( slotURLClicked( const TQString & ) ) ); - layout->addWidget( logo, 0, AlignRight ); + tqlayout->addWidget( logo, 0, AlignRight ); cbFullscreen = new TQCheckBox( i18n("Fullscreen mode"), this, "boscreen" ); @@ -70,17 +70,17 @@ GeneralWidget::GeneralWidget( TQWidget *parent, const char *name ) gridLayout->addWidget( l1, 1, 0 ); gridLayout->addWidget( editFilter, 1, 1 ); - layout->addWidget( cbFullscreen ); - layout->addWidget( cbPreload ); - layout->addWidget( cbLastdir ); - layout->addLayout( gridLayout ); + tqlayout->addWidget( cbFullscreen ); + tqlayout->addWidget( cbPreload ); + tqlayout->addWidget( cbLastdir ); + tqlayout->addLayout( gridLayout ); //////////////////////////////////////////////////////////////////////// TQVGroupBox *gbox2 = new TQVGroupBox( i18n("Quality/Speed"), this, "qualitybox" ); - layout->addWidget( gbox2 ); - layout->addStretch(); + tqlayout->addWidget( gbox2 ); + tqlayout->addStretch(); cbSmoothScale = new TQCheckBox( i18n("Smooth scaling"), gbox2, "smoothscale" ); cbFastRender = new TQCheckBox( i18n("Fast rendering"), gbox2, "fastrender" ); diff --git a/kuickshow/src/generalwidget.h b/kuickshow/src/generalwidget.h index e84c46ac..d9665170 100644 --- a/kuickshow/src/generalwidget.h +++ b/kuickshow/src/generalwidget.h @@ -29,12 +29,13 @@ class KLineEdit; class KIntNumInput; -class GeneralWidget : public QWidget +class GeneralWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - GeneralWidget( TQWidget *parent, const char *name ); + GeneralWidget( TQWidget *tqparent, const char *name ); ~GeneralWidget(); void loadSettings( const KuickData& data ); diff --git a/kuickshow/src/imagewindow.cpp b/kuickshow/src/imagewindow.cpp index 72de91c1..915443bb 100644 --- a/kuickshow/src/imagewindow.cpp +++ b/kuickshow/src/imagewindow.cpp @@ -74,15 +74,15 @@ TQCursor *ImageWindow::s_handCursor = 0L; -ImageWindow::ImageWindow( ImData *_idata, ImlibData *id, TQWidget *parent, +ImageWindow::ImageWindow( ImData *_idata, ImlibData *id, TQWidget *tqparent, const char *name ) - : ImlibWidget( _idata, id, parent, name ) + : ImlibWidget( _idata, id, tqparent, name ) { init(); } -ImageWindow::ImageWindow( ImData *_idata, TQWidget *parent, const char *name ) - : ImlibWidget( _idata, parent, name ) +ImageWindow::ImageWindow( ImData *_idata, TQWidget *tqparent, const char *name ) + : ImlibWidget( _idata, tqparent, name ) { init(); } @@ -94,7 +94,7 @@ ImageWindow::~ImageWindow() void ImageWindow::init() { - setFocusPolicy( TQWidget::StrongFocus ); + setFocusPolicy( TQ_StrongFocus ); KCursor::setAutoHideCursor( this, true, true ); KCursor::setHideCursorDelay( 1500 ); @@ -146,103 +146,103 @@ void ImageWindow::updateActions() void ImageWindow::setupActions() { new KAction( i18n("Show Next Image"), KStdAccel::next(), - this, TQT_SLOT( slotRequestNext() ), + TQT_TQOBJECT(this), TQT_SLOT( slotRequestNext() ), m_actions, "next_image" ); new KAction( i18n("Show Previous Image"), KStdAccel::prior(), - this, TQT_SLOT( slotRequestPrevious() ), + TQT_TQOBJECT(this), TQT_SLOT( slotRequestPrevious() ), m_actions, "previous_image" ); new KAction( i18n("Delete Image"), SHIFT + Key_Delete, - this, TQT_SLOT( imageDelete() ), + TQT_TQOBJECT(this), TQT_SLOT( imageDelete() ), m_actions, "delete_image" ); new KAction( i18n("Move Image to Trash"), Key_Delete, - this, TQT_SLOT( imageTrash() ), + TQT_TQOBJECT(this), TQT_SLOT( imageTrash() ), m_actions, "trash_image" ); new KAction( i18n("Zoom In"), Key_Plus, - this, TQT_SLOT( zoomIn() ), + TQT_TQOBJECT(this), TQT_SLOT( zoomIn() ), m_actions, "zoom_in" ); new KAction( i18n("Zoom Out"), Key_Minus, - this, TQT_SLOT( zoomOut() ), + TQT_TQOBJECT(this), TQT_SLOT( zoomOut() ), m_actions, "zoom_out" ); new KAction( i18n("Restore Original Size"), Key_O, - this, TQT_SLOT( showImageOriginalSize() ), + TQT_TQOBJECT(this), TQT_SLOT( showImageOriginalSize() ), m_actions, "original_size" ); new KAction( i18n("Maximize"), Key_M, - this, TQT_SLOT( maximize() ), + TQT_TQOBJECT(this), TQT_SLOT( maximize() ), m_actions, "maximize" ); new KAction( i18n("Rotate 90 Degrees"), Key_9, - this, TQT_SLOT( rotate90() ), + TQT_TQOBJECT(this), TQT_SLOT( rotate90() ), m_actions, "rotate90" ); new KAction( i18n("Rotate 180 Degrees"), Key_8, - this, TQT_SLOT( rotate180() ), + TQT_TQOBJECT(this), TQT_SLOT( rotate180() ), m_actions, "rotate180" ); new KAction( i18n("Rotate 270 Degrees"), Key_7, - this, TQT_SLOT( rotate270() ), + TQT_TQOBJECT(this), TQT_SLOT( rotate270() ), m_actions, "rotate270" ); - new KAction( i18n("Flip Horizontally"), Key_Asterisk, - this, TQT_SLOT( flipHoriz() ), + new KAction( i18n("FlipQt::Horizontally"), Key_Asterisk, + TQT_TQOBJECT(this), TQT_SLOT( flipHoriz() ), m_actions, "flip_horicontally" ); - new KAction( i18n("Flip Vertically"), Key_Slash, - this, TQT_SLOT( flipVert() ), + new KAction( i18n("FlipQt::Vertically"), Key_Slash, + TQT_TQOBJECT(this), TQT_SLOT( flipVert() ), m_actions, "flip_vertically" ); new KAction( i18n("Print Image..."), KStdAccel::print(), - this, TQT_SLOT( printImage() ), + TQT_TQOBJECT(this), TQT_SLOT( printImage() ), m_actions, "print_image" ); - KStdAction::saveAs( this, TQT_SLOT( saveImage() ), + KStdAction::saveAs( TQT_TQOBJECT(this), TQT_SLOT( saveImage() ), m_actions, "save_image_as" ); - KStdAction::close( this, TQT_SLOT( close() ), + KStdAction::close( TQT_TQOBJECT(this), TQT_SLOT( close() ), m_actions, "close_image" ); // -------- new KAction( i18n("More Brightness"), Key_B, - this, TQT_SLOT( moreBrightness() ), + TQT_TQOBJECT(this), TQT_SLOT( moreBrightness() ), m_actions, "more_brightness" ); new KAction( i18n("Less Brightness"), SHIFT + Key_B, - this, TQT_SLOT( lessBrightness() ), + TQT_TQOBJECT(this), TQT_SLOT( lessBrightness() ), m_actions, "less_brightness" ); new KAction( i18n("More Contrast"), Key_C, - this, TQT_SLOT( moreContrast() ), + TQT_TQOBJECT(this), TQT_SLOT( moreContrast() ), m_actions, "more_contrast" ); new KAction( i18n("Less Contrast"), SHIFT + Key_C, - this, TQT_SLOT( lessContrast() ), + TQT_TQOBJECT(this), TQT_SLOT( lessContrast() ), m_actions, "less_contrast" ); new KAction( i18n("More Gamma"), Key_G, - this, TQT_SLOT( moreGamma() ), + TQT_TQOBJECT(this), TQT_SLOT( moreGamma() ), m_actions, "more_gamma" ); new KAction( i18n("Less Gamma"), SHIFT + Key_G, - this, TQT_SLOT( lessGamma() ), + TQT_TQOBJECT(this), TQT_SLOT( lessGamma() ), m_actions, "less_gamma" ); // -------- new KAction( i18n("Scroll Up"), Key_Up, - this, TQT_SLOT( scrollUp() ), + TQT_TQOBJECT(this), TQT_SLOT( scrollUp() ), m_actions, "scroll_up" ); new KAction( i18n("Scroll Down"), Key_Down, - this, TQT_SLOT( scrollDown() ), + TQT_TQOBJECT(this), TQT_SLOT( scrollDown() ), m_actions, "scroll_down" ); new KAction( i18n("Scroll Left"), Key_Left, - this, TQT_SLOT( scrollLeft() ), + TQT_TQOBJECT(this), TQT_SLOT( scrollLeft() ), m_actions, "scroll_left" ); new KAction( i18n("Scroll Right"), Key_Right, - this, TQT_SLOT( scrollRight() ), + TQT_TQOBJECT(this), TQT_SLOT( scrollRight() ), m_actions, "scroll_right" ); // -------- new KAction( i18n("Pause Slideshow"), Key_P, - this, TQT_SLOT( pauseSlideShow() ), + TQT_TQOBJECT(this), TQT_SLOT( pauseSlideShow() ), m_actions, "kuick_slideshow_pause" ); - KAction *fullscreenAction = KStdAction::fullScreen(this, TQT_SLOT( toggleFullscreen() ), m_actions, 0 ); + KAction *fullscreenAction = KStdAction::fullScreen(TQT_TQOBJECT(this), TQT_SLOT( toggleFullscreen() ), m_actions, 0 ); KAction *reloadAction = new KAction( i18n("Reload Image"), KStdAccel::shortcut(KStdAccel::Reload), - this, TQT_SLOT( reload() ), + TQT_TQOBJECT(this), TQT_SLOT( reload() ), m_actions, "reload_image" ); new KAction( i18n("Properties"), ALT + Key_Return, - this, TQT_SLOT( slotProperties() ), + TQT_TQOBJECT(this), TQT_SLOT( slotProperties() ), m_actions, "properties" ); m_actions->readShortcutSettings(); @@ -310,8 +310,8 @@ void ImageWindow::updateGeometry( int imWidth, int imHeight ) TQString caption = i18n( "Filename (Imagewidth x Imageheight)", "%3 (%1 x %2)" ); - caption = caption.arg( m_kuim->originalWidth() ). - arg( m_kuim->originalHeight() ).arg( m_kuim->url().prettyURL() ); + caption = caption.tqarg( m_kuim->originalWidth() ). + tqarg( m_kuim->originalHeight() ).tqarg( m_kuim->url().prettyURL() ); setCaption( kapp->makeStdCaption( caption ) ); } @@ -403,7 +403,7 @@ void ImageWindow::scrollImage( int x, int y, bool restrict ) // XUnmapWindow(); // XSetWindowBackgroundPixmap() // resize window to fit image size, center image -// XClearWindow(); // repaint +// XClearWindow(); // tqrepaint // XMapWindow(), XSync(); // bool ImageWindow::showNextImage( const KURL& url ) @@ -412,7 +412,7 @@ bool ImageWindow::showNextImage( const KURL& url ) switch ( file->waitForDownload( this ) ) { case KuickFile::ERROR: { - TQString tmp = i18n("Unable to download the image from %1.").arg(url.prettyURL()); + TQString tmp = i18n("Unable to download the image from %1.").tqarg(url.prettyURL()); emit sigImageError( file, tmp ); return false; } @@ -430,7 +430,7 @@ bool ImageWindow::showNextImage( KuickFile *file ) if ( !loadImage( file ) ) { TQString tmp = i18n("Unable to load the image %1.\n" "Perhaps the file format is unsupported or " - "your Imlib is not installed properly.").arg(file->url().prettyURL()); + "your Imlib is not installed properly.").tqarg(file->url().prettyURL()); emit sigImageError( file, tmp ); return false; } @@ -630,7 +630,7 @@ void ImageWindow::mousePressEvent( TQMouseEvent *e ) xposPress = xmove; yposPress = ymove; - if ( e->button() == LeftButton ) { + if ( e->button() == Qt::LeftButton ) { if ( e->state() & ShiftButton ) updateCursor( ZoomCursor ); else @@ -675,7 +675,7 @@ void ImageWindow::updateCursor( KuickCursor cursor ) void ImageWindow::mouseMoveEvent( TQMouseEvent *e ) { - if ( !(e->state() & LeftButton) ) { // only handle LeftButton actions + if ( !(e->state() & Qt::LeftButton) ) { // only handle LeftButton actions return; } @@ -692,7 +692,7 @@ void ImageWindow::mouseMoveEvent( TQMouseEvent *e ) // really required? p.eraseRect( transWidget->rect() ); transWidget->show(); - qApp->processOneEvent(); + tqApp->processOneEvent(); int width = e->x() - xposPress; int height = e->y() - yposPress; @@ -707,7 +707,7 @@ void ImageWindow::mouseMoveEvent( TQMouseEvent *e ) yzoom = e->y(); } - TQPen pen( Qt::white, 1, DashLine ); + TQPen pen( TQt::white, 1, DashLine ); p.setPen( pen ); // for drawing white dashed line p.drawRect( xzoom, yzoom, width, height ); p.setPen( DotLine ); // defaults to black dotted line pen @@ -736,7 +736,7 @@ void ImageWindow::mouseReleaseEvent( TQMouseEvent *e ) } // only proceed if shift-Key is still pressed - if ( !(e->button() == LeftButton && e->state() & ShiftButton) ) + if ( !(e->button() == Qt::LeftButton && e->state() & ShiftButton) ) return; int neww, newh, topX, topY, botX, botY; @@ -972,7 +972,7 @@ bool ImageWindow::saveImage( const KURL& dest, bool keepOriginalSize ) int w = keepOriginalSize ? m_kuim->originalWidth() : m_kuim->width(); int h = keepOriginalSize ? m_kuim->originalHeight() : m_kuim->height(); if ( m_kuim->absRotation() == ROT_90 || m_kuim->absRotation() == ROT_270 ) - qSwap( w, h ); + tqSwap( w, h ); ImlibImage *saveIm = Imlib_clone_scaled_image( id, m_kuim->imlibImage(), w, h ); @@ -987,7 +987,7 @@ bool ImageWindow::saveImage( const KURL& dest, bool keepOriginalSize ) if ( !extension.isEmpty() ) extension.prepend( '.' ); - KTempFile tmpFile( TQString::null, extension ); + KTempFile tmpFile( TQString(), extension ); if ( tmpFile.status() != 0 ) return false; tmpFile.close(); @@ -1045,7 +1045,7 @@ void ImageWindow::autoScale( KuickImage *kuim ) int mh = s.height(); if ( kuim->absRotation() == ROT_90 || kuim->absRotation() == ROT_270 ) - qSwap( newW, newH ); + tqSwap( newW, newH ); bool doIt = false; @@ -1128,7 +1128,7 @@ int ImageWindow::desktopWidth( bool totalScreen ) const { if ( myIsFullscreen || totalScreen ) { - return KGlobalSettings::desktopGeometry(topLevelWidget()).width(); + return KGlobalSettings::desktopGeometry(tqtopLevelWidget()).width(); } else return Kuick::workArea().width(); } @@ -1137,7 +1137,7 @@ int ImageWindow::desktopWidth( bool totalScreen ) const int ImageWindow::desktopHeight( bool totalScreen ) const { if ( myIsFullscreen || totalScreen ) { - return KGlobalSettings::desktopGeometry(topLevelWidget()).height(); + return KGlobalSettings::desktopGeometry(tqtopLevelWidget()).height(); } else { return Kuick::workArea().height(); } @@ -1146,7 +1146,7 @@ int ImageWindow::desktopHeight( bool totalScreen ) const TQSize ImageWindow::maxImageSize() const { if ( myIsFullscreen ) { - return KGlobalSettings::desktopGeometry(topLevelWidget()).size(); + return KGlobalSettings::desktopGeometry(tqtopLevelWidget()).size(); } else { return Kuick::workArea().size() - Kuick::frameSize( winId() ); @@ -1193,7 +1193,7 @@ bool ImageWindow::canZoomTo( int newWidth, int newHeight ) if ( !ImlibWidget::canZoomTo( newWidth, newHeight ) ) return false; - TQSize desktopSize = KGlobalSettings::desktopGeometry(topLevelWidget()).size(); + TQSize desktopSize = KGlobalSettings::desktopGeometry(tqtopLevelWidget()).size(); int desktopArea = desktopSize.width() * desktopSize.height(); int imageArea = newWidth * newHeight; @@ -1203,8 +1203,8 @@ bool ImageWindow::canZoomTo( int newWidth, int newHeight ) return KMessageBox::warningContinueCancel( this, i18n("You are about to view a very large image (%1 x %2 pixels), which can be very resource-consuming and even make your computer hang.\nDo you want to continue?") - .arg( newWidth ).arg( newHeight ), - TQString::null, + .tqarg( newWidth ).tqarg( newHeight ), + TQString(), KStdGuiItem::cont(), "ImageWindow_confirm_very_large_window" ) == KMessageBox::Continue; @@ -1245,7 +1245,7 @@ void ImageWindow::restoreCursor() bool ImageWindow::isCursorHidden() const { - return cursor().shape() == Qt::BlankCursor; + return cursor().shape() == TQt::BlankCursor; } #include "imagewindow.moc" diff --git a/kuickshow/src/imagewindow.h b/kuickshow/src/imagewindow.h index 19dc7462..f7558667 100644 --- a/kuickshow/src/imagewindow.h +++ b/kuickshow/src/imagewindow.h @@ -38,11 +38,12 @@ class KuickFile; class ImageWindow : public ImlibWidget { Q_OBJECT + TQ_OBJECT public: - ImageWindow( ImData *_idata, ImlibData *id, TQWidget *parent=0, + ImageWindow( ImData *_idata, ImlibData *id, TQWidget *tqparent=0, const char *name=0 ); - ImageWindow( ImData *_idata=0, TQWidget *parent=0, const char *name=0 ); + ImageWindow( ImData *_idata=0, TQWidget *tqparent=0, const char *name=0 ); bool showNextImage( KuickFile * file ); bool showNextImage( const KURL& url ); @@ -158,7 +159,7 @@ signals: private: int desktopWidth( bool totalScreen = false ) const; int desktopHeight( bool totalScreen = false ) const; - QSize maxImageSize() const; + TQSize maxImageSize() const; void setupActions(); void setPopupMenu(); bool isCursorHidden() const; diff --git a/kuickshow/src/imlibwidget.cpp b/kuickshow/src/imlibwidget.cpp index 8386e1ab..1eddb704 100644 --- a/kuickshow/src/imlibwidget.cpp +++ b/kuickshow/src/imlibwidget.cpp @@ -43,8 +43,8 @@ const int ImlibWidget::ImlibOffset = 256; -ImlibWidget::ImlibWidget( ImData *_idata, TQWidget *parent, const char *name ) : - TQWidget( parent, name, WDestructiveClose ) +ImlibWidget::ImlibWidget( ImData *_idata, TQWidget *tqparent, const char *name ) : + TQWidget( tqparent, name, WDestructiveClose ) { idata = _idata; deleteImData = false; @@ -82,9 +82,9 @@ ImlibWidget::ImlibWidget( ImData *_idata, TQWidget *parent, const char *name ) : } -ImlibWidget::ImlibWidget( ImData *_idata, ImlibData *_id, TQWidget *parent, +ImlibWidget::ImlibWidget( ImData *_idata, ImlibData *_id, TQWidget *tqparent, const char *name ) - : TQWidget( parent, name, WDestructiveClose ) + : TQWidget( tqparent, name, WDestructiveClose ) { id = _id; idata = _idata; @@ -104,7 +104,7 @@ void ImlibWidget::init() { int w = 1; // > 0 for XCreateWindow int h = 1; - myBackgroundColor = Qt::black; + myBackgroundColor = TQt::black; m_kuim = 0L; m_kuickFile = 0L; @@ -311,18 +311,16 @@ bool ImlibWidget::autoRotate( KuickImage *kuim ) if ( !metadatas.isValid() ) return false; - KFileMetaInfoItem metaitem = metadatas.item("Orientation"); + KFileMetaInfoItem metaitem = metadatas.item("Qt::Orientation"); if ( !metaitem.isValid() -#if QT_VERSION >= 0x030100 || metaitem.value().isNull() -#endif ) return false; switch ( metaitem.value().toInt() ) { - // Orientation: + // Qt::Orientation: // 1: normal // 2: flipped horizontally // 3: ROT 180 @@ -438,17 +436,17 @@ void ImlibWidget::setFlipMode( int mode ) } -void ImlibWidget::updateWidget( bool geometryUpdate ) +void ImlibWidget::updateWidget( bool tqgeometryUpdate ) { if ( !m_kuim ) return; -// if ( geometryUpdate ) +// if ( tqgeometryUpdate ) // XUnmapWindow( x11Display(), win );// remove the old image -> no flicker XSetWindowBackgroundPixmap( x11Display(), win, m_kuim->pixmap() ); - if ( geometryUpdate ) + if ( tqgeometryUpdate ) updateGeometry( m_kuim->width(), m_kuim->height() ); XClearWindow( x11Display(), win ); @@ -477,7 +475,7 @@ void ImlibWidget::setBackgroundColor( const TQColor& color ) { myBackgroundColor = color; setPalette( TQPalette( myBackgroundColor )); - repaint( false); // FIXME - false? necessary at all? + tqrepaint( false); // FIXME - false? necessary at all? } const TQColor& ImlibWidget::backgroundColor() const @@ -517,23 +515,23 @@ void ImlibWidget::setBusyCursor() void ImlibWidget::restoreCursor() { - if ( cursor().shape() == KCursor::waitCursor().shape() ) // only if nobody changed the cursor in the meantime! + if ( cursor().shape() == KCursor::waitCursor().tqshape() ) // only if nobody changed the cursor in the meantime! setCursor( m_oldCursor ); } -// Reparenting a widget in Qt in fact means destroying the old X window of the widget +// Retqparenting a widget in TQt in fact means destroying the old X window of the widget // and creating a new one. And since the X window used for the Imlib image is a child // of this widget's X window, destroying this widget's X window would mean also // destroying the Imlib image X window. Therefore it needs to be temporarily reparented // away and reparented back to the new X window. -// Reparenting may happen e.g. when doing the old-style (non-NETWM) fullscreen changes. -void ImlibWidget::reparent( TQWidget* parent, WFlags f, const TQPoint& p, bool showIt ) +// Retqparenting may happen e.g. when doing the old-style (non-NETWM) fullscreen changes. +void ImlibWidget::reparent( TQWidget* tqparent, WFlags f, const TQPoint& p, bool showIt ) { XWindowAttributes attr; XGetWindowAttributes( x11Display(), win, &attr ); XUnmapWindow( x11Display(), win ); XReparentWindow( x11Display(), win, attr.root, 0, 0 ); - TQWidget::reparent( parent, f, p, showIt ); + TQWidget::reparent( tqparent, f, p, showIt ); XReparentWindow( x11Display(), win, winId(), attr.x, attr.y ); if( attr.map_state != IsUnmapped ) XMapWindow( x11Display(), win ); @@ -604,7 +602,7 @@ KuickImage * ImageCache::getKuimage( KuickFile * file, return 0L; KuickImage *kuim = 0L; - int index = fileList.findIndex( file ); + int index = fileList.tqfindIndex( file ); if ( index != -1 ) { if ( index == 0 ) kuim = kuickList.at( 0 ); @@ -641,7 +639,7 @@ KuickImage * ImageCache::getKuimage( KuickFile * file, slotIdle(); if ( !im ) { slotBusy(); - im = loadImageWithQt( file->localFile() ); + im = loadImageWithTQt( file->localFile() ); slotIdle(); if ( !im ) return 0L; @@ -668,7 +666,7 @@ KuickImage * ImageCache::getKuimage( KuickFile * file, // Note: the returned image's filename will not be the real filename (which it usually // isn't anyway, according to Imlib's sources). -ImlibImage * ImageCache::loadImageWithQt( const TQString& fileName ) const +ImlibImage * ImageCache::loadImageWithTQt( const TQString& fileName ) const { kdDebug() << "Trying to load " << fileName << " with KImageIO..." << endl; @@ -695,12 +693,12 @@ ImlibImage * ImageCache::loadImageWithQt( const TQString& fileName ) const int h = image.height(); for (int y = 0; y < h; y++) { - QRgb *scanLine = reinterpret_cast( image.scanLine(y) ); + TQRgb *scanLine = reinterpret_cast( image.scanLine(y) ); for (int x = 0; x < w; x++) { - const QRgb& pixel = scanLine[x]; - *(newData++) = qRed(pixel); - *(newData++) = qGreen(pixel); - *(newData++) = qBlue(pixel); + const TQRgb& pixel = scanLine[x]; + *(newData++) = tqRed(pixel); + *(newData++) = tqGreen(pixel); + *(newData++) = tqBlue(pixel); } } diff --git a/kuickshow/src/imlibwidget.h b/kuickshow/src/imlibwidget.h index de13cad8..a83f8eb4 100644 --- a/kuickshow/src/imlibwidget.h +++ b/kuickshow/src/imlibwidget.h @@ -1,7 +1,7 @@ /**************************************************************************** ** $Id$ ** -** ImlibWidget: maps an Xlib window with Imlib's contents on a QWidget +** ImlibWidget: maps an Xlib window with Imlib's contents on a TQWidget ** ** Created : 98 ** @@ -22,7 +22,7 @@ #include -// #include those AFTER Qt-includes! +// #include those AFTER TQt-includes! #include #include #include @@ -34,9 +34,10 @@ class KuickFile; class KuickImage; -class ImageCache : public QObject +class ImageCache : public TQObject { Q_OBJECT + TQ_OBJECT public: ImageCache( ImlibData *id, int maxImages=1 ); @@ -48,7 +49,7 @@ public: KuickImage * getKuimage( KuickFile * file, ImlibColorModifier ); private: - ImlibImage * loadImageWithQt( const TQString& filename ) const; + ImlibImage * loadImageWithTQt( const TQString& filename ) const; int myMaxImages; TQValueListfileList; @@ -72,14 +73,15 @@ signals: class TQColor; -class ImlibWidget : public QWidget +class ImlibWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - ImlibWidget( ImData *_idata=0, TQWidget *parent=0, const char *name=0 ); - ImlibWidget( ImData *_idata, ImlibData *id, TQWidget *parent=0, + ImlibWidget( ImData *_idata=0, TQWidget *tqparent=0, const char *name=0 ); + ImlibWidget( ImData *_idata, ImlibData *id, TQWidget *tqparent=0, const char *name=0 ); virtual ~ImlibWidget(); @@ -119,7 +121,7 @@ public: ImlibData* getImlibData() const { return id; } - virtual void reparent( TQWidget* parent, WFlags f, const TQPoint& p, bool showIt = FALSE ); + virtual void reparent( TQWidget* tqparent, WFlags f, const TQPoint& p, bool showIt = FALSE ); public slots: void rotate90(); @@ -136,7 +138,7 @@ protected: void showImage(); void setImageModifier(); void rotate( int ); - void updateWidget( bool geometryUpdate=true ); + void updateWidget( bool tqgeometryUpdate=true ); virtual void updateGeometry( int width, int height ); virtual void loaded( KuickImage * ); virtual bool canZoomTo( int newWidth, int newHeight ); @@ -144,9 +146,9 @@ protected: void closeEvent( TQCloseEvent * ); - inline void autoUpdate( bool geometryUpdate=false ) { + inline void autoUpdate( bool tqgeometryUpdate=false ) { if ( isAutoRendering ) - updateWidget( geometryUpdate ); + updateWidget( tqgeometryUpdate ); } bool stillResizing, deleteImData, deleteImlibData; diff --git a/kuickshow/src/kuickconfigdlg.cpp b/kuickshow/src/kuickconfigdlg.cpp index 140c90d5..3d981e11 100644 --- a/kuickshow/src/kuickconfigdlg.cpp +++ b/kuickshow/src/kuickconfigdlg.cpp @@ -38,11 +38,11 @@ #include "kuickdata.h" -KuickConfigDialog::KuickConfigDialog( KActionCollection *_coll, TQWidget *parent, +KuickConfigDialog::KuickConfigDialog( KActionCollection *_coll, TQWidget *tqparent, const char *name, bool modal ) : KDialogBase( Tabbed, i18n("Configure"), Help | Default | Ok | Apply | Cancel, Ok, - parent, name, modal ) + tqparent, name, modal ) { coll = _coll; TQVBox *box = addVBoxPage( i18n("&General") ); diff --git a/kuickshow/src/kuickconfigdlg.h b/kuickshow/src/kuickconfigdlg.h index a19a6e97..9d7657b2 100644 --- a/kuickshow/src/kuickconfigdlg.h +++ b/kuickshow/src/kuickconfigdlg.h @@ -33,9 +33,10 @@ class ImageWindow; class KuickConfigDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - KuickConfigDialog( KActionCollection *coll, TQWidget *parent=0, + KuickConfigDialog( KActionCollection *coll, TQWidget *tqparent=0, const char *name=0, bool modal=true); ~KuickConfigDialog(); diff --git a/kuickshow/src/kuickdata.cpp b/kuickshow/src/kuickdata.cpp index a68a9d3e..528d1aa0 100644 --- a/kuickshow/src/kuickdata.cpp +++ b/kuickshow/src/kuickdata.cpp @@ -55,7 +55,7 @@ KuickData::KuickData() maxZoomFactor = 4.0; maxCachedImages = 4; - backgroundColor = Qt::black; + backgroundColor = TQt::black; startInLastDir = true; @@ -106,7 +106,7 @@ void KuickData::load() maxCachedImages = kc->readUnsignedNumEntry( "MaxCachedImages", def.maxCachedImages ); - backgroundColor = kc->readColorEntry( "BackgroundColor", &Qt::black ); + backgroundColor = kc->readColorEntry( "BackgroundColor", &TQt::black ); startInLastDir = kc->readBoolEntry( "StartInLastDir", true); diff --git a/kuickshow/src/kuickfile.cpp b/kuickshow/src/kuickfile.cpp index da38fdee..648cf6a6 100644 --- a/kuickshow/src/kuickfile.cpp +++ b/kuickshow/src/kuickfile.cpp @@ -41,7 +41,7 @@ TQString KuickFile::localFile() const // Note: never call isAvailable() from here, directly or indirectly if ( isDownloading() ) - return TQString::null; + return TQString(); return m_localFile; } @@ -61,13 +61,13 @@ bool KuickFile::download() return true; // reinitialize - m_localFile = TQString::null; + m_localFile = TQString(); m_currentProgress = 0; TQString ext; TQString fileName = m_url.fileName(); - int extIndex = fileName.findRev('.'); + int extIndex = fileName.tqfindRev('.'); if ( extIndex > 0 ) ext = fileName.mid( extIndex + 1 ); @@ -94,7 +94,7 @@ bool KuickFile::download() return m_job != 0L; } -KuickFile::DownloadStatus KuickFile::waitForDownload( TQWidget *parent ) +KuickFile::DownloadtqStatus KuickFile::waitForDownload( TQWidget *tqparent ) { if ( isAvailable() ) return OK; @@ -104,10 +104,10 @@ KuickFile::DownloadStatus KuickFile::waitForDownload( TQWidget *parent ) return ERROR; } - KProgressDialog *dialog = new KProgressDialog( parent ); + KProgressDialog *dialog = new KProgressDialog( tqparent ); dialog->setModal( true ); - dialog->setCaption( i18n("Downloading %1...").arg( m_url.fileName() ) ); - dialog->setLabel( i18n("Please wait while downloading\n%1").arg( m_url.prettyURL() )); + dialog->setCaption( i18n("Downloading %1...").tqarg( m_url.fileName() ) ); + dialog->setLabel( i18n("Please wait while downloading\n%1").tqarg( m_url.prettyURL() )); dialog->setAllowCancel( true ); dialog->setAutoClose( true ); @@ -152,7 +152,7 @@ void KuickFile::slotResult( KIO::Job *job ) TQString canceledFile = static_cast(job)->destURL().path(); TQFile::remove( canceledFile ); - m_progress->topLevelWidget()->hide(); + m_progress->tqtopLevelWidget()->hide(); } else { m_localFile = static_cast(job)->destURL().path(); @@ -162,7 +162,7 @@ void KuickFile::slotResult( KIO::Job *job ) m_progress->setProgress( 100 ); #define BUGGY_VERSION KDE_MAKE_VERSION(3,5,2) if ( KDE::version() <= BUGGY_VERSION ) { - m_progress->topLevelWidget()->hide(); // ### workaround broken KProgressDialog + m_progress->tqtopLevelWidget()->hide(); // ### workaround broken KProgressDialog } } } diff --git a/kuickshow/src/kuickfile.h b/kuickshow/src/kuickfile.h index 2076e612..08fa4557 100644 --- a/kuickshow/src/kuickfile.h +++ b/kuickshow/src/kuickfile.h @@ -21,12 +21,13 @@ namespace KIO { class FileCopyJob; } -class KuickFile : public QObject +class KuickFile : public TQObject { Q_OBJECT + TQ_OBJECT public: - enum DownloadStatus + enum DownloadtqStatus { OK = 1, CANCELED, @@ -71,7 +72,7 @@ public: * immediately. * @return true when the download has finished or false when the user aborted the dialog */ - KuickFile::DownloadStatus waitForDownload( TQWidget *parent ); + KuickFile::DownloadtqStatus waitForDownload( TQWidget *tqparent ); // bool needsDownload(); diff --git a/kuickshow/src/kuickimage.cpp b/kuickshow/src/kuickimage.cpp index 36fa97c2..894a0369 100644 --- a/kuickshow/src/kuickimage.cpp +++ b/kuickshow/src/kuickimage.cpp @@ -82,7 +82,7 @@ void KuickImage::rotate( Rotation rot ) } else if ( rot == ROT_90 || rot == ROT_270 ) { - qSwap( myWidth, myHeight ); + tqSwap( myWidth, myHeight ); Imlib_rotate_image( myId, myIm, -1 ); if ( rot == ROT_90 ) // rotate 90 degrees @@ -178,7 +178,7 @@ void KuickImage::restoreOriginalSize() myIsDirty = true; if ( myRotation == ROT_90 || myRotation == ROT_270 ) - qSwap( myWidth, myHeight ); + tqSwap( myWidth, myHeight ); } void KuickImage::resize( int width, int height, KuickImage::ResizeMode mode ) @@ -212,9 +212,9 @@ bool KuickImage::smoothResize( int newWidth, int newHeight ) { // qDebug("-- smoothResize: %i x %i", newWidth, newHeight); - TQImage *image = newQImage(); - // Note: TQImage::ScaleMin seems to have a bug (off-by-one, sometimes results in width being 1 pixel too small) - TQImage scaledImage = image->smoothScale(newWidth, newHeight, TQImage::ScaleFree); + TQImage *image = newTQImage(); + // Note: TQ_ScaleMin seems to have a bug (off-by-one, sometimes results in width being 1 pixel too small) + TQImage scaledImage = image->smoothScale(newWidth, newHeight, TQ_ScaleFree); delete image; @@ -235,11 +235,11 @@ bool KuickImage::smoothResize( int newWidth, int newHeight ) return false; } -TQImage * KuickImage::newQImage() const +TQImage * KuickImage::newTQImage() const { ImlibImage *im; -// qDebug("-- newQImage"); +// qDebug("-- newTQImage"); if ( myOrigIm != 0L && myRotation == ROT_0 && myFlipMode == FlipNone ) { @@ -257,7 +257,7 @@ TQImage * KuickImage::newQImage() const TQImage *image = new TQImage( w, h, 32 ); uchar *rgb = im->rgb_data; - QRgb **destImageData = reinterpret_cast( image->jumpTable() ); + TQRgb **destImageData = reinterpret_cast( image->jumpTable() ); int byteIndex = 0; @@ -275,7 +275,7 @@ TQImage * KuickImage::newQImage() const uchar g = rgb[byteIndex++]; uchar b = rgb[byteIndex++]; - QRgb rgbPixel = qRgb( r, g, b ); + TQRgb rgbPixel = tqRgb( r, g, b ); destImageData[destLineIndex][destByteIndex++] = rgbPixel; } @@ -306,12 +306,12 @@ ImlibImage * KuickImage::toImage( ImlibData *id, TQImage& image ) int h = image.height(); for (int y = 0; y < h; y++) { - QRgb *scanLine = reinterpret_cast( image.scanLine(y) ); + TQRgb *scanLine = reinterpret_cast( image.scanLine(y) ); for (int x = 0; x < w; x++) { - const QRgb& pixel = scanLine[x]; - *(newData++) = qRed(pixel); - *(newData++) = qGreen(pixel); - *(newData++) = qBlue(pixel); + const TQRgb& pixel = scanLine[x]; + *(newData++) = tqRed(pixel); + *(newData++) = tqGreen(pixel); + *(newData++) = tqBlue(pixel); } } @@ -341,7 +341,7 @@ bool KuickImage::smoothResize( int newWidth, int newHeight ) //TQImage dst(w, h, myIm->depth(), myIm->numColors(), myIm->bitOrder()); - //QRgb *scanline; + //TQRgb *scanline; int basis_ox, basis_oy, basis_xx, basis_yy; @@ -363,10 +363,10 @@ bool KuickImage::smoothResize( int newWidth, int newHeight ) int max_x2 = (myOrigWidth << 12); int max_y2 = (myOrigHeight << 12); -// QRgb background = idata->backgroundColor.rgb(); +// TQRgb background = idata->backgroundColor.rgb(); -// QRgb **imdata = (QRgb **) myIm->jumpTable(); -// QRgb *imdata = reinterpret_cast( myIm->rgb_data ); +// TQRgb **imdata = (TQRgb **) myIm->jumpTable(); +// TQRgb *imdata = reinterpret_cast( myIm->rgb_data ); uchar *imdata = myIm->rgb_data; @@ -380,15 +380,15 @@ bool KuickImage::smoothResize( int newWidth, int newHeight ) // if ((y2 >= 0 && (y2 >> 12) < myIm->height()) || y >= h) // break; // -// scanline = (QRgb*) dst.scanLine(y); +// scanline = (TQRgb*) dst.scanLine(y); // for (int i = 0; i < w; i++) -// *(scanline++) = background; //qRgb(0,255,0); +// *(scanline++) = background; //tqRgb(0,255,0); // y++; // } for (; y < newHeight; y++) { -// scanline = (QRgb*) dst.scanLine(y); +// scanline = (TQRgb*) dst.scanLine(y); x2 = basis_ox; y2 = basis_oy + y * basis_yy; @@ -400,7 +400,7 @@ bool KuickImage::smoothResize( int newWidth, int newHeight ) // while ((x2 < 0 || (x2 >> 12) >= myIm->width()) && x < w) //fill the left of the target pixmap with the background color // { -// *(scanline++) = background; //qRgb(0,0,255); +// *(scanline++) = background; //tqRgb(0,0,255); // x2 += basis_xx; // x++; // } @@ -425,14 +425,14 @@ bool KuickImage::smoothResize( int newWidth, int newHeight ) unsigned int iwx = 0xfff - wx; unsigned int iwy = 0xfff - wy; - QRgb tl = 0, tr = 0, bl = 0, br = 0; + TQRgb tl = 0, tr = 0, bl = 0, br = 0; int ind = 0; ind = (left + top * myOrigWidth) * 3; tl = (imdata[ind] << 16); tl |= (imdata[ind + 1] << 8); tl |= (imdata[ind + 2] << 0); int bar = imdata[ind + 2] << 8; - bar = qBlue(bar); + bar = tqBlue(bar); ind = (right + top * myOrigWidth) * 3; tr = (imdata[ind] << 16); @@ -462,9 +462,9 @@ bool KuickImage::smoothResize( int newWidth, int newHeight ) br=getValidPixel(myIm, right, bottom, x, y); */ - unsigned int r = (unsigned int) (qRed(tl) * iwx * iwy + qRed(tr) * wx* iwy + qRed(bl) * iwx * wy + qRed(br) * wx * wy); // NB 12+12+8 == 32 - unsigned int g = (unsigned int) (qGreen(tl) * iwx * iwy + qGreen(tr) * wx * iwy + qGreen(bl) * iwx * wy + qGreen(br) * wx * wy); - unsigned int b = (unsigned int) (qBlue(tl) * iwx * iwy + qBlue(tr) * wx * iwy + qBlue(bl) * iwx * wy + qBlue(br) * wx * wy); + unsigned int r = (unsigned int) (tqRed(tl) * iwx * iwy + tqRed(tr) * wx* iwy + tqRed(bl) * iwx * wy + tqRed(br) * wx * wy); // NB 12+12+8 == 32 + unsigned int g = (unsigned int) (tqGreen(tl) * iwx * iwy + tqGreen(tr) * wx * iwy + tqGreen(bl) * iwx * wy + tqGreen(br) * wx * wy); + unsigned int b = (unsigned int) (tqBlue(tl) * iwx * iwy + tqBlue(tr) * wx * iwy + tqBlue(bl) * iwx * wy + tqBlue(br) * wx * wy); // ### endianness //we're actually off by one in 255 here! (254 instead of 255) @@ -474,7 +474,7 @@ bool KuickImage::smoothResize( int newWidth, int newHeight ) newImageData[(y * newWidth * 3) + (x * 3) + 0] = (r >> 24); newImageData[(y * newWidth * 3) + (x * 3) + 1] = (g >> 24); newImageData[(y * newWidth * 3) + (x * 3) + 2] = (b >> 24); -// *(scanline++) = qRgb(r >> 24, g >> 24, b >> 24); //we're actually off by one in 255 here +// *(scanline++) = tqRgb(r >> 24, g >> 24, b >> 24); //we're actually off by one in 255 here x2 += basis_xx; @@ -488,7 +488,7 @@ bool KuickImage::smoothResize( int newWidth, int newHeight ) // while (x < w) //fill the right of each scanline with the background colour // { -// *(scanline++) = background; //qRgb(255,0,0); +// *(scanline++) = background; //tqRgb(255,0,0); // x++; // } } @@ -500,9 +500,9 @@ bool KuickImage::smoothResize( int newWidth, int newHeight ) // if (y >= h) // break; // -// scanline = (QRgb*) dst.scanLine(y); +// scanline = (TQRgb*) dst.scanLine(y); // for (int i = 0; i < w; i++) -// *(scanline++) = background; //qRgb(255,255,0); +// *(scanline++) = background; //tqRgb(255,255,0); // y++; // } diff --git a/kuickshow/src/kuickimage.h b/kuickshow/src/kuickimage.h index 4463e83a..a1875e11 100644 --- a/kuickshow/src/kuickimage.h +++ b/kuickshow/src/kuickimage.h @@ -18,16 +18,17 @@ #include "kuickdata.h" #include "kuickfile.h" -// #include those AFTER Qt-includes! +// #include those AFTER TQt-includes! #include #include #include // #include -class KuickImage : public QObject +class KuickImage : public TQObject { Q_OBJECT + TQ_OBJECT public: enum ResizeMode { FAST, SMOOTH }; @@ -66,7 +67,7 @@ private: /** * Note: caller must delete it! */ - TQImage * newQImage() const; + TQImage * newTQImage() const; const KuickFile * myFile; diff --git a/kuickshow/src/kuickshow.cpp b/kuickshow/src/kuickshow.cpp index 5504d01d..7186db09 100644 --- a/kuickshow/src/kuickshow.cpp +++ b/kuickshow/src/kuickshow.cpp @@ -133,7 +133,7 @@ KuickShow::KuickShow( const char *name ) if ( KMessageBox::warningYesNo( this, i18n("Do you really want to display this 1 image at the same time? This might be quite resource intensive and could overload your computer.
If you choose %1, only the first image will be shown.", - "Do you really want to display these %n images at the same time? This might be quite resource intensive and could overload your computer.
If you choose %1, only the first image will be shown.", numArgs).arg(KStdGuiItem::no().plainText()), + "Do you really want to display these %n images at the same time? This might be quite resource intensive and could overload your computer.
If you choose %1, only the first image will be shown.", numArgs).tqarg(KStdGuiItem::no().plainText()), i18n("Display Multiple Images?")) != KMessageBox::Yes ) { @@ -246,24 +246,24 @@ void KuickShow::initGUI( const KURL& startDir ) this, TQT_SLOT( slotDropped( const KFileItem *, TQDropEvent *, const KURL::List &)) ); // setup actions - KAction *open = KStdAction::open( this, TQT_SLOT( slotOpenURL() ), + KAction *open = KStdAction::open( TQT_TQOBJECT(this), TQT_SLOT( slotOpenURL() ), coll, "openURL" ); - KAction *print = KStdAction::print( this, TQT_SLOT( slotPrint() ), + KAction *print = KStdAction::print( TQT_TQOBJECT(this), TQT_SLOT( slotPrint() ), coll, "kuick_print" ); print->setText( i18n("Print Image...") ); - KAction *configure = new KAction( i18n("Configure %1...").arg( KGlobal::instance()->aboutData()->programName() ), "configure", + KAction *configure = new KAction( i18n("Configure %1...").tqarg( KGlobal::instance()->aboutData()->programName() ), "configure", KShortcut(), - this, TQT_SLOT( configuration() ), + TQT_TQOBJECT(this), TQT_SLOT( configuration() ), coll, "kuick_configure" ); KAction *slide = new KAction( i18n("Start Slideshow" ), "ksslide", KShortcut( Key_F2 ), - this, TQT_SLOT( startSlideShow() ), + TQT_TQOBJECT(this), TQT_SLOT( startSlideShow() ), coll, "kuick_slideshow" ); KAction *about = new KAction( i18n( "About KuickShow" ), "about", KShortcut(), - this, TQT_SLOT( about() ), coll, "about" ); + TQT_TQOBJECT(this), TQT_SLOT( about() ), coll, "about" ); oneWindowAction = new KToggleAction( i18n("Open Only One Image Window"), "window_new", @@ -276,20 +276,20 @@ void KuickShow::initGUI( const KURL& startDir ) TQT_SLOT( toggleBrowser() )); KAction *showInOther = new KAction( i18n("Show Image"), KShortcut(), - this, TQT_SLOT( slotShowInOtherWindow() ), + TQT_TQOBJECT(this), TQT_SLOT( slotShowInOtherWindow() ), coll, "kuick_showInOtherWindow" ); KAction *showInSame = new KAction( i18n("Show Image in Active Window"), KShortcut(), - this, TQT_SLOT( slotShowInSameWindow() ), + TQT_TQOBJECT(this), TQT_SLOT( slotShowInSameWindow() ), coll, "kuick_showInSameWindow" ); KAction *showFullscreen = new KAction( i18n("Show Image in Fullscreen Mode"), - KShortcut(), this, TQT_SLOT( slotShowFullscreen() ), + KShortcut(), TQT_TQOBJECT(this), TQT_SLOT( slotShowFullscreen() ), coll, "kuick_showFullscreen" ); - KAction *quit = KStdAction::quit( this, TQT_SLOT(slotQuit()), coll, "quit"); + KAction *quit = KStdAction::quit( TQT_TQOBJECT(this), TQT_SLOT(slotQuit()), coll, "quit"); - // remove TQString::null parameter -- ellis - coll->readShortcutSettings( TQString::null ); + // remove TQString() parameter -- ellis + coll->readShortcutSettings( TQString() ); m_accel = coll->accel(); // menubar @@ -319,7 +319,7 @@ void KuickShow::initGUI( const KURL& startDir ) TQPopupMenu *mainPopup = mainActionMenu->popupMenu(); int sortingIndex = mainPopup->indexOf( sortingMenu->itemId( 0 ) ); int separatorId = mainPopup->idAt( sortingIndex + 1 ); - TQMenuItem *separatorItem = mainPopup->findItem( separatorId ); + TQMenuItem *separatorItem = mainPopup->tqfindItem( separatorId ); if ( separatorItem && separatorItem->isSeparator() ) mainPopup->removeItem( separatorId ); mainActionMenu->remove( sortingMenu ); @@ -363,7 +363,7 @@ void KuickShow::initGUI( const KURL& startDir ) tBar->insertSeparator(); about->plug( tBar ); - TQPopupMenu *help = helpMenu( TQString::null, false ); + TQPopupMenu *help = helpMenu( TQString(), false ); mBar->insertItem( KStdGuiItem::help().text() , help ); @@ -552,7 +552,7 @@ bool KuickShow::showImage( const KFileItem *fi, this, TQT_SLOT (slotTrashCurrentImage (ImageWindow *))); if ( s_viewers.count() == 1 && moveToTopLeft ) { // we have to move to 0x0 before showing _and_ - // after showing, otherwise we get some bogus geometry() + // after showing, otherwise we get some bogus tqgeometry() m_viewer->move( Kuick::workArea().topLeft() ); } @@ -631,7 +631,7 @@ void KuickShow::slotTrashCurrentImage(ImageWindow *viewer) performTrashCurrentImage(viewer); } -void KuickShow::performDeleteCurrentImage(TQWidget *parent) +void KuickShow::performDeleteCurrentImage(TQWidget *tqparent) { assert(fileWidget != 0L); @@ -640,8 +640,8 @@ void KuickShow::performDeleteCurrentImage(TQWidget *parent) list.append (item); if (KMessageBox::warningContinueCancel( - parent, - i18n("Do you really want to delete\n '%1'?").arg(item->url().pathOrURL()), + tqparent, + i18n("Do you really want to delete\n '%1'?").tqarg(item->url().pathOrURL()), i18n("Delete File"), KStdGuiItem::del(), "Kuick_delete_current_image") @@ -654,7 +654,7 @@ void KuickShow::performDeleteCurrentImage(TQWidget *parent) fileWidget->del(list, false, false); } -void KuickShow::performTrashCurrentImage(TQWidget *parent) +void KuickShow::performTrashCurrentImage(TQWidget *tqparent) { assert(fileWidget != 0L); @@ -665,8 +665,8 @@ void KuickShow::performTrashCurrentImage(TQWidget *parent) list.append (item); if (KMessageBox::warningContinueCancel( - parent, - i18n("Do you really want to trash\n '%1'?").arg(item->url().pathOrURL()), + tqparent, + i18n("Do you really want to trash\n '%1'?").tqarg(item->url().pathOrURL()), i18n("Trash File"), KGuiItem(i18n("to trash", "&Trash"),"edittrash"), "Kuick_trash_current_image") @@ -676,7 +676,7 @@ void KuickShow::performTrashCurrentImage(TQWidget *parent) } tryShowNextImage(); - fileWidget->trash(list, parent, false, false); + fileWidget->trash(list, tqparent, false, false); } void KuickShow::tryShowNextImage() @@ -880,7 +880,7 @@ bool KuickShow::eventFilter( TQObject *o, TQEvent *e ) int eventType = e->type(); TQKeyEvent *k = 0L; if ( eventType == TQEvent::KeyPress ) - k = static_cast( e ); + k = TQT_TQKEYEVENT( e ); if ( k ) { if ( KStdAccel::quit().contains( KKey( k ) ) ) { @@ -1036,8 +1036,8 @@ bool KuickShow::eventFilter( TQObject *o, TQEvent *e ) // and shows browser when last window closed via doubleclick else if ( eventType == TQEvent::MouseButtonDblClick ) { - TQMouseEvent *ev = static_cast( e ); - if ( ev->button() == LeftButton ) + TQMouseEvent *ev = TQT_TQMOUSEEVENT( e ); + if ( ev->button() == Qt::LeftButton ) { if ( s_viewers.count() == 1 ) { @@ -1300,10 +1300,10 @@ void KuickShow::slotReplayEvent() DelayedRepeatEvent *e = m_delayedRepeatItem; m_delayedRepeatItem = 0L; // otherwise, eventFilter aborts - eventFilter( e->viewer, e->event ); + eventFilter( TQT_TQOBJECT(e->viewer), TQT_TQEVENT(e->event) ); delete e; - // ### WORKAROUND for TQIconView bug in Qt <= 3.0.3 at least + // ### WORKAROUND for TQIconView bug in TQt <= 3.0.3 at least if ( fileWidget && fileWidget->view() ) { TQWidget *widget = fileWidget->view()->widget(); if ( widget->inherits( TQICONVIEW_OBJECT_NAME_STRING ) || widget->child(0, TQICONVIEW_OBJECT_NAME_STRING ) ){ @@ -1315,7 +1315,7 @@ void KuickShow::slotReplayEvent() void KuickShow::replayAdvance(DelayedRepeatEvent *event) { - // ### WORKAROUND for TQIconView bug in Qt <= 3.0.3 at least + // ### WORKAROUND for TQIconView bug in TQt <= 3.0.3 at least // Sigh. According to qt-bugs, they won't fix this bug ever. So you can't // rely on sorting to be correct before the TQIconView has been show()n. if ( fileWidget && fileWidget->view() ) { @@ -1401,7 +1401,7 @@ void KuickShow::toggleBrowser() void KuickShow::slotOpenURL() { - KFileDialog dlg(TQString::null, kdata->fileFilter, this, "filedialog", true); + KFileDialog dlg(TQString(), kdata->fileFilter, this, "filedialog", true); dlg.setMode( KFile::Files | KFile::Directory ); dlg.setCaption( i18n("Select Files or Folder to Open") ); diff --git a/kuickshow/src/kuickshow.h b/kuickshow/src/kuickshow.h index 4aeb1f2e..f45027dd 100644 --- a/kuickshow/src/kuickshow.h +++ b/kuickshow/src/kuickshow.h @@ -82,6 +82,7 @@ public: class KuickShow : public KMainWindow { Q_OBJECT + TQ_OBJECT public: KuickShow( const char *name=0 ); @@ -132,7 +133,7 @@ private slots: void slotOpenURL(); void slotSetURL( const KURL& ); void slotURLComboReturnPressed(); -// void invalidateImages( const KFileItemList& items ); +// void tqinvalidateImages( const KFileItemList& items ); void slotDeleteCurrentImage(ImageWindow *viewer); void slotTrashCurrentImage(ImageWindow *viewer); void slotDeleteCurrentImage(); @@ -155,8 +156,8 @@ private: void delayAction(DelayedRepeatEvent *event); void replayAdvance(DelayedRepeatEvent *event); - void performDeleteCurrentImage(TQWidget *parent); - void performTrashCurrentImage(TQWidget *parent); + void performDeleteCurrentImage(TQWidget *tqparent); + void performTrashCurrentImage(TQWidget *tqparent); uint viewItem, renameItem, deleteItem, printItem; uint m_slideshowCycle; diff --git a/kuickshow/src/kurlwidget.cpp b/kuickshow/src/kurlwidget.cpp index 342c78c5..3d231061 100644 --- a/kuickshow/src/kurlwidget.cpp +++ b/kuickshow/src/kurlwidget.cpp @@ -23,8 +23,8 @@ #include "kurlwidget.h" -KURLWidget::KURLWidget(const TQString& text, TQWidget *parent, const char *name) - : KURLLabel( parent, name ) +KURLWidget::KURLWidget(const TQString& text, TQWidget *tqparent, const char *name) + : KURLLabel( tqparent, name ) { setText( text ); connect( this, TQT_SIGNAL( leftClickedURL() ), TQT_SLOT( run() )); diff --git a/kuickshow/src/kurlwidget.h b/kuickshow/src/kurlwidget.h index 68b621fc..cb02bf7e 100644 --- a/kuickshow/src/kurlwidget.h +++ b/kuickshow/src/kurlwidget.h @@ -24,6 +24,7 @@ class KURLWidget : public KURLLabel { Q_OBJECT + TQ_OBJECT public: KURLWidget( const TQString& text, TQWidget *, const char *name=0 ); diff --git a/kuickshow/src/mainwidget.cpp b/kuickshow/src/mainwidget.cpp index 47b3d837..b9e63576 100644 --- a/kuickshow/src/mainwidget.cpp +++ b/kuickshow/src/mainwidget.cpp @@ -21,8 +21,8 @@ #include "mainwidget.h" -MainWidget::MainWidget( TQString startDir, TQWidget *parent, - const char *name ) : TQWidget ( parent, name ) +MainWidget::MainWidget( TQString startDir, TQWidget *tqparent, + const char *name ) : TQWidget ( tqparent, name ) { box = new FileView( startDir, true, (TQDir::Dirs | TQDir::Files), this, "fileview" ); @@ -35,7 +35,7 @@ MainWidget::~MainWidget() } -// for now, no layout managers +// for now, no tqlayout managers void MainWidget::resizeEvent( TQResizeEvent * ) { box->resize( width(), height() ); diff --git a/kuickshow/src/mainwidget.h b/kuickshow/src/mainwidget.h index bb633ba8..875fbcec 100644 --- a/kuickshow/src/mainwidget.h +++ b/kuickshow/src/mainwidget.h @@ -25,12 +25,13 @@ class FileView; -class MainWidget : public QWidget +class MainWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - MainWidget( TQString, TQWidget *parent, const char *name=0L); + MainWidget( TQString, TQWidget *tqparent, const char *name=0L); ~MainWidget(); FileView* getFileBox() { return box; } diff --git a/kuickshow/src/printing.cpp b/kuickshow/src/printing.cpp index 64687e55..b2a4de64 100644 --- a/kuickshow/src/printing.cpp +++ b/kuickshow/src/printing.cpp @@ -43,23 +43,23 @@ #include "printing.h" #include "version.h" -bool Printing::printImage( ImageWindow& imageWin, TQWidget *parent ) +bool Printing::printImage( ImageWindow& imageWin, TQWidget *tqparent ) { TQString imageURL = imageWin.url().prettyURL(); KPrinter printer; printer.setDocName( imageURL ); printer.setCreator( "KuickShow-" KUICKSHOWVERSION ); - KPrinter::addDialogPage( new KuickPrintDialogPage( parent, "kuick page")); + KPrinter::addDialogPage( new KuickPrintDialogPage( tqparent, "kuick page")); - if ( printer.setup( parent, i18n("Print %1").arg(printer.docName().section('/', -1)) ) ) + if ( printer.setup( tqparent, i18n("Print %1").tqarg(printer.docName().section('/', -1)) ) ) { - KTempFile tmpFile( TQString::null, ".png" ); + KTempFile tmpFile( TQString(), ".png" ); if ( tmpFile.status() == 0 ) { tmpFile.setAutoDelete( true ); if ( imageWin.saveImage( tmpFile.name(), true ) ) - return printImageWithQt( tmpFile.name(), printer, + return printImageWithTQt( tmpFile.name(), printer, imageURL ); } @@ -69,7 +69,7 @@ bool Printing::printImage( ImageWindow& imageWin, TQWidget *parent ) return true; // user aborted } -bool Printing::printImageWithQt( const TQString& filename, KPrinter& printer, +bool Printing::printImageWithTQt( const TQString& filename, KPrinter& printer, const TQString& originalFileName ) { TQImage image( filename ); @@ -109,7 +109,7 @@ bool Printing::printImageWithQt( const TQString& filename, KPrinter& printer, bool shrinkToFit = (printer.option( "app-kuickshow-shrinkToFit" ) != f); TQSize imagesize = image.size(); if ( shrinkToFit && (image.width() > w || image.height() > h) ) { - imagesize.scale( w, h, TQSize::ScaleMin ); + imagesize.tqscale( w, h, TQSize::ScaleMin ); } @@ -117,28 +117,28 @@ bool Printing::printImageWithQt( const TQString& filename, KPrinter& printer, // align image // bool ok = false; - int alignment = printer.option("app-kuickshow-alignment").toInt( &ok ); + int tqalignment = printer.option("app-kuickshow-tqalignment").toInt( &ok ); if ( !ok ) - alignment = Qt::AlignCenter; // default + tqalignment = TQt::AlignCenter; // default int x = 0; int y = 0; // ### need a GUI for this in KuickPrintDialogPage! - // x - alignment - if ( alignment & Qt::AlignHCenter ) + // x - tqalignment + if ( tqalignment & TQt::AlignHCenter ) x = (w - imagesize.width())/2; - else if ( alignment & Qt::AlignLeft ) + else if ( tqalignment & TQt::AlignLeft ) x = 0; - else if ( alignment & Qt::AlignRight ) + else if ( tqalignment & TQt::AlignRight ) x = w - imagesize.width(); - // y - alignment - if ( alignment & Qt::AlignVCenter ) + // y - tqalignment + if ( tqalignment & TQt::AlignVCenter ) y = (h - imagesize.height())/2; - else if ( alignment & Qt::AlignTop ) + else if ( tqalignment & TQt::AlignTop ) y = 0; - else if ( alignment & Qt::AlignBottom ) + else if ( tqalignment & TQt::AlignBottom ) y = h - imagesize.height(); // @@ -167,7 +167,7 @@ TQString Printing::minimizeString( TQString text, const TQFontMetrics& metrics, int maxWidth ) { if ( text.length() <= 5 ) - return TQString::null; // no sense to cut that tiny little string + return TQString(); // no sense to cut that tiny little string bool changed = false; while ( metrics.width( text ) > maxWidth ) @@ -181,9 +181,9 @@ TQString Printing::minimizeString( TQString text, const TQFontMetrics& { int mid = text.length() / 2; if ( mid <= 5 ) // sanity check - return TQString::null; + return TQString(); - text.replace( mid - 1, 3, "..." ); + text.tqreplace( mid - 1, 3, "..." ); } return text; @@ -194,26 +194,26 @@ TQString Printing::minimizeString( TQString text, const TQFontMetrics& /////////////////////////////////////////////////////////////////// -KuickPrintDialogPage::KuickPrintDialogPage( TQWidget *parent, const char *name ) - : KPrintDialogPage( parent, name ) +KuickPrintDialogPage::KuickPrintDialogPage( TQWidget *tqparent, const char *name ) + : KPrintDialogPage( tqparent, name ) { setTitle( i18n("Image Settings") ); - TQVBoxLayout *layout = new TQVBoxLayout( this ); - layout->setMargin( KDialog::marginHint() ); - layout->setSpacing( KDialog::spacingHint() ); + TQVBoxLayout *tqlayout = new TQVBoxLayout( this ); + tqlayout->setMargin( KDialog::marginHint() ); + tqlayout->setSpacing( KDialog::spacingHint() ); m_addFileName = new TQCheckBox( i18n("Print fi&lename below image"), this); m_addFileName->setChecked( true ); - layout->addWidget( m_addFileName ); + tqlayout->addWidget( m_addFileName ); m_blackwhite = new TQCheckBox ( i18n("Print image in &black and white"), this); m_blackwhite->setChecked( false ); - layout->addWidget (m_blackwhite ); + tqlayout->addWidget (m_blackwhite ); TQVButtonGroup *group = new TQVButtonGroup( i18n("Scaling"), this ); group->setRadioButtonExclusive( true ); - layout->addWidget( group ); + tqlayout->addWidget( group ); // m_shrinkToFit = new TQRadioButton( i18n("Shrink image to &fit, if necessary"), group ); m_shrinkToFit = new TQCheckBox( i18n("Shrink image to &fit, if necessary"), group ); m_shrinkToFit->setChecked( true ); @@ -258,7 +258,7 @@ void KuickPrintDialogPage::getOptions( TQMap& opts, TQString t = "true"; TQString f = "false"; -// ### opts["app-kuickshow-alignment"] = ; +// ### opts["app-kuickshow-tqalignment"] = ; opts["app-kuickshow-printFilename"] = m_addFileName->isChecked() ? t : f; opts["app-kuickshow-blackwhite"] = m_blackwhite->isChecked() ? t : f; opts["app-kuickshow-shrinkToFit"] = m_shrinkToFit->isChecked() ? t : f; diff --git a/kuickshow/src/printing.h b/kuickshow/src/printing.h index 43365bf4..f58f05da 100644 --- a/kuickshow/src/printing.h +++ b/kuickshow/src/printing.h @@ -36,8 +36,8 @@ class ImageWindow; class Printing { public: - static bool printImage( ImageWindow& imageWin, TQWidget *parent = 0L); - static bool printImageWithQt( const TQString& filename, KPrinter& printer, + static bool printImage( ImageWindow& imageWin, TQWidget *tqparent = 0L); + static bool printImageWithTQt( const TQString& filename, KPrinter& printer, const TQString& originalFileName ); private: @@ -50,9 +50,10 @@ private: class KuickPrintDialogPage : public KPrintDialogPage { Q_OBJECT + TQ_OBJECT public: - KuickPrintDialogPage( TQWidget *parent = 0L, const char *name = 0 ); + KuickPrintDialogPage( TQWidget *tqparent = 0L, const char *name = 0 ); ~KuickPrintDialogPage(); virtual void getOptions(TQMap& opts, bool incldef = false); diff --git a/kuickshow/src/slideshowwidget.cpp b/kuickshow/src/slideshowwidget.cpp index 9727c203..a35f159c 100644 --- a/kuickshow/src/slideshowwidget.cpp +++ b/kuickshow/src/slideshowwidget.cpp @@ -26,13 +26,13 @@ #include "slideshowwidget.h" -SlideShowWidget::SlideShowWidget( TQWidget *parent, const char *name ) - : TQWidget( parent, name ) +SlideShowWidget::SlideShowWidget( TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ) { // setTitle( i18n("Slideshow") ); - TQVBoxLayout *layout = new TQVBoxLayout( this ); - layout->setSpacing( KDialog::spacingHint() ); + TQVBoxLayout *tqlayout = new TQVBoxLayout( this ); + tqlayout->setSpacing( KDialog::spacingHint() ); m_fullScreen = new TQCheckBox( i18n("Switch to &full-screen"), this ); m_startWithCurrent = new TQCheckBox( i18n("S&tart with current image"), this); @@ -48,11 +48,11 @@ SlideShowWidget::SlideShowWidget( TQWidget *parent, const char *name ) m_cycles->setSpecialValueText( i18n("infinite") ); m_cycles->setRange( 0, 500 ); - layout->addWidget( m_fullScreen ); - layout->addWidget( m_startWithCurrent ); - layout->addWidget( m_delayTime ); - layout->addWidget( m_cycles ); - layout->addStretch( 1 ); + tqlayout->addWidget( m_fullScreen ); + tqlayout->addWidget( m_startWithCurrent ); + tqlayout->addWidget( m_delayTime ); + tqlayout->addWidget( m_cycles ); + tqlayout->addStretch( 1 ); loadSettings( *kdata ); } diff --git a/kuickshow/src/slideshowwidget.h b/kuickshow/src/slideshowwidget.h index 182a977d..4408b20e 100644 --- a/kuickshow/src/slideshowwidget.h +++ b/kuickshow/src/slideshowwidget.h @@ -24,11 +24,12 @@ class TQCheckBox; class KIntNumInput; -class SlideShowWidget : public QWidget +class SlideShowWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - SlideShowWidget( TQWidget *parent, const char *name ); + SlideShowWidget( TQWidget *tqparent, const char *name ); ~SlideShowWidget(); virtual void loadSettings( const KuickData& data ); -- cgit v1.2.1