From d6f8bbb45b267065a6907e71ff9c98bb6d161241 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:56:07 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- .../cpp/app_templates/kscons_kmdi/app_part.cpp | 46 +++++++++++----------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'languages/cpp/app_templates/kscons_kmdi/app_part.cpp') diff --git a/languages/cpp/app_templates/kscons_kmdi/app_part.cpp b/languages/cpp/app_templates/kscons_kmdi/app_part.cpp index 71155138..a851f02a 100644 --- a/languages/cpp/app_templates/kscons_kmdi/app_part.cpp +++ b/languages/cpp/app_templates/kscons_kmdi/app_part.cpp @@ -10,30 +10,30 @@ #include #include -#include -#include -#include +#include +#include +#include typedef KParts::GenericFactory<%{APPNAMELC}Part> %{APPNAMELC}PartFactory; K_EXPORT_COMPONENT_FACTORY( lib%{APPNAMELC}part, %{APPNAMELC}PartFactory ); -%{APPNAMELC}Part::%{APPNAMELC}Part( QWidget *parentWidget, const char *widgetName, - QObject *parent, const char *name, const QStringList & /*args*/) +%{APPNAMELC}Part::%{APPNAMELC}Part( TQWidget *parentWidget, const char *widgetName, + TQObject *parent, const char *name, const TQStringList & /*args*/) : KParts::ReadWritePart(parent) { // we need an instance setInstance( %{APPNAMELC}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"); @@ -63,12 +63,12 @@ void %{APPNAMELC}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); @@ -94,15 +94,15 @@ void %{APPNAMELC}Part::setModified(bool modified) bool %{APPNAMELC}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"; @@ -124,12 +124,12 @@ bool %{APPNAMELC}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(); @@ -142,7 +142,7 @@ void %{APPNAMELC}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); @@ -151,7 +151,7 @@ void %{APPNAMELC}Part::fileOpen() void %{APPNAMELC}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); } -- cgit v1.2.1