summaryrefslogtreecommitdiffstats
path: root/kunittest
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-12 01:36:19 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-12 01:36:19 +0000
commit99a2774ca6f1cab334de5d43fe36fc44ae889a4c (patch)
treeeff34cf0762227f6baf2a93e8fef48d4bed2651c /kunittest
parent1c104292188541106338d4940b0f04beeb4301a0 (diff)
downloadtdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.tar.gz
tdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.zip
TQt4 convert kdesdk
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1236185 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kunittest')
-rw-r--r--kunittest/example/module/sampletests.h1
-rw-r--r--kunittest/runnergui.cpp54
-rw-r--r--kunittest/runnergui.h5
-rw-r--r--kunittest/testerwidget.ui38
-rw-r--r--kunittest/testerwidget.ui.h2
5 files changed, 51 insertions, 49 deletions
diff --git a/kunittest/example/module/sampletests.h b/kunittest/example/module/sampletests.h
index 3cd30211..9bbd5d78 100644
--- a/kunittest/example/module/sampletests.h
+++ b/kunittest/example/module/sampletests.h
@@ -31,6 +31,7 @@
class SlotSampleTester : public KUnitTest::SlotTester
{
Q_OBJECT
+ TQ_OBJECT
public slots:
void setUp();
diff --git a/kunittest/runnergui.cpp b/kunittest/runnergui.cpp
index ded28e57..8b4969a8 100644
--- a/kunittest/runnergui.cpp
+++ b/kunittest/runnergui.cpp
@@ -70,7 +70,7 @@ namespace KUnitTest
*/
bool addDebugInfo(const TQString &name, const TQString &info)
{
- Tester *tester = Runner::self()->registry().find(name.local8Bit());
+ Tester *tester = Runner::self()->registry().tqfind(name.local8Bit());
if ( tester == 0L ) return false;
tester->results()->addDebugInfo(info);
@@ -80,7 +80,7 @@ namespace KUnitTest
bool addSlotDebugInfo(const TQString &name, const TQString &slt, const TQString &info)
{
- Tester *tester = Runner::self()->registry().find(name.local8Bit());
+ Tester *tester = Runner::self()->registry().tqfind(name.local8Bit());
if ( tester == 0L ) return false;
if ( ! tester->inherits("KUnitTest::SlotTester") ) return false;
@@ -95,7 +95,7 @@ namespace KUnitTest
RunnerGUI *m_rg;
};
- RunnerGUI::RunnerGUI(TQWidget *parent) : TQHBox(parent)
+ RunnerGUI::RunnerGUI(TQWidget *tqparent) : TQHBox(tqparent)
{
m_dcop = new RunnerGUIDCOPImpl(this);
@@ -113,10 +113,10 @@ namespace KUnitTest
addTester(it.currentKey(), it.current());
TQString test = it.currentKey();
- int index = test.find("::");
+ int index = test.tqfind("::");
if ( index != -1 ) test = test.left(index);
- if ( suites.contains(test) == 0 )
+ if ( suites.tqcontains(test) == 0 )
suites.append(test);
}
@@ -127,12 +127,12 @@ namespace KUnitTest
m_testerWidget->resultList()->setAllColumnsShowFocus(true);
m_testerWidget->resultList()->setSelectionMode(TQListView::Extended);
m_testerWidget->resultList()->setRootIsDecorated(true);
- m_testerWidget->resultList()->setColumnAlignment(g_finishedColumn, Qt::AlignHCenter);
- m_testerWidget->resultList()->setColumnAlignment(g_skippedColumn, Qt::AlignHCenter);
- m_testerWidget->resultList()->setColumnAlignment(g_failedColumn, Qt::AlignHCenter);
- m_testerWidget->resultList()->setColumnAlignment(g_xfailedColumn, Qt::AlignHCenter);
- m_testerWidget->resultList()->setColumnAlignment(g_passedColumn, Qt::AlignHCenter);
- m_testerWidget->resultList()->setColumnAlignment(g_xpassedColumn, Qt::AlignHCenter);
+ m_testerWidget->resultList()->setColumnAlignment(g_finishedColumn, TQt::AlignHCenter);
+ m_testerWidget->resultList()->setColumnAlignment(g_skippedColumn, TQt::AlignHCenter);
+ m_testerWidget->resultList()->setColumnAlignment(g_failedColumn, TQt::AlignHCenter);
+ m_testerWidget->resultList()->setColumnAlignment(g_xfailedColumn, TQt::AlignHCenter);
+ m_testerWidget->resultList()->setColumnAlignment(g_passedColumn, TQt::AlignHCenter);
+ m_testerWidget->resultList()->setColumnAlignment(g_xpassedColumn, TQt::AlignHCenter);
// set the text in the results label
fillResultsLabel();
@@ -162,13 +162,13 @@ namespace KUnitTest
if ( Runner::self()->numberOfTests() > 0 )
m_testerWidget->resultsLabel()->setText(
TQString("Test cases: %1 | Tests performed: %5, Skipped: <font color=\"#f7a300\">%4</font> | Passed: <font color=\"#009900\">%2</font>, Failed: <font color=\"#990000\">%3</font>")
- .arg(Runner::self()->numberOfTestCases())
- .arg(Runner::self()->numberOfPassedTests())
- .arg(Runner::self()->numberOfFailedTests())
- .arg(Runner::self()->numberOfSkippedTests())
- .arg(Runner::self()->numberOfTests()) );
+ .tqarg(Runner::self()->numberOfTestCases())
+ .tqarg(Runner::self()->numberOfPassedTests())
+ .tqarg(Runner::self()->numberOfFailedTests())
+ .tqarg(Runner::self()->numberOfSkippedTests())
+ .tqarg(Runner::self()->numberOfTests()) );
else
- m_testerWidget->resultsLabel()->setText(TQString("Test cases: %1").arg(Runner::self()->numberOfTestCases()));
+ m_testerWidget->resultsLabel()->setText(TQString("Test cases: %1").tqarg(Runner::self()->numberOfTestCases()));
}
void RunnerGUI::addTestResult(const char *name, Tester *test)
@@ -211,7 +211,7 @@ namespace KUnitTest
if ( test->inherits("KUnitTest::SlotTester") )
{
- TQStrList allSlots = test->metaObject()->slotNames();
+ TQStrList allSlots = test->tqmetaObject()->slotNames();
for ( char *sl = allSlots.first(); sl; sl = allSlots.next() )
{
if ( TQString(sl).startsWith("test") )
@@ -222,7 +222,7 @@ namespace KUnitTest
TQListViewItem *RunnerGUI::getItem(const TQString &name, TQListViewItem *item /*= 0L*/)
{
- TQListViewItem *parent = item;
+ TQListViewItem *tqparent = item;
if ( item == 0L ) item = m_testerWidget->resultList()->firstChild();
else item = item->firstChild();
@@ -233,10 +233,10 @@ namespace KUnitTest
// item not found, create it
if ( item == 0L )
{
- if ( parent == 0L )
+ if ( tqparent == 0L )
item = new TQListViewItem(m_testerWidget->resultList());
else
- item = new TQListViewItem(parent);
+ item = new TQListViewItem(tqparent);
item->setText(g_nameColumn, name);
}
@@ -288,13 +288,13 @@ namespace KUnitTest
bool passed = (item->text(g_failedColumn).toInt(&ok) + item->text(g_xfailedColumn).toInt(&ok)) == 0;
item->setPixmap(g_nameColumn, passed ? SmallIcon("button_ok") : SmallIcon("button_cancel") );
- setSummary(item->parent(), res);
+ setSummary(item->tqparent(), res);
}
TQString RunnerGUI::fullName(TQListViewItem *item)
{
TQString name = item->text(g_nameColumn);
- while ( (item = item->parent()) != 0L )
+ while ( (item = item->tqparent()) != 0L )
name = item->text(g_nameColumn) + "::" + name;
return name;
@@ -322,7 +322,7 @@ namespace KUnitTest
TQString prefix = fullName(item);
if ( prefix.endsWith("()") )
{
- int index = prefix.findRev("::");
+ int index = prefix.tqfindRev("::");
prefix = prefix.left(index);
}
prefixes << prefix;
@@ -358,9 +358,9 @@ namespace KUnitTest
if ( item == 0L ) return;
TQString name = fullName(item);
- if ( name.endsWith("()") ) name = fullName(item->parent());
+ if ( name.endsWith("()") ) name = fullName(item->tqparent());
- Tester *tester = Runner::self()->registry().find(name.local8Bit());
+ Tester *tester = Runner::self()->registry().tqfind(name.local8Bit());
if ( tester == 0L ) return;
@@ -423,7 +423,7 @@ namespace KUnitTest
bool ok;
arg << TQString(reFileAndLine.cap(1)) << (reFileAndLine.cap(2).toInt(&ok) - 1);
client.send("kdevelop-*", "KDevPartController", "editDocument(TQString,int)", data);
- client.send("kdevelop-*", "MainWindow", "raise()", "");
+ client.send("kdevelop-*", "MainWindow", "raise()", TQString(""));
client.detach();
}
diff --git a/kunittest/runnergui.h b/kunittest/runnergui.h
index 07c4ff8d..6d996849 100644
--- a/kunittest/runnergui.h
+++ b/kunittest/runnergui.h
@@ -41,12 +41,13 @@ namespace KUnitTest
{
class RunnerGUIDCOPImpl;
- class KDE_EXPORT RunnerGUI : public QHBox
+ class KDE_EXPORT RunnerGUI : public TQHBox
{
Q_OBJECT
+ TQ_OBJECT
public:
- RunnerGUI(TQWidget *parent);
+ RunnerGUI(TQWidget *tqparent);
~RunnerGUI();
private slots:
diff --git a/kunittest/testerwidget.ui b/kunittest/testerwidget.ui
index 61f74337..197eddd4 100644
--- a/kunittest/testerwidget.ui
+++ b/kunittest/testerwidget.ui
@@ -1,10 +1,10 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>TesterWidget</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>TesterWidget</cstring>
</property>
- <property name="geometry">
+ <property name="tqgeometry">
<rect>
<x>0</x>
<y>0</y>
@@ -25,7 +25,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QPushButton" row="0" column="2">
+ <widget class="TQPushButton" row="0" column="2">
<property name="name">
<cstring>m_pshRun</cstring>
</property>
@@ -33,12 +33,12 @@
<string>Run</string>
</property>
</widget>
- <widget class="QProgressBar" row="1" column="0" rowspan="1" colspan="3">
+ <widget class="TQProgressBar" row="1" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>m_pbProgress</cstring>
</property>
</widget>
- <widget class="QComboBox" row="0" column="1">
+ <widget class="TQComboBox" row="0" column="1">
<property name="name">
<cstring>m_cbSelect</cstring>
</property>
@@ -51,7 +51,7 @@
</sizepolicy>
</property>
</widget>
- <widget class="QLabel" row="0" column="0">
+ <widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>m_lbSelect</cstring>
</property>
@@ -59,7 +59,7 @@
<string>Select a suite or module:</string>
</property>
</widget>
- <widget class="QLabel" row="2" column="0" rowspan="1" colspan="3">
+ <widget class="TQLabel" row="2" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>m_lbResults</cstring>
</property>
@@ -67,7 +67,7 @@
<string></string>
</property>
</widget>
- <widget class="QListView" row="3" column="0" rowspan="1" colspan="3">
+ <widget class="TQListView" row="3" column="0" rowspan="1" colspan="3">
<column>
<property name="text">
<string>Test</string>
@@ -156,18 +156,18 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>0</width>
<height>200</height>
</size>
</property>
</widget>
- <widget class="QTextEdit" row="4" column="0" rowspan="1" colspan="3">
+ <widget class="TQTextEdit" row="4" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>m_teDetails</cstring>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>600</width>
<height>200</height>
@@ -182,16 +182,16 @@
<includes>
<include location="local" impldecl="in implementation">testerwidget.ui.h</include>
</includes>
-<signals>
+<Q_SIGNALS>
<signal>run()</signal>
-</signals>
+</Q_SIGNALS>
<functions>
<function access="private" specifier="non virtual">init()</function>
- <function returnType="QListView *">resultList()</function>
- <function returnType="QTextEdit *">details()</function>
- <function returnType="QProgressBar *">progressBar()</function>
- <function returnType="QLabel *">resultsLabel()</function>
- <function returnType="QComboBox *">selectCombo()</function>
+ <function returnType="TQListView *">resultList()</function>
+ <function returnType="TQTextEdit *">details()</function>
+ <function returnType="TQProgressBar *">progressBar()</function>
+ <function returnType="TQLabel *">resultsLabel()</function>
+ <function returnType="TQComboBox *">selectCombo()</function>
</functions>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
</UI>
diff --git a/kunittest/testerwidget.ui.h b/kunittest/testerwidget.ui.h
index fd79eb96..f80a248d 100644
--- a/kunittest/testerwidget.ui.h
+++ b/kunittest/testerwidget.ui.h
@@ -2,7 +2,7 @@
** ui.h extension file, included from the uic-generated form implementation.
**
** If you want to add, delete, or rename functions or slots, use
-** Qt Designer to update this file, preserving your code.
+** TQt Designer to update this file, preserving your code.
**
** You should not define a constructor or destructor in this file.
** Instead, write your code in functions called init() and destroy().