summaryrefslogtreecommitdiffstats
path: root/lib/kross/test
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kross/test
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kross/test')
-rw-r--r--lib/kross/test/main.cpp36
-rw-r--r--lib/kross/test/testaction.cpp6
-rw-r--r--lib/kross/test/testaction.h9
-rw-r--r--lib/kross/test/testcase.py8
-rw-r--r--lib/kross/test/testgui.py28
-rw-r--r--lib/kross/test/testobject.cpp46
-rw-r--r--lib/kross/test/testobject.h35
-rw-r--r--lib/kross/test/testplugin.cpp28
-rw-r--r--lib/kross/test/testplugin.h30
-rw-r--r--lib/kross/test/testwindow.cpp48
-rw-r--r--lib/kross/test/testwindow.h15
11 files changed, 146 insertions, 143 deletions
diff --git a/lib/kross/test/main.cpp b/lib/kross/test/main.cpp
index 31b4f579..42198201 100644
--- a/lib/kross/test/main.cpp
+++ b/lib/kross/test/main.cpp
@@ -34,9 +34,9 @@
#include "testwindow.h"
#include "testplugin.h"
-// Qt
-#include <qstring.h>
-#include <qfile.h>
+// TQt
+#include <tqstring.h>
+#include <tqfile.h>
// KDE
#include <kinstance.h>
@@ -64,7 +64,7 @@ static KCmdLineOptions options[] =
{ 0, 0, 0 }
};
-void runInterpreter(const QString& interpretername, const QString& scriptcode)
+void runInterpreter(const TQString& interpretername, const TQString& scriptcode)
{
try {
@@ -91,10 +91,10 @@ void runInterpreter(const QString& interpretername, const QString& scriptcode)
//TESTCASE
TestObject* testobject = new TestObject(app, scriptcontainer);
- manager->addQObject( testobject );
+ manager->addTQObject( testobject );
/*TestAction* testaction =*/ new TestAction(scriptcontainer);
- //manager->addQObject( testaction );
+ //manager->addTQObject( testaction );
/*Kross::Api::Object* o =*/ scriptcontainer->execute();
@@ -105,23 +105,23 @@ void runInterpreter(const QString& interpretername, const QString& scriptcode)
/*
Kross::Api::Object* testclassinstance = scriptcontainer->classInstance("testClass");
if(testclassinstance) {
- QValueList<Kross::Api::Object*> ll;
+ TQValueList<Kross::Api::Object*> ll;
Kross::Api::Object* instancecallresult = testclassinstance->call("testClassFunction1", Kross::Api::List::create(ll));
- //krossdebug( QString("testClass.testClassFunction1 returnvalue => '%1'").arg( instancecallresult.toString() ) );
+ //krossdebug( TQString("testClass.testClassFunction1 returnvalue => '%1'").tqarg( instancecallresult.toString() ) );
}
*/
/*
- // Connect QObject signal with scriptfunction.
- scriptcontainer->connect(testobject, SIGNAL(testSignal()), "testobjectCallback");
- scriptcontainer->connect(testobject, SIGNAL(testSignalString(const QString&)), "testobjectCallbackWithParams");
+ // Connect TQObject signal with scriptfunction.
+ scriptcontainer->connect(testobject, TQT_SIGNAL(testSignal()), "testobjectCallback");
+ scriptcontainer->connect(testobject, TQT_SIGNAL(testSignalString(const TQString&)), "testobjectCallbackWithParams");
// Call the testSlot to emit the testSignal.
testobject->testSlot();
*/
}
catch(Kross::Api::Exception::Ptr e) {
- std::cout << QString("EXCEPTION %1").arg(e->toString()).latin1() << std::endl;
+ std::cout << TQString("EXCEPTION %1").tqarg(e->toString()).latin1() << std::endl;
}
/*TESTCASE
@@ -132,7 +132,7 @@ void runInterpreter(const QString& interpretername, const QString& scriptcode)
sc2->execute();
}
catch(Kross::Api::Exception& e) {
- krossdebug( QString("EXCEPTION type='%1' description='%2'").arg(e.type()).arg(e.description()) );
+ krossdebug( TQString("EXCEPTION type='%1' description='%2'").tqarg(e.type()).tqarg(e.description()) );
}
//delete sc2;
*/
@@ -159,12 +159,12 @@ int main(int argc, char **argv)
KCmdLineArgs::addCmdLineOptions(options);
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
- QString interpretername = args->getOption("interpreter");
- QString scriptfilename = args->getOption("scriptfile");
+ TQString interpretername = args->getOption("interpreter");
+ TQString scriptfilename = args->getOption("scriptfile");
- QFile f(QFile::encodeName(scriptfilename));
+ TQFile f(TQFile::encodeName(scriptfilename));
if(f.exists() && f.open(IO_ReadOnly)) {
- QString scriptcode = f.readAll();
+ TQString scriptcode = f.readAll();
f.close();
if( args->isSet("gui") ) {
@@ -181,7 +181,7 @@ int main(int argc, char **argv)
}
}
else {
- Kross::krosswarning( QString("Failed to load scriptfile: %1").arg(scriptfilename) );
+ Kross::krosswarning( TQString("Failed to load scriptfile: %1").tqarg(scriptfilename) );
result = -1;
}
diff --git a/lib/kross/test/testaction.cpp b/lib/kross/test/testaction.cpp
index 93c32090..481de0cf 100644
--- a/lib/kross/test/testaction.cpp
+++ b/lib/kross/test/testaction.cpp
@@ -20,15 +20,15 @@
#include "testaction.h"
TestAction::TestAction(Kross::Api::ScriptContainer::Ptr scriptcontainer)
- : QWidget()
+ : TQWidget()
{
m_actioncollection = new KActionCollection(this, this);
- m_action1 = new KAction("Action1_Text", 0, this, SLOT(activatedAction1()), m_actioncollection, "Action1");
+ m_action1 = new KAction("Action1_Text", 0, this, TQT_SLOT(activatedAction1()), m_actioncollection, "Action1");
m_actionlist.append(m_action1);
scriptcontainer->addKAction(m_action1);
- m_action2 = new KAction("Action2_Text", 0, this, SLOT(activatedAction2()), m_actioncollection, "Action2");
+ m_action2 = new KAction("Action2_Text", 0, this, TQT_SLOT(activatedAction2()), m_actioncollection, "Action2");
m_actionlist.append(m_action2);
scriptcontainer->addKAction(m_action2);
}
diff --git a/lib/kross/test/testaction.h b/lib/kross/test/testaction.h
index 03ea95fe..748cd6db 100644
--- a/lib/kross/test/testaction.h
+++ b/lib/kross/test/testaction.h
@@ -22,16 +22,17 @@
#include "../main/scriptcontainer.h"
-#include <qobject.h>
-#include <qwidget.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqwidget.h>
+#include <tqstring.h>
#include <kaction.h>
#include <kactioncollection.h>
-class TestAction : public QWidget
+class TestAction : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
TestAction(Kross::Api::ScriptContainer::Ptr scriptcontainer);
~TestAction();
diff --git a/lib/kross/test/testcase.py b/lib/kross/test/testcase.py
index d3f2ea7b..9fa58bc2 100644
--- a/lib/kross/test/testcase.py
+++ b/lib/kross/test/testcase.py
@@ -79,8 +79,8 @@ class TestPlugin(unittest.TestCase):
self.assert_( self.pluginobject1.stringfunc(" Another \n\r Test! $%&\"") == " Another \n\r Test! $%&\"" )
#TODO
- #self.assert_( self.pluginobject1.stringfunc( unicode(" Unicode test ") ) == " Unicode test " )
- #self.assert_( self.pluginobject1.stringfunc(unicode(" Another Test! ")) == unicode(" Another Test! ") )
+ #self.assert_( self.pluginobject1.stringfunc( tqunicode(" Unicode test ") ) == " Unicode test " )
+ #self.assert_( self.pluginobject1.stringfunc(tqunicode(" Another Test! ")) == tqunicode(" Another Test! ") )
self.assert_( self.pluginobject1.stringstringfunc("MyString1", "MyString2") == "MyString1" )
self.assert_( self.pluginobject1.uintdoublestringfunc(8529,285.246,"String") == 8529 )
@@ -110,8 +110,8 @@ class TestPlugin(unittest.TestCase):
#print "===========> %s" % self.pluginobject2.myName()
print "testqobject1 properties=%s" % self.testqobject1.propertyNames()
- print "testqobject1 slots=%s" % self.testqobject1.slotNames()
- print "testqobject1 signals=%s" % self.testqobject1.signalNames()
+ print "testqobject1 Q_SLOTS=%s" % self.testqobject1.slotNames()
+ print "testqobject1 Q_SIGNALS=%s" % self.testqobject1.signalNames()
print "-----------------3"
print "DIR=>%s" % dir(self.testqobject1)
diff --git a/lib/kross/test/testgui.py b/lib/kross/test/testgui.py
index f252184d..a7353873 100644
--- a/lib/kross/test/testgui.py
+++ b/lib/kross/test/testgui.py
@@ -44,8 +44,8 @@ class QtTest:
apply(qt.QPushButton.__init__, (self,) + args)
class ComboBox(qt.QHBox):
- def __init__(self, parent, caption, items = []):
- qt.QHBox.__init__(self, parent)
+ def __init__(self, tqparent, caption, items = []):
+ qt.QHBox.__init__(self, tqparent)
self.setSpacing(6)
label = qt.QLabel(str(caption), self)
self.combobox = qt.QComboBox(self)
@@ -85,31 +85,31 @@ class QtTest:
self.edit.setText(filename)
class Dialog(qt.QDialog):
- def __init__(self, parent = None, name = None, modal = 0, fl = 0):
- qt.QDialog.__init__(self, parent, name, modal, fl)
+ def __init__(self, tqparent = None, name = None, modal = 0, fl = 0):
+ qt.QDialog.__init__(self, tqparent, name, modal, fl)
qt.QDialog.accept = self.accept
self.setCaption("Export to HTML")
- #self.layout()
+ #self.tqlayout()
- self.layout = qt.QVBoxLayout(self)
- self.layout.setSpacing(6)
- self.layout.setMargin(11)
+ self.tqlayout = qt.QVBoxLayout(self)
+ self.tqlayout.setSpacing(6)
+ self.tqlayout.setMargin(11)
infolabel = qt.QLabel("Export the data of a table or a query to a HTML-file.", self)
- self.layout.addWidget(infolabel)
+ self.tqlayout.addWidget(infolabel)
source = ComboBox(self, "Datasource:")
- self.layout.addWidget(source)
+ self.tqlayout.addWidget(source)
self.exporttype = ComboBox(self, "Style:", ["Plain","Paper","Desert","Blues"])
- self.layout.addWidget(self.exporttype)
+ self.tqlayout.addWidget(self.exporttype)
self.filechooser = FileChooser(self)
- self.layout.addWidget(self.filechooser)
+ self.tqlayout.addWidget(self.filechooser)
buttonbox = qt.QHBox(self)
buttonbox.setSpacing(6)
- self.layout.addWidget(buttonbox)
+ self.tqlayout.addWidget(buttonbox)
savebutton = Button("Save", buttonbox)
qt.QObject.connect(savebutton, qt.SIGNAL("clicked()"), self, qt.SLOT("accept()"))
@@ -139,7 +139,7 @@ class QtTest:
#support.swapThreadState() # calls appropriate c-function
return qt.QDialog.event(self, e)
- app = qt.qApp
+ app = qt.tqApp
dialog = Dialog(app.mainWidget(), "Dialog", 1)
dialog.show()
diff --git a/lib/kross/test/testobject.cpp b/lib/kross/test/testobject.cpp
index 893cccca..1c7e8e39 100644
--- a/lib/kross/test/testobject.cpp
+++ b/lib/kross/test/testobject.cpp
@@ -22,24 +22,24 @@
#include <iostream> // for std::out
TestObject::TestObject()
- : QObject(0, "TestObject")
+ : TQObject(0, "TestObject")
{
}
-TestObject::TestObject(QObject* parent, Kross::Api::ScriptContainer::Ptr scriptcontainer)
- : QObject(parent, "TestObject")
+TestObject::TestObject(TQObject* tqparent, Kross::Api::ScriptContainer::Ptr scriptcontainer)
+ : TQObject(tqparent, "TestObject")
{
- connect(this, SIGNAL(testSignal()), this, SLOT(testSignalSlot()));
- connect(this, SIGNAL(stdoutSignal(const QString&)), this, SLOT(stdoutSlot(const QString&)));
- connect(this, SIGNAL(stderrSignal(const QString&)), this, SLOT(stderrSlot(const QString&)));
+ connect(this, TQT_SIGNAL(testSignal()), this, TQT_SLOT(testSignalSlot()));
+ connect(this, TQT_SIGNAL(stdoutSignal(const TQString&)), this, TQT_SLOT(stdoutSlot(const TQString&)));
+ connect(this, TQT_SIGNAL(stderrSignal(const TQString&)), this, TQT_SLOT(stderrSlot(const TQString&)));
- scriptcontainer->addQObject(this);
+ scriptcontainer->addTQObject(this);
-//scriptcontainer->addSignal("stdout", this, SIGNAL(stdoutSignal(const QString&)));
-//scriptcontainer->addSlot("stderr", this, SLOT(stderrSlot(const QString&)));
+//scriptcontainer->addSignal("stdout", this, TQT_SIGNAL(stdoutSignal(const TQString&)));
+//scriptcontainer->addSlot("stderr", this, TQT_SLOT(stderrSlot(const TQString&)));
- //scriptcontainer->addSignal("myTestSignal", this, SIGNAL(testSignal()));
- //scriptcontainer->addSlot("myTestSlot", this, SLOT(testSlot()));
+ //scriptcontainer->addSignal("myTestSignal", this, TQT_SIGNAL(testSignal()));
+ //scriptcontainer->addSlot("myTestSlot", this, TQT_SLOT(testSlot()));
}
TestObject::~TestObject()
@@ -48,24 +48,24 @@ TestObject::~TestObject()
uint TestObject::func1(uint i)
{
- Kross::krossdebug(QString("CALLED => TestObject::func1 i=%1").arg(i) );
+ Kross::krossdebug(TQString("CALLED => TestObject::func1 i=%1").tqarg(i) );
return i;
}
-void TestObject::func2(QString s, int i)
+void TestObject::func2(TQString s, int i)
{
- Kross::krossdebug(QString("CALLED => TestObject::func2 s=%1 i=%2").arg(s).arg(i));
+ Kross::krossdebug(TQString("CALLED => TestObject::func2 s=%1 i=%2").tqarg(s).tqarg(i));
}
-QString TestObject::func3(QString s, int i)
+TQString TestObject::func3(TQString s, int i)
{
- Kross::krossdebug(QString("CALLED => TestObject::func3 s=%1 i=%2").arg(s).arg(i));
+ Kross::krossdebug(TQString("CALLED => TestObject::func3 s=%1 i=%2").tqarg(s).tqarg(i));
return s;
}
-const QString& TestObject::func4(const QString& s, int i) const
+const TQString& TestObject::func4(const TQString& s, int i) const
{
- Kross::krossdebug(QString("CALLED => TestObject::func4 s=%1 i=%2").arg(s).arg(i));
+ Kross::krossdebug(TQString("CALLED => TestObject::func4 s=%1 i=%2").tqarg(s).tqarg(i));
return s;
}
@@ -73,7 +73,7 @@ void TestObject::testSlot()
{
Kross::krossdebug("TestObject::testSlot called");
emit testSignal();
- emit testSignalString("This is the emitted TestObject::testSignalString(const QString&)");
+ emit testSignalString("This is the emitted TestObject::testSignalString(const TQString&)");
}
void TestObject::testSlot2()
@@ -81,15 +81,15 @@ void TestObject::testSlot2()
Kross::krossdebug("TestObject::testSlot2 called");
}
-void TestObject::stdoutSlot(const QString& s)
+void TestObject::stdoutSlot(const TQString& s)
{
- Kross::krossdebug(QString("stdout: %1").arg(s));
+ Kross::krossdebug(TQString("stdout: %1").tqarg(s));
//std::cout << "<stdout> " << s.latin1() << std::endl;
}
-void TestObject::stderrSlot(const QString& s)
+void TestObject::stderrSlot(const TQString& s)
{
- Kross::krossdebug(QString("stderr: %1").arg(s));
+ Kross::krossdebug(TQString("stderr: %1").tqarg(s));
//std::cout << "<stderr> " << s.latin1() << std::endl;
}
diff --git a/lib/kross/test/testobject.h b/lib/kross/test/testobject.h
index 011b7e54..5a04d9dc 100644
--- a/lib/kross/test/testobject.h
+++ b/lib/kross/test/testobject.h
@@ -22,43 +22,44 @@
#include "../main/scriptcontainer.h"
-#include <qobject.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqstring.h>
-class TestObject : public QObject
+class TestObject : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
- Q_PROPERTY(QString testProperty READ testProperty WRITE setTestProperty)
+ TQ_PROPERTY(TQString testProperty READ testProperty WRITE setTestProperty)
public:
TestObject();
- TestObject(QObject* parent, Kross::Api::ScriptContainer::Ptr scriptcontainer);
+ TestObject(TQObject* tqparent, Kross::Api::ScriptContainer::Ptr scriptcontainer);
~TestObject();
uint func1(uint);
- void func2(QString, int);
- QString func3(QString, int);
- const QString& func4(const QString&, int) const;
+ void func2(TQString, int);
+ TQString func3(TQString, int);
+ const TQString& func4(const TQString&, int) const;
- QString testProperty() const { return m_prop; }
- void setTestProperty(QString prop) { m_prop = prop; }
+ TQString testProperty() const { return m_prop; }
+ void setTestProperty(TQString prop) { m_prop = prop; }
signals:
void testSignal();
- void testSignalString(const QString&);
- void stdoutSignal(const QString&);
- void stderrSignal(const QString&);
+ void testSignalString(const TQString&);
+ void stdoutSignal(const TQString&);
+ void stderrSignal(const TQString&);
public slots:
void testSlot();
void testSlot2();
- void stdoutSlot(const QString&);
- void stderrSlot(const QString&);
+ void stdoutSlot(const TQString&);
+ void stderrSlot(const TQString&);
- QObject* self() { return this; }
+ TQObject* self() { return this; }
private:
- QString m_prop;
+ TQString m_prop;
};
#endif
diff --git a/lib/kross/test/testplugin.cpp b/lib/kross/test/testplugin.cpp
index 07fffc6a..0f0dd249 100644
--- a/lib/kross/test/testplugin.cpp
+++ b/lib/kross/test/testplugin.cpp
@@ -24,7 +24,7 @@
* TestPluginObject
*/
-TestPluginObject::TestPluginObject(const QString& name)
+TestPluginObject::TestPluginObject(const TQString& name)
: Kross::Api::Class<TestPluginObject>(name)
{
// Functions to test the basic datatypes
@@ -63,7 +63,7 @@ TestPluginObject::TestPluginObject(const QString& name)
this->addFunction1< Kross::Api::Variant, Kross::Api::Variant >
("stringfunc_defarg", this, &TestPluginObject::stringfunc, new Kross::Api::Variant("MyDefaultString") );
this->addFunction1< Kross::Api::Variant, Kross::Api::Variant >
- ("stringlistfunc_defarg", this, &TestPluginObject::stringlistfunc, new Kross::Api::Variant(QVariant(QStringList() << "Default1" << "Default2")));
+ ("stringlistfunc_defarg", this, &TestPluginObject::stringlistfunc, new Kross::Api::Variant(TQVariant(TQStringList() << "Default1" << "Default2")));
this->addFunction1< Kross::Api::Variant, Kross::Api::Variant >
("variantfunc_defarg", this, &TestPluginObject::variantfunc, new Kross::Api::Variant("MyDefaultVariantString") );
@@ -75,7 +75,7 @@ TestPluginObject::~TestPluginObject()
{
}
-const QString TestPluginObject::getClassName() const
+const TQString TestPluginObject::getClassName() const
{
return "TestPluginObject";
}
@@ -85,20 +85,20 @@ void TestPluginObject::voiduintfunc(uint) {}
int TestPluginObject::intfunc(int i) { return i; }
bool TestPluginObject::boolfunc(bool b) { return b; }
double TestPluginObject::doublefunc(double d) { return d; }
-QCString TestPluginObject::cstringfunc(const QCString& s) { return s; }
-QString TestPluginObject::stringfunc(const QString& s) { return s; }
-QStringList TestPluginObject::stringlistfunc(const QStringList& sl) { return sl; }
-QVariant TestPluginObject::variantfunc(const QVariant& v) { return v; }
+TQCString TestPluginObject::cstringfunc(const TQCString& s) { return s; }
+TQString TestPluginObject::stringfunc(const TQString& s) { return s; }
+TQStringList TestPluginObject::stringlistfunc(const TQStringList& sl) { return sl; }
+TQVariant TestPluginObject::variantfunc(const TQVariant& v) { return v; }
TestPluginObject* TestPluginObject::objectfunc(TestPluginObject* obj) { return obj; }
-QString TestPluginObject::stringstringfunc(const QString& s, const QString&) { return s; }
-uint TestPluginObject::uintdoublestringfunc(uint i, double, const QString&) { return i; }
-QStringList TestPluginObject::stringlistbooluintdouble(const QStringList& sl, bool, uint, double) { return sl; }
+TQString TestPluginObject::stringstringfunc(const TQString& s, const TQString&) { return s; }
+uint TestPluginObject::uintdoublestringfunc(uint i, double, const TQString&) { return i; }
+TQStringList TestPluginObject::stringlistbooluintdouble(const TQStringList& sl, bool, uint, double) { return sl; }
/************************************************************************
* TestPluginModule
*/
-TestPluginModule::TestPluginModule(const QString& name)
+TestPluginModule::TestPluginModule(const TQString& name)
: Kross::Api::Module(name)
, m_testobject( new TestObject() )
@@ -110,8 +110,8 @@ TestPluginModule::TestPluginModule(const QString& name)
new Kross::Api::Event<TestObject>("testpluginobject2");
addChild(testobjectclass);
- // Wrap a whole QObject
- addChild( new Kross::Api::QtObject( new TestObject() , "testqobject1" ) );
+ // Wrap a whole TQObject
+ addChild( new Kross::Api::TQtObject( new TestObject() , "testqobject1" ) );
}
TestPluginModule::~TestPluginModule()
@@ -119,7 +119,7 @@ TestPluginModule::~TestPluginModule()
delete m_testobject;
}
-const QString TestPluginModule::getClassName() const
+const TQString TestPluginModule::getClassName() const
{
return "TestPluginModule";
}
diff --git a/lib/kross/test/testplugin.h b/lib/kross/test/testplugin.h
index 5253becf..a3b0fdbf 100644
--- a/lib/kross/test/testplugin.h
+++ b/lib/kross/test/testplugin.h
@@ -25,17 +25,17 @@
#include "../api/class.h"
#include "../api/proxy.h"
#include "../api/module.h"
-#include "../api/qtobject.h"
+#include "../api/tqtobject.h"
-#include <qobject.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqstring.h>
class TestPluginObject : public Kross::Api::Class<TestPluginObject>
{
public:
- TestPluginObject(const QString& name);
+ TestPluginObject(const TQString& name);
virtual ~TestPluginObject();
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
private:
uint uintfunc(uint);
@@ -43,16 +43,16 @@ class TestPluginObject : public Kross::Api::Class<TestPluginObject>
int intfunc(int);
bool boolfunc(bool);
double doublefunc(double);
- QCString cstringfunc(const QCString&);
- QString stringfunc(const QString&);
- QStringList stringlistfunc(const QStringList&);
- QVariant variantfunc(const QVariant&);
+ TQCString cstringfunc(const TQCString&);
+ TQString stringfunc(const TQString&);
+ TQStringList stringlistfunc(const TQStringList&);
+ TQVariant variantfunc(const TQVariant&);
TestPluginObject* objectfunc(TestPluginObject* obj);
- QString stringstringfunc(const QString&, const QString&);
- uint uintdoublestringfunc(uint, double, const QString&);
- QStringList stringlistbooluintdouble(const QStringList&, bool, uint, double);
+ TQString stringstringfunc(const TQString&, const TQString&);
+ uint uintdoublestringfunc(uint, double, const TQString&);
+ TQStringList stringlistbooluintdouble(const TQStringList&, bool, uint, double);
};
class TestObject;
@@ -60,11 +60,11 @@ class TestObject;
class TestPluginModule : public Kross::Api::Module
{
public:
- TestPluginModule(const QString& name);
+ TestPluginModule(const TQString& name);
virtual ~TestPluginModule();
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
- virtual Kross::Api::Object::Ptr get(const QString& /*name*/, void* /*pointer*/ = 0)
+ virtual Kross::Api::Object::Ptr get(const TQString& /*name*/, void* /*pointer*/ = 0)
{
return 0;
}
diff --git a/lib/kross/test/testwindow.cpp b/lib/kross/test/testwindow.cpp
index f60119f0..5aa33958 100644
--- a/lib/kross/test/testwindow.cpp
+++ b/lib/kross/test/testwindow.cpp
@@ -20,13 +20,13 @@
#include "testwindow.h"
#include "testplugin.h"
-#include <qlabel.h>
-#include <qvbox.h>
-#include <qvgroupbox.h>
-//#include <qhgroupbox.h>
-#include <qcombobox.h>
-#include <qdir.h>
-#include <qpopupmenu.h>
+#include <tqlabel.h>
+#include <tqvbox.h>
+#include <tqvgroupbox.h>
+//#include <tqhgroupbox.h>
+#include <tqcombobox.h>
+#include <tqdir.h>
+#include <tqpopupmenu.h>
#include <ktextedit.h>
#include <kpushbutton.h>
@@ -34,7 +34,7 @@
#include <kmenubar.h>
#include <kstandarddirs.h>
-TestWindow::TestWindow(const QString& interpretername, const QString& scriptcode)
+TestWindow::TestWindow(const TQString& interpretername, const TQString& scriptcode)
: KMainWindow()
, m_interpretername(interpretername)
, m_scriptcode(scriptcode)
@@ -48,12 +48,12 @@ TestWindow::TestWindow(const QString& interpretername, const QString& scriptcode
m_scriptextension = new Kross::Api::ScriptGUIClient(this, this);
- QString file = KGlobal::dirs()->findResource("appdata", "testscripting.rc");
+ TQString file = KGlobal::dirs()->findResource("appdata", "testscripting.rc");
if(file.isNull())
- file = QDir(QDir::currentDirPath()).filePath("testscripting.rc");
+ file = TQDir(TQDir::currentDirPath()).filePath("testscripting.rc");
else Kross::krossdebug("-------------------------222222");
- Kross::krossdebug(QString("XML-file: %1").arg(file));
+ Kross::krossdebug(TQString("XML-file: %1").tqarg(file));
m_scriptextension->setXMLFile(file);
//menuFile->insertSeparator();
@@ -68,22 +68,22 @@ TestWindow::TestWindow(const QString& interpretername, const QString& scriptcode
if(scriptsaction) scriptsaction->plug(menuFile);
//menuFile->insertItem( ( (KActionMenu*)m_scriptextension->action("scripts") )->popupMenu() );
- QVBox* mainbox = new QVBox(this);
+ TQVBox* mainbox = new TQVBox(this);
- QVGroupBox* interpretergrpbox = new QVGroupBox("Interpreter", mainbox);
- QStringList interpreters = Kross::Api::Manager::scriptManager()->getInterpreters();
- m_interpretercombo = new QComboBox(interpretergrpbox);
+ TQVGroupBox* interpretergrpbox = new TQVGroupBox("Interpreter", mainbox);
+ TQStringList interpreters = Kross::Api::Manager::scriptManager()->getInterpreters();
+ m_interpretercombo = new TQComboBox(interpretergrpbox);
m_interpretercombo->insertStringList(interpreters);
m_interpretercombo->setCurrentText(interpretername);
- QVGroupBox* scriptgrpbox = new QVGroupBox("Scripting code", mainbox);
- m_codeedit = new KTextEdit(m_scriptcode, QString::null, scriptgrpbox);
- m_codeedit->setWordWrap(QTextEdit::NoWrap);
- m_codeedit->setTextFormat(Qt::PlainText);
+ TQVGroupBox* scriptgrpbox = new TQVGroupBox("Scripting code", mainbox);
+ m_codeedit = new KTextEdit(m_scriptcode, TQString(), scriptgrpbox);
+ m_codeedit->setWordWrap(TQTextEdit::NoWrap);
+ m_codeedit->setTextFormat(TQt::PlainText);
- QHBox* btnbox = new QHBox(mainbox);
+ TQHBox* btnbox = new TQHBox(mainbox);
KPushButton* execbtn = new KPushButton("Execute", btnbox);
- connect(execbtn, SIGNAL(clicked()), this, SLOT(execute()));
+ connect(execbtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(execute()));
setCentralWidget(mainbox);
setMinimumSize(600,420);
@@ -99,11 +99,11 @@ void TestWindow::execute()
m_scriptcontainer->setCode(m_codeedit->text());
Kross::Api::Object::Ptr result = m_scriptcontainer->execute();
if(m_scriptcontainer->hadException()) {
- Kross::krossdebug( QString("EXCEPTION => %1").arg(m_scriptcontainer->getException()->toString()) );
+ Kross::krossdebug( TQString("EXCEPTION => %1").tqarg(m_scriptcontainer->getException()->toString()) );
}
else {
- QString s = result ? result->toString() : QString::null;
- Kross::krossdebug( QString("DONE => %1").arg(s) );
+ TQString s = result ? result->toString() : TQString();
+ Kross::krossdebug( TQString("DONE => %1").tqarg(s) );
}
}
diff --git a/lib/kross/test/testwindow.h b/lib/kross/test/testwindow.h
index dbb190b9..9f5da67d 100644
--- a/lib/kross/test/testwindow.h
+++ b/lib/kross/test/testwindow.h
@@ -25,30 +25,31 @@
#include "../main/scriptguiclient.h"
#include "../api/object.h"
-//#include <qobject.h>
-#include <qstring.h>
+//#include <tqobject.h>
+#include <tqstring.h>
#include <kmainwindow.h>
-class QComboBox;
+class TQComboBox;
class KTextEdit;
class TestWindow : public KMainWindow
{
Q_OBJECT
+ TQ_OBJECT
public:
- TestWindow(const QString& interpretername, const QString& scriptcode);
+ TestWindow(const TQString& interpretername, const TQString& scriptcode);
virtual ~TestWindow();
private slots:
void execute();
private:
- QString m_interpretername;
- QString m_scriptcode;
+ TQString m_interpretername;
+ TQString m_scriptcode;
Kross::Api::ScriptContainer::Ptr m_scriptcontainer;
Kross::Api::ScriptGUIClient* m_scriptextension;
- QComboBox* m_interpretercombo;
+ TQComboBox* m_interpretercombo;
KTextEdit* m_codeedit;
};