From 48d4a26399959121f33d2bc3bfe51c7827b654fc Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 14 Jun 2011 16:45:05 +0000 Subject: TQt4 port kdevelop This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- languages/cpp/app_templates/qmakeapp/qmakeapp.cpp | 34 +++++++++++------------ languages/cpp/app_templates/qmakeapp/qmakeapp.h | 5 ++-- 2 files changed, 20 insertions(+), 19 deletions(-) (limited to 'languages/cpp/app_templates/qmakeapp') diff --git a/languages/cpp/app_templates/qmakeapp/qmakeapp.cpp b/languages/cpp/app_templates/qmakeapp/qmakeapp.cpp index f3c5f7f2..4b78645a 100644 --- a/languages/cpp/app_templates/qmakeapp/qmakeapp.cpp +++ b/languages/cpp/app_templates/qmakeapp/qmakeapp.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include @@ -36,17 +36,17 @@ openIcon = TQPixmap( fileopen ); TQToolButton * fileOpen - = new TQToolButton( openIcon, tr("Open File"), TQString::null, + = new TQToolButton( openIcon, tr("Open File"), TQString(), this, TQT_SLOT(choose()), fileTools, "open file" ); saveIcon = TQPixmap( filesave ); TQToolButton * fileSave - = new TQToolButton( saveIcon, tr("Save File"), TQString::null, + = new TQToolButton( saveIcon, tr("Save File"), TQString(), this, TQT_SLOT(save()), fileTools, "save file" ); printIcon = TQPixmap( fileprint ); TQToolButton * filePrint - = new TQToolButton( printIcon, tr("Print File"), TQString::null, + = new TQToolButton( printIcon, tr("Print File"), TQString(), this, TQT_SLOT(print()), fileTools, "print file" ); @@ -103,7 +103,7 @@ file->insertItem( tr("&Close"), this, TQT_SLOT(close()), CTRL+Key_W ); - file->insertItem( tr("&Quit"), qApp, TQT_SLOT( closeAllWindows() ), CTRL+Key_Q ); + file->insertItem( tr("&Quit"), tqApp, TQT_SLOT( closeAllWindows() ), CTRL+Key_Q ); menuBar()->insertSeparator(); @@ -111,7 +111,7 @@ menuBar()->insertItem( tr("&Help"), help ); help->insertItem( tr("&About"), this, TQT_SLOT(about()), Key_F1 ); - help->insertItem( tr("About &Qt"), this, TQT_SLOT(aboutQt()) ); + help->insertItem( tr("About &TQt"), this, TQT_SLOT(aboutTQt()) ); help->insertSeparator(); help->insertItem( tr("What's &This"), this, TQT_SLOT(whatsThis()), SHIFT+Key_F1 ); @@ -134,13 +134,13 @@ void %{APPNAME}::newDoc() { %{APPNAME} *ed = new %{APPNAME}; - ed->setCaption(tr("Qt Example - Application")); + ed->setCaption(tr("TQt Example - Application")); ed->show(); } void %{APPNAME}::choose() { - TQString fn = TQFileDialog::getOpenFileName( TQString::null, TQString::null, + TQString fn = TQFileDialog::getOpenFileName( TQString(), TQString(), this); if ( !fn.isEmpty() ) load( fn ); @@ -159,7 +159,7 @@ void %{APPNAME}::load( const TQString &fileName ) e->setText( ts.read() ); e->setModified( FALSE ); setCaption( fileName ); - statusBar()->message( tr("Loaded document %1").arg(fileName), 2000 ); + statusBar()->message( tr("Loaded document %1").tqarg(fileName), 2000 ); } @@ -173,7 +173,7 @@ void %{APPNAME}::save() TQString text = e->text(); TQFile f( filename ); if ( !f.open( IO_WriteOnly ) ) { - statusBar()->message( tr("Could not write to %1").arg(filename), + statusBar()->message( tr("Could not write to %1").tqarg(filename), 2000 ); return; } @@ -186,13 +186,13 @@ void %{APPNAME}::save() setCaption( filename ); - statusBar()->message( tr( "File %1 saved" ).arg( filename ), 2000 ); + statusBar()->message( tr( "File %1 saved" ).tqarg( filename ), 2000 ); } void %{APPNAME}::saveAs() { - TQString fn = TQFileDialog::getSaveFileName( TQString::null, TQString::null, + TQString fn = TQFileDialog::getSaveFileName( TQString(), TQString(), this ); if ( !fn.isEmpty() ) { filename = fn; @@ -249,7 +249,7 @@ void %{APPNAME}::closeEvent( TQCloseEvent* ce ) return; } - switch( TQMessageBox::information( this, tr("Qt Application Example"), + switch( TQMessageBox::information( this, tr("TQt Application Example"), tr("Do you want to save the changes" " to the document?"), tr("Yes"), tr("No"), tr("Cancel"), @@ -271,13 +271,13 @@ void %{APPNAME}::closeEvent( TQCloseEvent* ce ) void %{APPNAME}::about() { - TQMessageBox::about( this, tr("Qt Application Example"), + TQMessageBox::about( this, tr("TQt Application Example"), tr("This example demonstrates simple use of " - "TQMainWindow,\nQMenuBar and TQToolBar.")); + "TQMainWindow,\nTQMenuBar and TQToolBar.")); } -void %{APPNAME}::aboutQt() +void %{APPNAME}::aboutTQt() { - TQMessageBox::aboutQt( this, tr("Qt Application Example") ); + TQMessageBox::aboutTQt( this, tr("TQt Application Example") ); } diff --git a/languages/cpp/app_templates/qmakeapp/qmakeapp.h b/languages/cpp/app_templates/qmakeapp/qmakeapp.h index af12e1eb..bc8a2b93 100644 --- a/languages/cpp/app_templates/qmakeapp/qmakeapp.h +++ b/languages/cpp/app_templates/qmakeapp/qmakeapp.h @@ -7,9 +7,10 @@ class TQTextEdit; -class %{APPNAME}: public QMainWindow +class %{APPNAME}: public TQMainWindow { Q_OBJECT + TQ_OBJECT public: %{APPNAME}(); @@ -27,7 +28,7 @@ private slots: void print(); void about(); - void aboutQt(); + void aboutTQt(); private: TQPrinter *printer; -- cgit v1.2.1