diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /languages/cpp/app_templates/kpartapp/app_part.cpp | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'languages/cpp/app_templates/kpartapp/app_part.cpp')
-rw-r--r-- | languages/cpp/app_templates/kpartapp/app_part.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/languages/cpp/app_templates/kpartapp/app_part.cpp b/languages/cpp/app_templates/kpartapp/app_part.cpp index bf63557f..809d642a 100644 --- a/languages/cpp/app_templates/kpartapp/app_part.cpp +++ b/languages/cpp/app_templates/kpartapp/app_part.cpp @@ -8,27 +8,27 @@ #include <kglobal.h> #include <klocale.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qmultilineedit.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqmultilineedit.h> -%{APPNAME}Part::%{APPNAME}Part( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name ) +%{APPNAME}Part::%{APPNAME}Part( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name ) : KParts::ReadWritePart(parent, name) { // we need an instance setInstance( %{APPNAME}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::open(this, SLOT(fileOpen()), actionCollection()); - KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection()); - KStdAction::save(this, SLOT(save()), actionCollection()); + KStdAction::open(this, TQT_SLOT(fileOpen()), actionCollection()); + KStdAction::saveAs(this, TQT_SLOT(fileSaveAs()), actionCollection()); + KStdAction::save(this, TQT_SLOT(save()), actionCollection()); // set our XML-UI resource file setXMLFile("%{APPNAMELC}_part.rc"); @@ -49,12 +49,12 @@ void %{APPNAME}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); @@ -80,15 +80,15 @@ void %{APPNAME}Part::setModified(bool modified) bool %{APPNAME}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"; @@ -110,12 +110,12 @@ bool %{APPNAME}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(); @@ -128,7 +128,7 @@ void %{APPNAME}Part::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 - QString file_name = KFileDialog::getOpenFileName(); + TQString file_name = KFileDialog::getOpenFileName(); if (file_name.isEmpty() == false) openURL(file_name); @@ -137,7 +137,7 @@ void %{APPNAME}Part::fileOpen() void %{APPNAME}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); } @@ -164,15 +164,15 @@ KAboutData* %{APPNAME}PartFactory::s_about = 0L; s_instance = 0L; } -KParts::Part* %{APPNAME}PartFactory::createPartObject( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, - const char *classname, const QStringList &args ) +KParts::Part* %{APPNAME}PartFactory::createPartObject( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, + const char *classname, const TQStringList &args ) { // Create an instance of our Part %{APPNAME}Part* obj = new %{APPNAME}Part( parentWidget, widgetName, parent, name ); // See if we are to be read-write or not - if (QCString(classname) == "KParts::ReadOnlyPart") + if (TQCString(classname) == "KParts::ReadOnlyPart") obj->setReadWrite(false); return obj; |