From 4ae0c208b66e0f7954e194384464fe2d0a2c56dd Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:51:49 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kapptemplate/kapp/app.cpp | 50 ++++++++++++++++++++-------------------- kapptemplate/kapp/app.h | 8 +++---- kapptemplate/kapp/app_client.cpp | 14 +++++------ kapptemplate/kapp/appiface.h | 2 +- kapptemplate/kapp/apppref.cpp | 22 +++++++++--------- kapptemplate/kapp/apppref.h | 6 ++--- kapptemplate/kapp/appview.cpp | 28 +++++++++++----------- kapptemplate/kapp/appview.h | 20 ++++++++-------- 8 files changed, 75 insertions(+), 75 deletions(-) (limited to 'kapptemplate/kapp') diff --git a/kapptemplate/kapp/app.cpp b/kapptemplate/kapp/app.cpp index 58ed3415..04f88108 100644 --- a/kapptemplate/kapp/app.cpp +++ b/kapptemplate/kapp/app.cpp @@ -10,8 +10,8 @@ cat << EOF > $LOCATION_ROOT/${APP_NAME_LC}/${APP_NAME_LC}.cpp #include "${APP_NAME_LC}pref.h" #include -#include -#include +#include +#include #include #include @@ -51,10 +51,10 @@ ${APP_NAME}::${APP_NAME}() setupGUI(); // allow the view to change the statusbar and caption - connect(m_view, SIGNAL(signalChangeStatusbar(const QString&)), - this, SLOT(changeStatusbar(const QString&))); - connect(m_view, SIGNAL(signalChangeCaption(const QString&)), - this, SLOT(changeCaption(const QString&))); + connect(m_view, TQT_SIGNAL(signalChangeStatusbar(const TQString&)), + this, TQT_SLOT(changeStatusbar(const TQString&))); + connect(m_view, TQT_SIGNAL(signalChangeCaption(const TQString&)), + this, TQT_SLOT(changeCaption(const TQString&))); } @@ -65,7 +65,7 @@ ${APP_NAME}::~${APP_NAME}() void ${APP_NAME}::load(const KURL& url) { - QString target; + TQString target; // the below code is what you should normally do. in this // example case, we want the url to our own. you probably // want to use this code instead for your app @@ -91,19 +91,19 @@ void ${APP_NAME}::load(const KURL& url) void ${APP_NAME}::setupActions() { - KStdAction::openNew(this, SLOT(fileNew()), actionCollection()); - KStdAction::open(this, SLOT(fileOpen()), actionCollection()); - KStdAction::save(this, SLOT(fileSave()), actionCollection()); - KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); - KStdAction::print(this, SLOT(filePrint()), actionCollection()); - KStdAction::quit(kapp, SLOT(quit()), actionCollection()); + KStdAction::openNew(this, TQT_SLOT(fileNew()), actionCollection()); + KStdAction::open(this, TQT_SLOT(fileOpen()), actionCollection()); + KStdAction::save(this, TQT_SLOT(fileSave()), actionCollection()); + KStdAction::saveAs(this, TQT_SLOT(fileSaveAs()), actionCollection()); + KStdAction::print(this, TQT_SLOT(filePrint()), actionCollection()); + KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection()); - KStdAction::preferences(this, SLOT(optionsPreferences()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(optionsPreferences()), actionCollection()); // this doesn't do anything useful. it's just here to illustrate // how to insert a custom menu and menu item KAction *custom = new KAction(i18n("Cus&tom Menuitem"), 0, - this, SLOT(optionsPreferences()), + this, TQT_SLOT(optionsPreferences()), actionCollection(), "custom_action"); } @@ -129,19 +129,19 @@ void ${APP_NAME}::readProperties(KConfig *config) // the app is being restored. read in here whatever you wrote // in 'saveProperties' - QString url = config->readPathEntry("lastURL"); + TQString url = config->readPathEntry("lastURL"); if (!url.isEmpty()) m_view->openURL(KURL::fromPathOrURL(url)); } -void ${APP_NAME}::dragEnterEvent(QDragEnterEvent *event) +void ${APP_NAME}::dragEnterEvent(TQDragEnterEvent *event) { // accept uri drops only event->accept(KURLDrag::canDecode(event)); } -void ${APP_NAME}::dropEvent(QDropEvent *event) +void ${APP_NAME}::dropEvent(TQDropEvent *event) { // this is a very simplistic implementation of a drop event. we // will only accept a dropped URL. the Qt dnd code can do *much* @@ -174,7 +174,7 @@ void ${APP_NAME}::fileOpen() // this slot is called whenever the File->Open menu is selected, // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar // button is clicked - KURL url = KURLRequesterDlg::getURL(QString::null, this, i18n("Open Location") ); + KURL url = KURLRequesterDlg::getURL(TQString::null, this, i18n("Open Location") ); if (!url.isEmpty()) m_view->openURL(url); } @@ -207,13 +207,13 @@ void ${APP_NAME}::filePrint() if (m_printer->setup(this)) { // setup the printer. with Qt, you always "print" to a - // QPainter.. whether the output medium is a pixmap, a screen, + // TQPainter.. whether the output medium is a pixmap, a screen, // or paper - QPainter p; + TQPainter p; p.begin(m_printer); // we let our view do the actual printing - QPaintDeviceMetrics metrics(m_printer); + TQPaintDeviceMetrics metrics(m_printer); m_view->print(&p, metrics.height(), metrics.width()); // and send the result to the printer @@ -226,7 +226,7 @@ void ${APP_NAME}::optionsConfigureToolbars() // use the standard toolbar editor saveMainWindowSettings( KGlobal::config(), autoSaveGroup() ); KEditToolbar dlg(actionCollection()); - connect(&dlg, SIGNAL(newToolbarConfig()), this, SLOT(newToolbarConfig())); + connect(&dlg, TQT_SIGNAL(newToolbarConfig()), this, TQT_SLOT(newToolbarConfig())); dlg.exec(); } @@ -248,13 +248,13 @@ void ${APP_NAME}::optionsPreferences() } } -void ${APP_NAME}::changeStatusbar(const QString& text) +void ${APP_NAME}::changeStatusbar(const TQString& text) { // display the text on the statusbar statusBar()->message(text); } -void ${APP_NAME}::changeCaption(const QString& text) +void ${APP_NAME}::changeCaption(const TQString& text) { // display the text on the caption setCaption(text); diff --git a/kapptemplate/kapp/app.h b/kapptemplate/kapp/app.h index 7f7b0d39..2b1d1d55 100644 --- a/kapptemplate/kapp/app.h +++ b/kapptemplate/kapp/app.h @@ -46,8 +46,8 @@ protected: /** * Overridden virtuals for Qt drag 'n drop (XDND) */ - virtual void dragEnterEvent(QDragEnterEvent *event); - virtual void dropEvent(QDropEvent *event); + virtual void dragEnterEvent(TQDragEnterEvent *event); + virtual void dropEvent(TQDropEvent *event); protected: /** @@ -74,8 +74,8 @@ private slots: void optionsPreferences(); void newToolbarConfig(); - void changeStatusbar(const QString& text); - void changeCaption(const QString& text); + void changeStatusbar(const TQString& text); + void changeCaption(const TQString& text); private: void setupAccel(); diff --git a/kapptemplate/kapp/app_client.cpp b/kapptemplate/kapp/app_client.cpp index cd5e065d..53de48f5 100644 --- a/kapptemplate/kapp/app_client.cpp +++ b/kapptemplate/kapp/app_client.cpp @@ -2,8 +2,8 @@ echo "Creating $LOCATION_ROOT/${APP_NAME_LC}/${APP_NAME_LC}_client.cpp..."; cat << EOF > $LOCATION_ROOT/${APP_NAME_LC}/${APP_NAME_LC}_client.cpp #include #include -#include -#include +#include +#include int main(int argc, char **argv) { @@ -14,13 +14,13 @@ int main(int argc, char **argv) client->attach(); // do a 'send' for now - QByteArray data; - QDataStream ds(data, IO_WriteOnly); + TQByteArray data; + TQDataStream ds(data, IO_WriteOnly); if (argc > 1) - ds << QString(argv[1]); + ds << TQString(argv[1]); else - ds << QString("http://www.kde.org"); - client->send("${APP_NAME_LC}", "${APP_NAME}Iface", "openURL(QString)", data); + ds << TQString("http://www.kde.org"); + client->send("${APP_NAME_LC}", "${APP_NAME}Iface", "openURL(TQString)", data); return app.exec(); } diff --git a/kapptemplate/kapp/appiface.h b/kapptemplate/kapp/appiface.h index 2601df94..9b1ab6ec 100644 --- a/kapptemplate/kapp/appiface.h +++ b/kapptemplate/kapp/appiface.h @@ -11,7 +11,7 @@ class ${APP_NAME}Iface : virtual public DCOPObject public: k_dcop: - virtual void openURL(QString url) = 0; + virtual void openURL(TQString url) = 0; }; #endif // ${APP_NAME_UC}IFACE_H diff --git a/kapptemplate/kapp/apppref.cpp b/kapptemplate/kapp/apppref.cpp index b025924a..6a479b83 100644 --- a/kapptemplate/kapp/apppref.cpp +++ b/kapptemplate/kapp/apppref.cpp @@ -4,8 +4,8 @@ cat << EOF > $LOCATION_ROOT/${APP_NAME_LC}/${APP_NAME_LC}pref.cpp #include -#include -#include +#include +#include ${APP_NAME}Preferences::${APP_NAME}Preferences() : KDialogBase(TreeList, "${APP_NAME} Preferences", @@ -14,7 +14,7 @@ ${APP_NAME}Preferences::${APP_NAME}Preferences() // this is the base class for your preferences dialog. it is now // a Treelist dialog.. but there are a number of other // possibilities (including Tab, Swallow, and just Plain) - QFrame *frame; + TQFrame *frame; frame = addPage(i18n("First Page"), i18n("Page One Options")); m_pageOne = new ${APP_NAME}PrefPageOne(frame); @@ -22,21 +22,21 @@ ${APP_NAME}Preferences::${APP_NAME}Preferences() m_pageTwo = new ${APP_NAME}PrefPageTwo(frame); } -${APP_NAME}PrefPageOne::${APP_NAME}PrefPageOne(QWidget *parent) - : QFrame(parent) +${APP_NAME}PrefPageOne::${APP_NAME}PrefPageOne(TQWidget *parent) + : TQFrame(parent) { - QHBoxLayout *layout = new QHBoxLayout(this); + TQHBoxLayout *layout = new TQHBoxLayout(this); layout->setAutoAdd(true); - new QLabel("Add something here", this); + new TQLabel("Add something here", this); } -${APP_NAME}PrefPageTwo::${APP_NAME}PrefPageTwo(QWidget *parent) - : QFrame(parent) +${APP_NAME}PrefPageTwo::${APP_NAME}PrefPageTwo(TQWidget *parent) + : TQFrame(parent) { - QHBoxLayout *layout = new QHBoxLayout(this); + TQHBoxLayout *layout = new TQHBoxLayout(this); layout->setAutoAdd(true); - new QLabel("Add something here", this); + new TQLabel("Add something here", this); } #include "${APP_NAME_LC}pref.moc" diff --git a/kapptemplate/kapp/apppref.h b/kapptemplate/kapp/apppref.h index 97371936..234223f6 100644 --- a/kapptemplate/kapp/apppref.h +++ b/kapptemplate/kapp/apppref.h @@ -4,7 +4,7 @@ cat << EOF > $LOCATION_ROOT/${APP_NAME_LC}/${APP_NAME_LC}pref.h #define ${APP_NAME_UC}PREF_H #include -#include +#include class ${APP_NAME}PrefPageOne; class ${APP_NAME}PrefPageTwo; @@ -24,14 +24,14 @@ class ${APP_NAME}PrefPageOne : public QFrame { Q_OBJECT public: - ${APP_NAME}PrefPageOne(QWidget *parent = 0); + ${APP_NAME}PrefPageOne(TQWidget *parent = 0); }; class ${APP_NAME}PrefPageTwo : public QFrame { Q_OBJECT public: - ${APP_NAME}PrefPageTwo(QWidget *parent = 0); + ${APP_NAME}PrefPageTwo(TQWidget *parent = 0); }; #endif // ${APP_NAME_UC}PREF_H diff --git a/kapptemplate/kapp/appview.cpp b/kapptemplate/kapp/appview.cpp index 575e8a5d..3527596b 100644 --- a/kapptemplate/kapp/appview.cpp +++ b/kapptemplate/kapp/appview.cpp @@ -2,8 +2,8 @@ echo "Creating $LOCATION_ROOT/${APP_NAME_LC}/${APP_NAME_LC}view.cpp..."; cat << EOF > $LOCATION_ROOT/${APP_NAME_LC}/${APP_NAME_LC}view.cpp #include "${APP_NAME_LC}view.h" -#include -#include +#include +#include #include @@ -12,12 +12,12 @@ cat << EOF > $LOCATION_ROOT/${APP_NAME_LC}/${APP_NAME_LC}view.cpp #include #include -${APP_NAME}View::${APP_NAME}View(QWidget *parent) - : QWidget(parent), +${APP_NAME}View::${APP_NAME}View(TQWidget *parent) + : TQWidget(parent), DCOPObject("${APP_NAME}Iface") { // setup our layout manager to automatically add our widgets - QHBoxLayout *top_layout = new QHBoxLayout(this); + TQHBoxLayout *top_layout = new TQHBoxLayout(this); top_layout->setAutoAdd(true); // we want to look for all components that satisfy our needs. the @@ -62,10 +62,10 @@ ${APP_NAME}View::${APP_NAME}View(QWidget *parent) return; } - connect(m_html, SIGNAL(setWindowCaption(const QString&)), - this, SLOT(slotSetTitle(const QString&))); - connect(m_html, SIGNAL(setStatusBarText(const QString&)), - this, SLOT(slotOnURL(const QString&))); + connect(m_html, TQT_SIGNAL(setWindowCaption(const TQString&)), + this, TQT_SLOT(slotSetTitle(const TQString&))); + connect(m_html, TQT_SIGNAL(setStatusBarText(const TQString&)), + this, TQT_SLOT(slotOnURL(const TQString&))); } @@ -73,18 +73,18 @@ ${APP_NAME}View::~${APP_NAME}View() { } -void ${APP_NAME}View::print(QPainter *p, int height, int width) +void ${APP_NAME}View::print(TQPainter *p, int height, int width) { // do the actual printing, here // p->drawText(etc..) } -QString ${APP_NAME}View::currentURL() +TQString ${APP_NAME}View::currentURL() { return m_html->url().url(); } -void ${APP_NAME}View::openURL(QString url) +void ${APP_NAME}View::openURL(TQString url) { openURL(KURL(url)); } @@ -94,12 +94,12 @@ void ${APP_NAME}View::openURL(const KURL& url) m_html->openURL(url); } -void ${APP_NAME}View::slotOnURL(const QString& url) +void ${APP_NAME}View::slotOnURL(const TQString& url) { emit signalChangeStatusbar(url); } -void ${APP_NAME}View::slotSetTitle(const QString& title) +void ${APP_NAME}View::slotSetTitle(const TQString& title) { emit signalChangeCaption(title); } diff --git a/kapptemplate/kapp/appview.h b/kapptemplate/kapp/appview.h index 881b979c..76e61701 100644 --- a/kapptemplate/kapp/appview.h +++ b/kapptemplate/kapp/appview.h @@ -3,7 +3,7 @@ cat << EOF > $LOCATION_ROOT/$APP_NAME_LC/${APP_NAME_LC}view.h #ifndef ${APP_NAME_UC}VIEW_H #define ${APP_NAME_UC}VIEW_H -#include +#include #include #include <${APP_NAME_LC}iface.h> @@ -21,14 +21,14 @@ class KURL; * @author $AUTHOR <$EMAIL> * @version $APP_VERSION */ -class ${APP_NAME}View : public QWidget, public ${APP_NAME}Iface +class ${APP_NAME}View : public TQWidget, public ${APP_NAME}Iface { Q_OBJECT public: /** * Default constructor */ - ${APP_NAME}View(QWidget *parent); + ${APP_NAME}View(TQWidget *parent); /** * Destructor @@ -38,12 +38,12 @@ public: /** * Random 'get' function */ - QString currentURL(); + TQString currentURL(); /** * Random 'set' function accessed by DCOP */ - virtual void openURL(QString url); + virtual void openURL(TQString url); /** * Random 'set' function @@ -53,22 +53,22 @@ public: /** * Print this view to any medium -- paper or not */ - void print(QPainter *, int height, int width); + void print(TQPainter *, int height, int width); signals: /** * Use this signal to change the content of the statusbar */ - void signalChangeStatusbar(const QString& text); + void signalChangeStatusbar(const TQString& text); /** * Use this signal to change the content of the caption */ - void signalChangeCaption(const QString& text); + void signalChangeCaption(const TQString& text); private slots: - void slotOnURL(const QString& url); - void slotSetTitle(const QString& title); + void slotOnURL(const TQString& url); + void slotSetTitle(const TQString& title); private: KParts::ReadOnlyPart *m_html; -- cgit v1.2.1