summaryrefslogtreecommitdiffstats
path: root/languages/cpp/app_templates/qt4makeapp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
commit48d4a26399959121f33d2bc3bfe51c7827b654fc (patch)
tree5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /languages/cpp/app_templates/qt4makeapp
parent7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff)
downloadtdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz
tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip
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
Diffstat (limited to 'languages/cpp/app_templates/qt4makeapp')
-rw-r--r--languages/cpp/app_templates/qt4makeapp/main.cpp2
-rw-r--r--languages/cpp/app_templates/qt4makeapp/qt4makeapp.cpp38
-rw-r--r--languages/cpp/app_templates/qt4makeapp/qt4makeapp.h13
3 files changed, 27 insertions, 26 deletions
diff --git a/languages/cpp/app_templates/qt4makeapp/main.cpp b/languages/cpp/app_templates/qt4makeapp/main.cpp
index 4f6295a2..55f24795 100644
--- a/languages/cpp/app_templates/qt4makeapp/main.cpp
+++ b/languages/cpp/app_templates/qt4makeapp/main.cpp
@@ -5,7 +5,7 @@
int main(int argc, char *argv[])
{
- Q_INIT_RESOURCE(application);
+ TQ_INIT_RESOURCE(application);
TQApplication app(argc, argv);
%{APPNAME} * mw = new %{APPNAME}();
mw->show();
diff --git a/languages/cpp/app_templates/qt4makeapp/qt4makeapp.cpp b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.cpp
index cdf18174..f2178d9d 100644
--- a/languages/cpp/app_templates/qt4makeapp/qt4makeapp.cpp
+++ b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.cpp
@@ -1,6 +1,6 @@
%{CPP_TEMPLATE}
-#include <QtGui>
+#include <TQtGui>
#include "%{APPNAMELC}.h"
#include <TQTextEdit>
@@ -75,7 +75,7 @@ void %{APPNAME}::about()
{
TQMessageBox::about(this, tr("About Application"),
tr("The <b>Application</b> example demonstrates how to "
- "write modern GUI applications using Qt, with a menu bar, "
+ "write modern GUI applications using TQt, with a menu bar, "
"toolbars, and a status bar."));
}
@@ -86,17 +86,17 @@ void %{APPNAME}::documentWasModified()
void %{APPNAME}::createActions()
{
- newAct = new TQAction(QIcon(":/filenew.xpm"), tr("&New"), this);
+ newAct = new TQAction(TQIcon(":/filenew.xpm"), tr("&New"), this);
newAct->setShortcut(tr("Ctrl+N"));
newAct->setStatusTip(tr("Create a new file"));
connect(newAct, TQT_SIGNAL(triggered()), this, TQT_SLOT(newFile()));
- openAct = new TQAction(QIcon(":/fileopen.xpm"), tr("&Open..."), this);
+ openAct = new TQAction(TQIcon(":/fileopen.xpm"), tr("&Open..."), this);
openAct->setShortcut(tr("Ctrl+O"));
openAct->setStatusTip(tr("Open an existing file"));
connect(openAct, TQT_SIGNAL(triggered()), this, TQT_SLOT(open()));
- saveAct = new TQAction(QIcon(":/filesave.xpm"), tr("&Save"), this);
+ saveAct = new TQAction(TQIcon(":/filesave.xpm"), tr("&Save"), this);
saveAct->setShortcut(tr("Ctrl+S"));
saveAct->setStatusTip(tr("Save the document to disk"));
connect(saveAct, TQT_SIGNAL(triggered()), this, TQT_SLOT(save()));
@@ -110,19 +110,19 @@ void %{APPNAME}::createActions()
exitAct->setStatusTip(tr("Exit the application"));
connect(exitAct, TQT_SIGNAL(triggered()), this, TQT_SLOT(close()));
- cutAct = new TQAction(QIcon(":/editcut.xpm"), tr("Cu&t"), this);
+ cutAct = new TQAction(TQIcon(":/editcut.xpm"), tr("Cu&t"), this);
cutAct->setShortcut(tr("Ctrl+X"));
cutAct->setStatusTip(tr("Cut the current selection's contents to the "
"clipboard"));
connect(cutAct, TQT_SIGNAL(triggered()), textEdit, TQT_SLOT(cut()));
- copyAct = new TQAction(QIcon(":/editcopy.xpm"), tr("&Copy"), this);
+ copyAct = new TQAction(TQIcon(":/editcopy.xpm"), tr("&Copy"), this);
copyAct->setShortcut(tr("Ctrl+C"));
copyAct->setStatusTip(tr("Copy the current selection's contents to the "
"clipboard"));
connect(copyAct, TQT_SIGNAL(triggered()), textEdit, TQT_SLOT(copy()));
- pasteAct = new TQAction(QIcon(":/editpaste.xpm"), tr("&Paste"), this);
+ pasteAct = new TQAction(TQIcon(":/editpaste.xpm"), tr("&Paste"), this);
pasteAct->setShortcut(tr("Ctrl+V"));
pasteAct->setStatusTip(tr("Paste the clipboard's contents into the current "
"selection"));
@@ -132,9 +132,9 @@ void %{APPNAME}::createActions()
aboutAct->setStatusTip(tr("Show the application's About box"));
connect(aboutAct, TQT_SIGNAL(triggered()), this, TQT_SLOT(about()));
- aboutQtAct = new TQAction(tr("About &Qt"), this);
- aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
- connect(aboutQtAct, TQT_SIGNAL(triggered()), qApp, TQT_SLOT(aboutQt()));
+ aboutTQtAct = new TQAction(tr("About &TQt"), this);
+ aboutTQtAct->setStatusTip(tr("Show the TQt library's About box"));
+ connect(aboutTQtAct, TQT_SIGNAL(triggered()), tqApp, TQT_SLOT(aboutTQt()));
cutAct->setEnabled(false);
copyAct->setEnabled(false);
@@ -163,7 +163,7 @@ void %{APPNAME}::createMenus()
helpMenu = menuBar()->addMenu(tr("&Help"));
helpMenu->addAction(aboutAct);
- helpMenu->addAction(aboutQtAct);
+ helpMenu->addAction(aboutTQtAct);
}
void %{APPNAME}::createToolBars()
@@ -223,13 +223,13 @@ void %{APPNAME}::loadFile(const TQString &fileName)
if (!file.open(TQFile::ReadOnly | TQFile::Text)) {
TQMessageBox::warning(this, tr("Application"),
tr("Cannot read file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
+ .tqarg(fileName)
+ .tqarg(file.errorString()));
return;
}
TQTextStream in(&file);
- TQApplication::setOverrideCursor(Qt::WaitCursor);
+ TQApplication::setOverrideCursor(TQt::WaitCursor);
textEdit->setPlainText(in.readAll());
TQApplication::restoreOverrideCursor();
@@ -243,13 +243,13 @@ bool %{APPNAME}::saveFile(const TQString &fileName)
if (!file.open(TQFile::WriteOnly | TQFile::Text)) {
TQMessageBox::warning(this, tr("Application"),
tr("Cannot write file %1:\n%2.")
- .arg(fileName)
- .arg(file.errorString()));
+ .tqarg(fileName)
+ .tqarg(file.errorString()));
return false;
}
TQTextStream out(&file);
- TQApplication::setOverrideCursor(Qt::WaitCursor);
+ TQApplication::setOverrideCursor(TQt::WaitCursor);
out << textEdit->toPlainText();
TQApplication::restoreOverrideCursor();
@@ -270,7 +270,7 @@ void %{APPNAME}::setCurrentFile(const TQString &fileName)
else
shownName = strippedName(curFile);
- setWindowTitle(tr("%1[*] - %2").arg(shownName).arg(tr("Application")));
+ setWindowTitle(tr("%1[*] - %2").tqarg(shownName).tqarg(tr("Application")));
}
TQString %{APPNAME}::strippedName(const TQString &fullFileName)
diff --git a/languages/cpp/app_templates/qt4makeapp/qt4makeapp.h b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.h
index 14a40d99..65402c85 100644
--- a/languages/cpp/app_templates/qt4makeapp/qt4makeapp.h
+++ b/languages/cpp/app_templates/qt4makeapp/qt4makeapp.h
@@ -7,12 +7,13 @@
#include <TQCloseEvent>
class TQAction;
-class QMenu;
+class TQMenu;
class TQTextEdit;
-class %{APPNAME}:public QMainWindow
+class %{APPNAME}:public TQMainWindow
{
Q_OBJECT
+ TQ_OBJECT
public:
%{APPNAME}();
@@ -45,9 +46,9 @@ private:
TQTextEdit *textEdit;
TQString curFile;
- QMenu *fileMenu;
- QMenu *editMenu;
- QMenu *helpMenu;
+ TQMenu *fileMenu;
+ TQMenu *editMenu;
+ TQMenu *helpMenu;
TQToolBar *fileToolBar;
TQToolBar *editToolBar;
TQAction *newAct;
@@ -59,7 +60,7 @@ private:
TQAction *copyAct;
TQAction *pasteAct;
TQAction *aboutAct;
- TQAction *aboutQtAct;
+ TQAction *aboutTQtAct;
};
#endif