diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
commit | 4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch) | |
tree | b0a7cd1c184f0003c0292eb416ed27f674f9cc43 /kapptemplate/kpartapp | |
parent | 1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff) | |
download | tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.tar.gz tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kapptemplate/kpartapp')
-rw-r--r-- | kapptemplate/kpartapp/app.cpp | 16 | ||||
-rw-r--r-- | kapptemplate/kpartapp/app_part.cpp | 44 | ||||
-rw-r--r-- | kapptemplate/kpartapp/app_part.h | 6 |
3 files changed, 33 insertions, 33 deletions
diff --git a/kapptemplate/kpartapp/app.cpp b/kapptemplate/kpartapp/app.cpp index 8b04053e..626aa8bd 100644 --- a/kapptemplate/kpartapp/app.cpp +++ b/kapptemplate/kpartapp/app.cpp @@ -79,16 +79,16 @@ void ${APP_NAME}::load(const KURL& url) void ${APP_NAME}::setupActions() { - KStdAction::openNew(this, SLOT(fileNew()), actionCollection()); - KStdAction::open(this, SLOT(fileOpen()), actionCollection()); + KStdAction::openNew(this, TQT_SLOT(fileNew()), actionCollection()); + KStdAction::open(this, TQT_SLOT(fileOpen()), actionCollection()); - KStdAction::quit(kapp, SLOT(quit()), actionCollection()); + KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection()); createStandardStatusBarAction(); setStandardToolBarMenuEnabled(true); - KStdAction::keyBindings(this, SLOT(optionsConfigureKeys()), actionCollection()); - KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection()); + KStdAction::keyBindings(this, TQT_SLOT(optionsConfigureKeys()), actionCollection()); + KStdAction::configureToolbars(this, TQT_SLOT(optionsConfigureToolbars()), actionCollection()); } void ${APP_NAME}::saveProperties(KConfig* /*config*/) @@ -136,8 +136,8 @@ void ${APP_NAME}::optionsConfigureToolbars() // use the standard toolbar editor KEditToolbar dlg(factory()); - connect(&dlg, SIGNAL(newToolbarConfig()), - this, SLOT(applyNewToolbarConfig())); + connect(&dlg, TQT_SIGNAL(newToolbarConfig()), + this, TQT_SLOT(applyNewToolbarConfig())); dlg.exec(); } @@ -152,7 +152,7 @@ void ${APP_NAME}::fileOpen() // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar // button is clicked KURL url = - KFileDialog::getOpenURL( QString::null, QString::null, this ); + KFileDialog::getOpenURL( TQString::null, TQString::null, this ); if (url.isEmpty() == false) { diff --git a/kapptemplate/kpartapp/app_part.cpp b/kapptemplate/kpartapp/app_part.cpp index c2821950..d8880577 100644 --- a/kapptemplate/kpartapp/app_part.cpp +++ b/kapptemplate/kpartapp/app_part.cpp @@ -10,30 +10,30 @@ cat << EOF > $LOCATION_ROOT/${APP_NAME_LC}/${APP_NAME_LC}_part.cpp #include <kfiledialog.h> #include <kparts/genericfactory.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qmultilineedit.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqmultilineedit.h> typedef KParts::GenericFactory<${APP_NAME}Part> ${APP_NAME}PartFactory; K_EXPORT_COMPONENT_FACTORY( lib${APP_NAME_LC}part, ${APP_NAME}PartFactory ) -${APP_NAME}Part::${APP_NAME}Part( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const QStringList & /*args*/ ) +${APP_NAME}Part::${APP_NAME}Part( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, + const TQStringList & /*args*/ ) : KParts::ReadWritePart(parent, name) { // we need an instance setInstance( ${APP_NAME}PartFactory::instance() ); // this should be your custom internal widget - m_widget = new QMultiLineEdit( parentWidget, widgetName ); + m_widget = new TQMultiLineEdit( parentWidget, widgetName ); // notify the part that this is our internal widget setWidget(m_widget); // create our actions - KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); - KStdAction::save(this, SLOT(save()), actionCollection()); + KStdAction::saveAs(this, TQT_SLOT(fileSaveAs()), actionCollection()); + KStdAction::save(this, TQT_SLOT(save()), actionCollection()); // set our XML-UI resource file setXMLFile("${APP_NAME_LC}_part.rc"); @@ -54,12 +54,12 @@ void ${APP_NAME}Part::setReadWrite(bool rw) // notify your internal widget of the read-write state m_widget->setReadOnly(!rw); if (rw) - connect(m_widget, SIGNAL(textChanged()), - this, SLOT(setModified())); + connect(m_widget, TQT_SIGNAL(textChanged()), + this, TQT_SLOT(setModified())); else { - disconnect(m_widget, SIGNAL(textChanged()), - this, SLOT(setModified())); + disconnect(m_widget, TQT_SIGNAL(textChanged()), + this, TQT_SLOT(setModified())); } ReadWritePart::setReadWrite(rw); @@ -95,15 +95,15 @@ KAboutData *${APP_NAME}Part::createAboutData() bool ${APP_NAME}Part::openFile() { - // m_file is always local so we can use QFile on it - QFile file(m_file); + // m_file is always local so we can use TQFile on it + TQFile file(m_file); if (file.open(IO_ReadOnly) == false) return false; - // our example widget is text-based, so we use QTextStream instead + // our example widget is text-based, so we use TQTextStream instead // of a raw QDataStream - QTextStream stream(&file); - QString str; + TQTextStream stream(&file); + TQString str; while (!stream.eof()) str += stream.readLine() + "\n"; @@ -125,12 +125,12 @@ bool ${APP_NAME}Part::saveFile() return false; // m_file is always local, so we use QFile - QFile file(m_file); + TQFile file(m_file); if (file.open(IO_WriteOnly) == false) return false; - // use QTextStream to dump the text to the file - QTextStream stream(&file); + // use TQTextStream to dump the text to the file + TQTextStream stream(&file); stream << m_widget->text(); file.close(); @@ -141,7 +141,7 @@ bool ${APP_NAME}Part::saveFile() void ${APP_NAME}Part::fileSaveAs() { // this slot is called whenever the File->Save As menu is selected, - QString file_name = KFileDialog::getSaveFileName(); + TQString file_name = KFileDialog::getSaveFileName(); if (file_name.isEmpty() == false) saveAs(file_name); } diff --git a/kapptemplate/kpartapp/app_part.h b/kapptemplate/kpartapp/app_part.h index 18841510..e60b147b 100644 --- a/kapptemplate/kpartapp/app_part.h +++ b/kapptemplate/kpartapp/app_part.h @@ -26,8 +26,8 @@ public: /** * Default constructor */ - ${APP_NAME}Part(QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, const QStringList &args); + ${APP_NAME}Part(TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, const TQStringList &args); /** * Destructor @@ -63,7 +63,7 @@ protected slots: void fileSaveAs(); private: - QMultiLineEdit *m_widget; + TQMultiLineEdit *m_widget; }; #endif // ${APP_NAME_UC}PART_H |