summaryrefslogtreecommitdiffstats
path: root/lib/kotext/tests
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kotext/tests')
-rw-r--r--lib/kotext/tests/KoUserStyleTester.cpp22
-rw-r--r--lib/kotext/tests/KoUserStyleTester.h1
-rw-r--r--lib/kotext/tests/kobordertest.cpp60
-rw-r--r--lib/kotext/tests/kotextformattertest.cpp10
-rw-r--r--lib/kotext/tests/kovariabletest.cpp10
5 files changed, 52 insertions, 51 deletions
diff --git a/lib/kotext/tests/KoUserStyleTester.cpp b/lib/kotext/tests/KoUserStyleTester.cpp
index 4fff7085..7eac3881 100644
--- a/lib/kotext/tests/KoUserStyleTester.cpp
+++ b/lib/kotext/tests/KoUserStyleTester.cpp
@@ -53,9 +53,9 @@ void KoUserStyleTester::testAddStyle()
KoUserStyleCollection coll( "test" );
KoUserStyle* style = new KoUserStyle( "test1" );
- COMPARE( style->name(), QString( "test1" ) );
- COMPARE( style->displayName(), QString( "test1" ) );
- const QString displayName = "A lovely name";
+ COMPARE( style->name(), TQString( "test1" ) );
+ COMPARE( style->displayName(), TQString( "test1" ) );
+ const TQString displayName = "A lovely name";
style->setDisplayName( displayName );
COMPARE( style->displayName(), displayName );
@@ -63,7 +63,7 @@ void KoUserStyleTester::testAddStyle()
COMPARE( ret, style );
KoUserStyle* style2 = new KoUserStyle( "test1" );
- COMPARE( style2->name(), QString( "test1" ) );
+ COMPARE( style2->name(), TQString( "test1" ) );
style2->setDisplayName( displayName );
ret = coll.addStyle( style2 );
// here style2 got deleted.
@@ -75,10 +75,10 @@ void KoUserStyleTester::testAddStyle()
// Add another style for good this time
KoUserStyle* style3 = new KoUserStyle( "test3" );
- COMPARE( style3->name(), QString( "test3" ) );
+ COMPARE( style3->name(), TQString( "test3" ) );
ret = coll.addStyle( style3 );
- QStringList displayNames = coll.displayNameList();
+ TQStringList displayNames = coll.displayNameList();
COMPARE( (int)displayNames.count(), 2 );
COMPARE( displayNames[0], displayName );
COMPARE( displayNames[1], style3->name() );
@@ -88,15 +88,15 @@ void KoUserStyleTester::testFindStyle()
{
KoUserStyleCollection coll( "test" );
KoUserStyle* style = new KoUserStyle( "test1" );
- const QString displayName = "A lovely name";
+ const TQString displayName = "A lovely name";
style->setDisplayName( displayName );
coll.addStyle( style );
// --- findStyle tests ---
- KoUserStyle* ret = coll.findStyle( "test1", QString::null );
+ KoUserStyle* ret = coll.findStyle( "test1", TQString() );
COMPARE( ret, style );
- ret = coll.findStyle( "foo", QString::null );
+ ret = coll.findStyle( "foo", TQString() );
COMPARE( ret, (KoUserStyle*)0 );
ret = coll.findStyle( "foo", "test1" ); // fallback not used for style 'foo'
@@ -150,13 +150,13 @@ void KoUserStyleTester::testReorder()
coll.addStyle( style );
COMPARE( coll.count(), 3 );
- QStringList newOrder;
+ TQStringList newOrder;
newOrder << "test3";
newOrder << "test2";
newOrder << "test1";
coll.updateStyleListOrder( newOrder );
COMPARE( coll.count(), 3 );
- QStringList displayNames = coll.displayNameList();
+ TQStringList displayNames = coll.displayNameList();
COMPARE( (int)displayNames.count(), 3 );
COMPARE( displayNames.join(","), newOrder.join(",") );
}
diff --git a/lib/kotext/tests/KoUserStyleTester.h b/lib/kotext/tests/KoUserStyleTester.h
index 79e61c6a..d5b32519 100644
--- a/lib/kotext/tests/KoUserStyleTester.h
+++ b/lib/kotext/tests/KoUserStyleTester.h
@@ -23,6 +23,7 @@
class KoUserStyleTester : public KUnitTest::SlotTester {
Q_OBJECT
+ TQ_OBJECT
private slots:
void testEmptyCollection();
void testAddStyle();
diff --git a/lib/kotext/tests/kobordertest.cpp b/lib/kotext/tests/kobordertest.cpp
index cce43179..36169272 100644
--- a/lib/kotext/tests/kobordertest.cpp
+++ b/lib/kotext/tests/kobordertest.cpp
@@ -2,23 +2,23 @@
#include <KoZoomHandler.h>
#include <kapplication.h>
#include <kcmdlineargs.h>
-#include <qpainter.h>
-#include <qwidget.h>
-#include <qgrid.h>
+#include <tqpainter.h>
+#include <tqwidget.h>
+#include <tqgrid.h>
-class MyWidget : public QWidget
+class MyWidget : public TQWidget
{
public:
- MyWidget( KoZoomHandler* _zh, QWidget* parent )
- : QWidget( parent ), m_zh(_zh) {
- setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
+ MyWidget( KoZoomHandler* _zh, TQWidget* tqparent )
+ : TQWidget( tqparent ), m_zh(_zh) {
+ tqsetSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed );
}
- QSize sizeHint() const {
- return QSize( 150, 150 );
+ TQSize tqsizeHint() const {
+ return TQSize( 150, 150 );
}
- QSize minimumSizeHint() const {
- return sizeHint();
+ TQSize tqminimumSizeHint() const {
+ return tqsizeHint();
}
KoBorder m_leftBorder;
@@ -27,13 +27,13 @@ public:
KoBorder m_bottomBorder;
protected:
- virtual void paintEvent( QPaintEvent* )
+ virtual void paintEvent( TQPaintEvent* )
{
- QPainter p( this );
- QRect rect( 10, 10, 100, 100 );
+ TQPainter p( this );
+ TQRect rect( 10, 10, 100, 100 );
KoBorder::drawBorders( p, m_zh, rect, m_leftBorder,
m_rightBorder, m_topBorder, m_bottomBorder,
- 0, QPen() );
+ 0, TQPen() );
// Show the corners of the rect - they must apppear _inside_ the borders.
p.setPen( black );
p.drawPoint( rect.topLeft() );
@@ -53,30 +53,30 @@ int main (int argc, char ** argv)
KoZoomHandler* zh = new KoZoomHandler();
- QGrid* grid = new QGrid(2, Qt::Horizontal, 0L); // 2 columns
+ TQGrid* grid = new TQGrid(2, Qt::Horizontal, 0L); // 2 columns
{
// First square
MyWidget* w = new MyWidget(zh, grid);
w->m_leftBorder.setPenWidth( 6 );
- w->m_leftBorder.color = Qt::red;
+ w->m_leftBorder.color = TQt::red;
w->m_rightBorder.setPenWidth( 9 );
- w->m_rightBorder.color = Qt::red;
+ w->m_rightBorder.color = TQt::red;
w->m_topBorder.setPenWidth( 11 );
- w->m_topBorder.color = Qt::blue;
+ w->m_topBorder.color = TQt::blue;
w->m_bottomBorder.setPenWidth( 13 );
- w->m_bottomBorder.color = Qt::green;
+ w->m_bottomBorder.color = TQt::green;
}
{
// Second square, with opposite (odd/even-wise) widths
MyWidget* w = new MyWidget(zh, grid);
w->m_leftBorder.setPenWidth( 7 );
- w->m_leftBorder.color = Qt::red;
+ w->m_leftBorder.color = TQt::red;
w->m_rightBorder.setPenWidth( 8 );
- w->m_rightBorder.color = Qt::red;
+ w->m_rightBorder.color = TQt::red;
w->m_topBorder.setPenWidth( 10 );
- w->m_topBorder.color = Qt::blue;
+ w->m_topBorder.color = TQt::blue;
w->m_bottomBorder.setPenWidth( 12 );
- w->m_bottomBorder.color = Qt::green;
+ w->m_bottomBorder.color = TQt::green;
}
{
// Third square, with double borders
@@ -84,13 +84,13 @@ int main (int argc, char ** argv)
w2->m_leftBorder.setPenWidth( 2 );
w2->m_leftBorder.setStyle( KoBorder::DOUBLE_LINE );
w2->m_rightBorder.setPenWidth( 6 );
- w2->m_rightBorder.color = Qt::red;
+ w2->m_rightBorder.color = TQt::red;
w2->m_rightBorder.setStyle( KoBorder::DOUBLE_LINE );
w2->m_topBorder.setPenWidth( 4 );
- w2->m_topBorder.color = Qt::blue;
+ w2->m_topBorder.color = TQt::blue;
w2->m_topBorder.setStyle( KoBorder::DOUBLE_LINE );
w2->m_bottomBorder.setPenWidth( 6 );
- w2->m_bottomBorder.color = Qt::green;
+ w2->m_bottomBorder.color = TQt::green;
w2->m_bottomBorder.setStyle( KoBorder::DOUBLE_LINE );
}
{
@@ -99,13 +99,13 @@ int main (int argc, char ** argv)
w2->m_leftBorder.setPenWidth( 1 );
w2->m_leftBorder.setStyle( KoBorder::DOUBLE_LINE );
w2->m_rightBorder.setPenWidth( 5 );
- w2->m_rightBorder.color = Qt::red;
+ w2->m_rightBorder.color = TQt::red;
w2->m_rightBorder.setStyle( KoBorder::DOUBLE_LINE );
w2->m_topBorder.setPenWidth( 3 );
- w2->m_topBorder.color = Qt::blue;
+ w2->m_topBorder.color = TQt::blue;
w2->m_topBorder.setStyle( KoBorder::DOUBLE_LINE );
w2->m_bottomBorder.setPenWidth( 5 );
- w2->m_bottomBorder.color = Qt::green;
+ w2->m_bottomBorder.color = TQt::green;
w2->m_bottomBorder.setStyle( KoBorder::DOUBLE_LINE );
}
grid->show();
diff --git a/lib/kotext/tests/kotextformattertest.cpp b/lib/kotext/tests/kotextformattertest.cpp
index 0a4ab140..b6138315 100644
--- a/lib/kotext/tests/kotextformattertest.cpp
+++ b/lib/kotext/tests/kotextformattertest.cpp
@@ -72,8 +72,8 @@ private:
KoTextFormatterTest::KoTextFormatterTest()
{
zh = new KoTextZoomHandler;
- QFont defaultFont( "helvetica", 12 );
- KoTextFormatCollection* fc = new KoTextFormatCollection( defaultFont, Qt::black, "en_US", false /*no hyphenation*/ );
+ TQFont defaultFont( "helvetica", 12 );
+ KoTextFormatCollection* fc = new KoTextFormatCollection( defaultFont, TQt::black, "en_US", false /*no hyphenation*/ );
KoTextFormatter* formatter = new KoTextFormatter;
// fc and formatter are owned by the doc
doc = new KoTextDocument( zh, fc, formatter );
@@ -89,7 +89,7 @@ void KoTextFormatterTest::speedTest()
// Format it 50 times
for ( uint i = 0 ; i < 50 ; ++i )
{
- parag->invalidate(0);
+ parag->tqinvalidate(0);
parag->format();
}
doc->clear(false);
@@ -205,8 +205,8 @@ int main (int argc, char ** argv)
KApplication app(argc, argv, "KoTextFormatter test");
// Don't let locale settings lead to different hyphenation output
- KGlobal::locale()->setLanguage( QString::fromLatin1( "en_US" ) );
- KGlobal::locale()->setCountry( QString::fromLatin1( "C" ) );
+ KGlobal::locale()->setLanguage( TQString::tqfromLatin1( "en_US" ) );
+ KGlobal::locale()->setCountry( TQString::tqfromLatin1( "C" ) );
KoTextFormatterTest test;
//test.speedTest();
diff --git a/lib/kotext/tests/kovariabletest.cpp b/lib/kotext/tests/kovariabletest.cpp
index 05b801c6..6d040350 100644
--- a/lib/kotext/tests/kovariabletest.cpp
+++ b/lib/kotext/tests/kovariabletest.cpp
@@ -16,7 +16,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <qstring.h>
+#include <tqstring.h>
#include <assert.h>
#include "../IsoDuration.h"
@@ -24,7 +24,7 @@
void testMinutes()
{
int minutes = 145;
- QString str = minutesToISODuration( minutes );
+ TQString str = minutesToISODuration( minutes );
int result = ISODurationToMinutes( str );
qDebug( "%d minutes -> %s -> %d", minutes, str.latin1(), result );
assert( result == minutes );
@@ -33,7 +33,7 @@ void testMinutes()
void testNegativeMinutes()
{
int minutes = -15;
- QString str = minutesToISODuration( minutes );
+ TQString str = minutesToISODuration( minutes );
int result = ISODurationToMinutes( str );
qDebug( "%d minutes -> %s -> %d", minutes, str.latin1(), result );
assert( result == minutes );
@@ -42,7 +42,7 @@ void testNegativeMinutes()
void testDays()
{
int days = 14;
- QString str = daysToISODuration( days );
+ TQString str = daysToISODuration( days );
int result = ISODurationToDays( str );
qDebug( "%d days -> %s -> %d", days, str.latin1(), result );
assert( result == days );
@@ -51,7 +51,7 @@ void testDays()
void testNegativeDays()
{
int days = -14;
- QString str = daysToISODuration( days );
+ TQString str = daysToISODuration( days );
int result = ISODurationToDays( str );
qDebug( "%d days -> %s -> %d", days, str.latin1(), result );
assert( result == days );