summaryrefslogtreecommitdiffstats
path: root/kbruch
diff options
context:
space:
mode:
Diffstat (limited to 'kbruch')
-rw-r--r--kbruch/ChangeLog4
-rw-r--r--kbruch/src/exercisebase.cpp4
-rw-r--r--kbruch/src/exercisebase.h5
-rw-r--r--kbruch/src/exercisecompare.cpp18
-rw-r--r--kbruch/src/exercisecompare.h3
-rw-r--r--kbruch/src/exerciseconvert.cpp18
-rw-r--r--kbruch/src/exerciseconvert.h3
-rw-r--r--kbruch/src/exercisefactorize.cpp82
-rw-r--r--kbruch/src/exercisefactorize.h19
-rw-r--r--kbruch/src/factorizedwidget.cpp8
-rw-r--r--kbruch/src/factorizedwidget.h3
-rw-r--r--kbruch/src/fractionbasewidget.cpp16
-rw-r--r--kbruch/src/fractionbasewidget.h7
-rw-r--r--kbruch/src/kbruch.cpp6
-rw-r--r--kbruch/src/kbruch.h2
-rw-r--r--kbruch/src/mainqtwidget.cpp66
-rw-r--r--kbruch/src/mainqtwidget.h15
-rw-r--r--kbruch/src/ratio.cpp4
-rw-r--r--kbruch/src/rationalwidget.cpp8
-rw-r--r--kbruch/src/rationalwidget.h3
-rw-r--r--kbruch/src/ratiowidget.cpp8
-rw-r--r--kbruch/src/ratiowidget.h3
-rw-r--r--kbruch/src/resultwidget.cpp10
-rw-r--r--kbruch/src/resultwidget.h3
-rw-r--r--kbruch/src/statisticsview.cpp34
-rw-r--r--kbruch/src/statisticsview.h7
-rw-r--r--kbruch/src/taskview.cpp20
-rw-r--r--kbruch/src/taskview.h3
-rw-r--r--kbruch/src/taskvieweroptionsbase.ui30
-rw-r--r--kbruch/src/taskwidget.cpp8
-rw-r--r--kbruch/src/taskwidget.h3
-rw-r--r--kbruch/testcases/primenumber_test.cpp52
-rw-r--r--kbruch/testcases/ratio_test.cpp158
33 files changed, 323 insertions, 310 deletions
diff --git a/kbruch/ChangeLog b/kbruch/ChangeLog
index 688ef69f..be301b7b 100644
--- a/kbruch/ChangeLog
+++ b/kbruch/ChangeLog
@@ -1,6 +1,6 @@
2003-04-28 Sebastian Stein <seb.kde@hpfsc.de>
- * fixed layout problem with help of Dominique Devries
+ * fixed tqlayout problem with help of Dominique Devries
* compiler warnings (<iosteam>) removed by Dominique Devries
@@ -10,7 +10,7 @@
2003-04-24 Sebastian Stein <seb.kde@hpfsc.de>
- * experiments with the layout problem, but found no solution
+ * experiments with the tqlayout problem, but found no solution
* removed #define TRUE, used type bool instead
diff --git a/kbruch/src/exercisebase.cpp b/kbruch/src/exercisebase.cpp
index 649bb6c8..f7be0fdc 100644
--- a/kbruch/src/exercisebase.cpp
+++ b/kbruch/src/exercisebase.cpp
@@ -25,8 +25,8 @@
/* ----- public member functions ----- */
/* constructor */
-ExerciseBase::ExerciseBase(TQWidget * parent, const char * name):
- TQWidget(parent, name)
+ExerciseBase::ExerciseBase(TQWidget * tqparent, const char * name):
+ TQWidget(tqparent, name)
{
#ifdef DEBUG
kdDebug() << "constructor ExerciseBase()" << endl;
diff --git a/kbruch/src/exercisebase.h b/kbruch/src/exercisebase.h
index 87fe03b5..cd0428d9 100644
--- a/kbruch/src/exercisebase.h
+++ b/kbruch/src/exercisebase.h
@@ -33,13 +33,14 @@
*
* \author Sebastian Stein
* */
-class ExerciseBase : public QWidget
+class ExerciseBase : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
/** constructor */
- ExerciseBase(TQWidget * parent = 0, const char * name = 0);
+ ExerciseBase(TQWidget * tqparent = 0, const char * name = 0);
/** destructor */
~ExerciseBase();
diff --git a/kbruch/src/exercisecompare.cpp b/kbruch/src/exercisecompare.cpp
index f6652e56..295698fb 100644
--- a/kbruch/src/exercisecompare.cpp
+++ b/kbruch/src/exercisecompare.cpp
@@ -22,7 +22,7 @@
#include <kapplication.h>
#include <klocale.h>
-/* these includes are needed for Qt support */
+/* these includes are needed for TQt support */
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqpushbutton.h>
@@ -35,8 +35,8 @@
/* ----- public member functions ----- */
/* constructor */
-ExerciseCompare::ExerciseCompare(TQWidget * parent, const char * name):
- ExerciseBase(parent, name)
+ExerciseCompare::ExerciseCompare(TQWidget * tqparent, const char * name):
+ ExerciseBase(tqparent, name)
{
#ifdef DEBUG
kdDebug() << "constructor ExerciseCompare()" << endl;
@@ -123,13 +123,13 @@ ExerciseCompare::ExerciseCompare(TQWidget * parent, const char * name):
m_checkButton->setText(i18n("&Check Task"));
m_checkButton->setDefault(true); // is the default button of the dialog
TQToolTip::add(m_checkButton, i18n("Click on this button to check your result."));
- lowerHBox->addWidget(m_checkButton, 1, Qt::AlignRight);
+ lowerHBox->addWidget(m_checkButton, 1, TQt::AlignRight);
TQObject::connect(m_checkButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCheckButtonClicked()));
// that the user can start typing without moving the focus
m_signButton->setFocus();
- // show the whole layout
+ // show the whole tqlayout
baseWidget->show();
// add tooltip and qwhatsthis help to the widget
@@ -144,7 +144,7 @@ ExerciseCompare::~ExerciseCompare()
kdDebug() << "destructor ExerciseCompare()" << endl;
#endif
- /* no need to delete any child widgets, Qt does it by itself */
+ /* no need to delete any child widgets, TQt does it by itself */
}
/** resets the current state, creates a new task and count the last task as
@@ -300,10 +300,10 @@ void ExerciseCompare::slotCheckButtonClicked()
void ExerciseCompare::slotSignButtonClicked()
{
// in RTL desktops, we still need to allign the
- // execise to the left. On Qt4, you can set the direction
- // of the layout to LTR (instead of inherit), but on Qt3
+ // execise to the left. On TQt4, you can set the direction
+ // of the tqlayout to LTR (instead of inherit), but on TQt3
// the only way of fixing it is inserting the widgets in reversed
- // order to the layout.
+ // order to the tqlayout.
//
// But... as an ugly hack, we can also display the "other" operation
// thats damm ugly, but will work as well :)
diff --git a/kbruch/src/exercisecompare.h b/kbruch/src/exercisecompare.h
index 6ae8a4e5..bb944a8c 100644
--- a/kbruch/src/exercisecompare.h
+++ b/kbruch/src/exercisecompare.h
@@ -45,10 +45,11 @@ class TQVBoxLayout;
class ExerciseCompare : public ExerciseBase
{
Q_OBJECT
+ TQ_OBJECT
public:
/** constructor */
- ExerciseCompare(TQWidget * parent = 0, const char * name = 0);
+ ExerciseCompare(TQWidget * tqparent = 0, const char * name = 0);
/** destructor */
~ExerciseCompare();
diff --git a/kbruch/src/exerciseconvert.cpp b/kbruch/src/exerciseconvert.cpp
index 967c960d..6112db90 100644
--- a/kbruch/src/exerciseconvert.cpp
+++ b/kbruch/src/exerciseconvert.cpp
@@ -24,7 +24,7 @@
#include <kmessagebox.h>
#include <knumvalidator.h>
-/* these includes are needed for Qt support */
+/* these includes are needed for TQt support */
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqlineedit.h>
@@ -41,8 +41,8 @@
/* ----- public member functions ----- */
/* constructor */
-ExerciseConvert::ExerciseConvert(TQWidget * parent, const char * name):
- ExerciseBase(parent, name)
+ExerciseConvert::ExerciseConvert(TQWidget * tqparent, const char * name):
+ ExerciseBase(tqparent, name)
{
#ifdef DEBUG
kdDebug() << "constructor ExerciseConvert()" << endl;
@@ -119,10 +119,10 @@ ExerciseConvert::ExerciseConvert(TQWidget * parent, const char * name):
// --- that is the end of the horizontal line ---
// in RTL desktops, we still need to allign the
- // execise to the left. On Qt4, you can set the direction
- // of the layout to LTR (instead of inherit), but on Qt3
+ // execise to the left. On TQt4, you can set the direction
+ // of the tqlayout to LTR (instead of inherit), but on TQt3
// the only way of fixing it is inserting the widgets in reversed
- // order to the layout.
+ // order to the tqlayout.
//
// if you need help with this feel free to contact me - Diego <elcuco@kde.org> )
// This should fix parts of bug #116831
@@ -157,13 +157,13 @@ ExerciseConvert::ExerciseConvert(TQWidget * parent, const char * name):
m_checkButton->setText(i18n("&Check Task"));
m_checkButton->setDefault(true); // is the default button of the dialog
TQToolTip::add(m_checkButton, i18n("Click on this button to check your result. The button will not work if you have not entered a result yet."));
- lowerHBox->addWidget(m_checkButton, 1, Qt::AlignRight);
+ lowerHBox->addWidget(m_checkButton, 1, TQt::AlignRight);
TQObject::connect(m_checkButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCheckButtonClicked()));
// that the user can start typing without moving the focus
numer_edit->setFocus();
- // show the whole layout
+ // show the whole tqlayout
baseWidget->show();
// add tooltip and qwhatsthis help to the widget
@@ -178,7 +178,7 @@ ExerciseConvert::~ExerciseConvert()
kdDebug() << "destructor ExerciseConvert()" << endl;
#endif
- /* no need to delete any child widgets, Qt does it by itself */
+ /* no need to delete any child widgets, TQt does it by itself */
}
/** resets the current state, creates a new task and count the last task as
diff --git a/kbruch/src/exerciseconvert.h b/kbruch/src/exerciseconvert.h
index fcd733ec..9d7413cd 100644
--- a/kbruch/src/exerciseconvert.h
+++ b/kbruch/src/exerciseconvert.h
@@ -43,10 +43,11 @@ class TQVBoxLayout;
class ExerciseConvert : public ExerciseBase
{
Q_OBJECT
+ TQ_OBJECT
public:
/** constructor */
- ExerciseConvert(TQWidget * parent = 0, const char * name = 0);
+ ExerciseConvert(TQWidget * tqparent = 0, const char * name = 0);
/** destructor */
~ExerciseConvert();
diff --git a/kbruch/src/exercisefactorize.cpp b/kbruch/src/exercisefactorize.cpp
index 3a2d64dd..30c09de7 100644
--- a/kbruch/src/exercisefactorize.cpp
+++ b/kbruch/src/exercisefactorize.cpp
@@ -24,7 +24,7 @@
#include <kmessagebox.h>
#include <knumvalidator.h>
-/* these includes are needed for Qt support */
+/* these includes are needed for TQt support */
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqlineedit.h>
@@ -44,8 +44,8 @@
/* ----- public member functions ----- */
/* constructor */
-ExerciseFactorize::ExerciseFactorize(TQWidget * parent, const char * name):
- ExerciseBase(parent, name)
+ExerciseFactorize::ExerciseFactorize(TQWidget * tqparent, const char * name):
+ ExerciseBase(tqparent, name)
{
TQPalette pal;
TQColorGroup cg;
@@ -64,40 +64,40 @@ ExerciseFactorize::ExerciseFactorize(TQWidget * parent, const char * name):
Form1Layout = new TQVBoxLayout( this, 11, 6, "Form1Layout");
- layout9 = new TQVBoxLayout( 0, 0, 6, "layout9");
+ tqlayout9 = new TQVBoxLayout( 0, 0, 6, "tqlayout9");
// The following method fix the problem in
// bug #116831, reverse order in RTL desktops.
// Amit Ramon amit.ramon@kdemail.net
- layout4 = createFactorsLayout();
- layout9->addLayout(layout4);
+ tqlayout4 = createFactorsLayout();
+ tqlayout9->addLayout(tqlayout4);
spacer2 = new TQSpacerItem( 20, 21, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
- layout9->addItem( spacer2 );
+ tqlayout9->addItem( spacer2 );
- layout2 = new TQVBoxLayout( 0, 0, 6, "layout2");
+ tqlayout2 = new TQVBoxLayout( 0, 0, 6, "tqlayout2");
// The following method fix the problem in
// bug #116831, reverse order in RTL desktops.
// Amit Ramon amit.ramon@kdemail.net
- layout1 = createButtonsLayout();
- layout2->addLayout(layout1);
+ tqlayout1 = createButtonsLayout();
+ tqlayout2->addLayout(tqlayout1);
m_removeLastFactorButton = new TQPushButton( this, "m_removeLastFactorButton" );
- layout2->addWidget( m_removeLastFactorButton );
- layout9->addLayout( layout2 );
+ tqlayout2->addWidget( m_removeLastFactorButton );
+ tqlayout9->addLayout( tqlayout2 );
spacer4 = new TQSpacerItem( 20, 21, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
- layout9->addItem( spacer4 );
+ tqlayout9->addItem( spacer4 );
- layout7 = new TQHBoxLayout( 0, 0, 6, "layout7");
+ tqlayout7 = new TQHBoxLayout( 0, 0, 6, "tqlayout7");
spacer3 = new TQSpacerItem( 361, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
- layout7->addItem( spacer3 );
+ tqlayout7->addItem( spacer3 );
m_checkButton = new TQPushButton( this, "m_checkButton" );
- layout7->addWidget( m_checkButton );
- layout9->addLayout( layout7 );
- Form1Layout->addLayout( layout9 );
+ tqlayout7->addWidget( m_checkButton );
+ tqlayout9->addLayout( tqlayout7 );
+ Form1Layout->addLayout( tqlayout9 );
// the current task
TQString tmp_str;
@@ -181,7 +181,7 @@ ExerciseFactorize::~ExerciseFactorize()
kdDebug() << "destructor ExerciseFactorize()" << endl;
#endif
- /* no need to delete any child widgets, Qt does it by itself */
+ /* no need to delete any child widgets, TQt does it by itself */
}
/** resets the current state, creates a new task and count the last task as
@@ -228,16 +228,16 @@ void ExerciseFactorize::update()
//
// The following method was added to fix
-// bug #116831 (reverse layout in RTL desktops)
+// bug #116831 (reverse tqlayout in RTL desktops)
// Amit Ramon amit.ramon@kdemail.net
//
-/** Create the layout that hold the exercise widgets
+/** Create the tqlayout that hold the exercise widgets
*/
TQHBoxLayout* ExerciseFactorize::createFactorsLayout()
{
// first create all widgets
- TQHBoxLayout* layout = new TQHBoxLayout( 0, 0, 6, "layout4");
+ TQHBoxLayout* tqlayout = new TQHBoxLayout( 0, 0, 6, "tqlayout4");
m_taskLabel = new TQLabel( this, "m_taskLabel" );
@@ -258,46 +258,46 @@ TQHBoxLayout* ExerciseFactorize::createFactorsLayout()
spacer1 = new TQSpacerItem( 25, 20, TQSizePolicy::Expanding,
TQSizePolicy::Minimum );
- // now add the widgets to the layout.
+ // now add the widgets to the tqlayout.
// if we are in a RTL desktop, add them
// in a reverse order
if (TQApplication::reverseLayout())
{
- layout->addItem( spacer1 );
- layout->addWidget( result_label );
- layout->addWidget( m_factorsWidget );
- layout->addWidget( m_factorsEnteredEdit );
- layout->addWidget( m_equalSignLabel );
- layout->addWidget( m_taskLabel );
+ tqlayout->addItem( spacer1 );
+ tqlayout->addWidget( result_label );
+ tqlayout->addWidget( m_factorsWidget );
+ tqlayout->addWidget( m_factorsEnteredEdit );
+ tqlayout->addWidget( m_equalSignLabel );
+ tqlayout->addWidget( m_taskLabel );
}
else
{
- layout->addWidget( m_taskLabel );
- layout->addWidget( m_equalSignLabel );
- layout->addWidget( m_factorsEnteredEdit );
- layout->addWidget( m_factorsWidget );
- layout->addWidget( result_label );
- layout->addItem( spacer1 );
+ tqlayout->addWidget( m_taskLabel );
+ tqlayout->addWidget( m_equalSignLabel );
+ tqlayout->addWidget( m_factorsEnteredEdit );
+ tqlayout->addWidget( m_factorsWidget );
+ tqlayout->addWidget( result_label );
+ tqlayout->addItem( spacer1 );
}
- return layout;
+ return tqlayout;
}
//
// The following method was added to fix
-// bug #116831 (reverse layout in RTL desktops)
+// bug #116831 (reverse tqlayout in RTL desktops)
// Amit Ramon amit.ramon@kdemail.net
//
-/** Create the layout that hold the exercise widgets
+/** Create the tqlayout that hold the exercise widgets
*/
TQGridLayout* ExerciseFactorize::createButtonsLayout()
{
const int _COLS = 4; // number of buttons in each row
const int _ROWS = 2; // number of rows
- TQGridLayout* layout = new TQGridLayout( 0, 1, 1, 0, 6, "layout1");
+ TQGridLayout* tqlayout = new TQGridLayout( 0, 1, 1, 0, 6, "tqlayout1");
// first row buttons
m_factor2Button = new TQPushButton( this, "m_factor2Button" );
@@ -348,12 +348,12 @@ TQGridLayout* ExerciseFactorize::createButtonsLayout()
for (int col = 0; col < _COLS; col++)
{
- layout->addWidget(buttons[row][buttonIdx], row, col );
+ tqlayout->addWidget(buttons[row][buttonIdx], row, col );
buttonIdx += step;
}
}
- return layout;
+ return tqlayout;
}
diff --git a/kbruch/src/exercisefactorize.h b/kbruch/src/exercisefactorize.h
index 41a89066..0e36d016 100644
--- a/kbruch/src/exercisefactorize.h
+++ b/kbruch/src/exercisefactorize.h
@@ -60,10 +60,11 @@ const uint possibleTasks[numberPossibleTasks] = {4, 6, 8, 9, 10, 12, 14, 15, 16,
class ExerciseFactorize : public ExerciseBase
{
Q_OBJECT
+ TQ_OBJECT
public:
/** constructor */
- ExerciseFactorize(TQWidget * parent = 0, const char * name = 0);
+ ExerciseFactorize(TQWidget * tqparent = 0, const char * name = 0);
/** destructor */
~ExerciseFactorize();
@@ -115,14 +116,14 @@ private:
//
// the following two methods were added to fix
- // bug #116831 (reverse layout in RTL desktops)
+ // bug #116831 (reverse tqlayout in RTL desktops)
// Amit Ramon amit.ramon@kdemail.net
//
- /** create the factor widgets layout */
+ /** create the factor widgets tqlayout */
TQHBoxLayout* createFactorsLayout();
- /** create the (answer) buttons layout */
+ /** create the (answer) buttons tqlayout */
TQGridLayout* createButtonsLayout();
@@ -135,14 +136,14 @@ private:
protected:
TQVBoxLayout* Form1Layout;
- TQVBoxLayout* layout9;
+ TQVBoxLayout* tqlayout9;
TQSpacerItem* spacer4;
- TQHBoxLayout* layout4;
+ TQHBoxLayout* tqlayout4;
TQSpacerItem* spacer1;
TQSpacerItem* spacer2;
- TQVBoxLayout* layout2;
- TQGridLayout* layout1;
- TQHBoxLayout* layout7;
+ TQVBoxLayout* tqlayout2;
+ TQGridLayout* tqlayout1;
+ TQHBoxLayout* tqlayout7;
TQSpacerItem* spacer3;
private slots:
diff --git a/kbruch/src/factorizedwidget.cpp b/kbruch/src/factorizedwidget.cpp
index c6501d4e..4a106a0f 100644
--- a/kbruch/src/factorizedwidget.cpp
+++ b/kbruch/src/factorizedwidget.cpp
@@ -18,11 +18,11 @@
#include "factorizedwidget.h"
#include "factorizedwidget.moc"
-/* these includes are needed for Qt support */
+/* these includes are needed for TQt support */
#include <tqpainter.h>
-FactorizedWidget::FactorizedWidget(TQWidget * parent, const char * name, const uintList para_factors) :
- FractionBaseWidget(parent, name), m_factors(para_factors)
+FactorizedWidget::FactorizedWidget(TQWidget * tqparent, const char * name, const uintList para_factors) :
+ FractionBaseWidget(tqparent, name), m_factors(para_factors)
{
#ifdef DEBUG
kdDebug() << "constructor FactorizedWidget" << endl;
@@ -57,7 +57,7 @@ void FactorizedWidget::paintEvent(TQPaintEvent* /* p_paintEvent */)
paint.setFont(m_font);
// set the pen for painting
- TQPen pen(Qt::SolidLine);
+ TQPen pen(TQt::SolidLine);
pen.setWidth(0);
paint.setPen(pen);
diff --git a/kbruch/src/factorizedwidget.h b/kbruch/src/factorizedwidget.h
index 0ed79511..6c9f7bdf 100644
--- a/kbruch/src/factorizedwidget.h
+++ b/kbruch/src/factorizedwidget.h
@@ -35,10 +35,11 @@ typedef TQValueList<uint> uintList;
class FactorizedWidget : public FractionBaseWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
/** constructor */
- FactorizedWidget(TQWidget * parent, const char * name, const uintList para_factors);
+ FactorizedWidget(TQWidget * tqparent, const char * name, const uintList para_factors);
/** destructor */
~FactorizedWidget();
diff --git a/kbruch/src/fractionbasewidget.cpp b/kbruch/src/fractionbasewidget.cpp
index 07f60c84..0e1d4d0b 100644
--- a/kbruch/src/fractionbasewidget.cpp
+++ b/kbruch/src/fractionbasewidget.cpp
@@ -21,13 +21,13 @@
/* these includes are needed for KDE support */
#include <kglobalsettings.h>
-/* these includes are needed for Qt support */
+/* these includes are needed for TQt support */
#include <tqpainter.h>
#include "settingsclass.h"
-FractionBaseWidget::FractionBaseWidget(TQWidget * parent = 0, const char * name = 0) :
- TQWidget(parent, name)
+FractionBaseWidget::FractionBaseWidget(TQWidget * tqparent = 0, const char * name = 0) :
+ TQWidget(tqparent, name)
{
#ifdef DEBUG
kdDebug() << "constructor FractionBaseWidget" << endl;
@@ -68,14 +68,14 @@ void FractionBaseWidget::paintRatio(TQPainter & paint, ratio tmp_ratio, int & x_
// 5 5
int_numerator = tmp_ratio.numerator();
int_denominator = tmp_ratio.denominator();
- if (show_mixed == true && QABS(int_numerator) >= QABS(int_denominator))
+ if (show_mixed == true && TQABS(int_numerator) >= TQABS(int_denominator))
{
// calculate the mixed number
int_mixed = int(int_numerator / int_denominator);
// the negative sign is in front of the mixed number
- int_numerator = QABS(int_numerator);
- int_denominator = QABS(int_denominator);
+ int_numerator = TQABS(int_numerator);
+ int_denominator = TQABS(int_denominator);
// we have to reduce the numerator by the mixed number * denominator
int_numerator = int_numerator % int_denominator;
@@ -92,7 +92,7 @@ void FractionBaseWidget::paintRatio(TQPainter & paint, ratio tmp_ratio, int & x_
// don't show the ratio as mixed number
str_numerator.setNum(int_numerator);
str_denominator.setNum(int_denominator);
- } // if (show_mixed == true && QABS(int_numerator) > QABS(int_denominator))
+ } // if (show_mixed == true && TQABS(int_numerator) > TQABS(int_denominator))
// get the text width of the current ratio
fontWidth = fm.width(str_numerator);
@@ -161,7 +161,7 @@ void FractionBaseWidget::setColorAndFont()
/* set font */
m_font = SettingsClass::taskFont();
- // repaint
+ // tqrepaint
update();
return;
diff --git a/kbruch/src/fractionbasewidget.h b/kbruch/src/fractionbasewidget.h
index 21b2fdc8..942c2780 100644
--- a/kbruch/src/fractionbasewidget.h
+++ b/kbruch/src/fractionbasewidget.h
@@ -33,18 +33,19 @@
/*! base class for painting fractions
*
* \author Sebastian Stein */
-class FractionBaseWidget : public QWidget
+class FractionBaseWidget : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
/** constructor */
- FractionBaseWidget(TQWidget * parent, const char * name);
+ FractionBaseWidget(TQWidget * tqparent, const char * name);
/** destructor */
~FractionBaseWidget();
- /** updates the widget by first getting the settings and then repainting */
+ /** updates the widget by first getting the settings and then tqrepainting */
void updateAndRepaint();
protected:
diff --git a/kbruch/src/kbruch.cpp b/kbruch/src/kbruch.cpp
index df74101e..aaca2b02 100644
--- a/kbruch/src/kbruch.cpp
+++ b/kbruch/src/kbruch.cpp
@@ -23,7 +23,7 @@
#include <time.h>
#include <stdlib.h>
-/* these includes are needed for Qt support */
+/* these includes are needed for TQt support */
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <kaboutdata.h>
@@ -48,10 +48,10 @@ int main(int argc, char * argv[])
KApplication kbruch;
- MainQtWidget * kbruchApp = new MainQtWidget();
+ MainTQtWidget * kbruchApp = new MainTQtWidget();
kbruch.setMainWidget(kbruchApp);
kbruchApp->show();
- /* lets execute the Qt GUI; it will handle all cmd options which are left */
+ /* lets execute the TQt GUI; it will handle all cmd options which are left */
return kbruch.exec();
}
diff --git a/kbruch/src/kbruch.h b/kbruch/src/kbruch.h
index e0f5ca0e..a79dccb5 100644
--- a/kbruch/src/kbruch.h
+++ b/kbruch/src/kbruch.h
@@ -31,7 +31,7 @@
static const char description[] =
I18N_NOOP("KBruch");
-class MainQtWidget;
+class MainTQtWidget;
class task;
class ratio;
class primzahl;
diff --git a/kbruch/src/mainqtwidget.cpp b/kbruch/src/mainqtwidget.cpp
index 3ac59d46..7212f56a 100644
--- a/kbruch/src/mainqtwidget.cpp
+++ b/kbruch/src/mainqtwidget.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- mainqtwidget.cpp - The main Qt/KDE window
+ mainqtwidget.cpp - The main TQt/KDE window
-------------------
begin : Tue Mar 16 00:00:00 CET 2003
copyright : (C) 2003-2004 by Sebastian Stein
@@ -46,10 +46,10 @@
/* ------ public member functions ------ */
-MainQtWidget::MainQtWidget()
+MainTQtWidget::MainTQtWidget()
{
#ifdef DEBUG
- kdDebug() << "constructor MainQtWidget" << endl;
+ kdDebug() << "constructor MainTQtWidget" << endl;
#endif
// get the settings
@@ -62,7 +62,7 @@ MainQtWidget::MainQtWidget()
// we split the main view into 2 parts, one for the tasks, one for the
// statistics
- TQSplitter* splitter = new TQSplitter(TQSplitter::Horizontal, this,"TQSplitter");
+ TQSplitter* splitter = new TQSplitter(Qt::Horizontal, this,TQSPLITTER_OBJECT_NAME_STRING);
setCentralWidget(splitter);
// the iconlist, where the user can choose the different exercises
@@ -109,21 +109,21 @@ MainQtWidget::MainQtWidget()
#if (KDE_VERSION_MINOR>=3) && (KDE_VERSION_MAJOR>=3)
#else
- resize(TQSize(QMAX(toolBar()->sizeHint().width(), sizeHint().width()), sizeHint().height()));
+ resize(TQSize(TQMAX(toolBar()->tqsizeHint().width(), tqsizeHint().width()), tqsizeHint().height()));
#endif
// now show the last exercise
m_exercises->showPage(SettingsClass::activeExercise());
slotAboutToShowPage(m_exercises->pageWidget(m_exercises->activePageIndex()));
}
-MainQtWidget::~MainQtWidget()
+MainTQtWidget::~MainTQtWidget()
{
}
/* ------ private member functions ------ */
-void MainQtWidget::readOptions()
+void MainTQtWidget::readOptions()
{
m_addSub = SettingsClass::addsub();
m_mulDiv = SettingsClass::muldiv();
@@ -138,7 +138,7 @@ void MainQtWidget::readOptions()
}
}
-void MainQtWidget::writeOptions()
+void MainTQtWidget::writeOptions()
{
SettingsClass::setActiveExercise(m_exercises->activePageIndex());
@@ -151,23 +151,23 @@ void MainQtWidget::writeOptions()
SettingsClass::writeConfig();
}
-void MainQtWidget::setupActions()
+void MainTQtWidget::setupActions()
{
// new task action
m_NewTaskAction = new KAction(i18n("&New"), "filenew", KStdAccel::shortcut(KStdAccel::New),
- this, TQT_SLOT(NewTask()),
+ TQT_TQOBJECT(this), TQT_SLOT(NewTask()),
actionCollection(), "NewTask");
// quit action
- KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection());
+ KStdAction::quit(TQT_TQOBJECT(kapp), TQT_SLOT(quit()), actionCollection());
//
- KStdAction::preferences(this, TQT_SLOT( slotPrefs() ), actionCollection());
+ KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT( slotPrefs() ), actionCollection());
// a label just describing the Number of terms ComboBox
m_NrOfTermsLabel = new TQLabel(i18n("Terms:"), 0, "kde toolbar widget");
m_NrOfTermsLabelAction = new KWidgetAction(m_NrOfTermsLabel, i18n("Terms:"), ALT+Key_E,
- this, TQT_SLOT(NrOfTermsBoxSlot()),
+ TQT_TQOBJECT(this), TQT_SLOT(NrOfTermsBoxSlot()),
actionCollection(), "NrOfTermsLabelAction");
// the ComboBox holding possible values for term number
@@ -179,15 +179,15 @@ void MainQtWidget::setupActions()
m_NrOfTermsBox->setCurrentItem(m_nrRatios - 2);
TQToolTip::add( m_NrOfTermsBox, i18n( "The number of terms you want" ) );
TQWhatsThis::add( m_NrOfTermsBox, i18n( "Choose the number of terms (2, 3, 4 or 5) you want for calculating fractions." ) );
- m_NrOfTermsBoxAction = new KWidgetAction(m_NrOfTermsBox, i18n("Number of Terms"), ALT+Key_E, this, TQT_SLOT(NrOfTermsBoxSlot()), actionCollection(), "NrOfTermsBoxAction");
+ m_NrOfTermsBoxAction = new KWidgetAction(m_NrOfTermsBox, i18n("Number of Terms"), ALT+Key_E, TQT_TQOBJECT(this), TQT_SLOT(NrOfTermsBoxSlot()), actionCollection(), "NrOfTermsBoxAction");
// now connect the ComboBox's signal textChanged() to the slot function
- TQObject::connect(m_NrOfTermsBox, TQT_SIGNAL(activated(int)), this, TQT_SLOT(NrOfTermsBoxSlot()));
+ TQObject::connect(m_NrOfTermsBox, TQT_SIGNAL(activated(int)), TQT_TQOBJECT(this), TQT_SLOT(NrOfTermsBoxSlot()));
// a label just describing the max. main denominator ComboBox
m_MaxMainDenominatorLabel = new TQLabel(i18n("Max. main denominator:"), 0, "kde toolbar widget");
m_MaxMainDenominatorLabelAction = new KWidgetAction(m_MaxMainDenominatorLabel, i18n("Max. main denominator:"), ALT+Key_D,
- this, TQT_SLOT(MaxMainDenominatorBoxSlot()),
+ TQT_TQOBJECT(this), TQT_SLOT(MaxMainDenominatorBoxSlot()),
actionCollection(), "MaxMainDenominatorLabelAction");
// the ComboBox holding possible values for the max. main denominator
@@ -209,7 +209,7 @@ void MainQtWidget::setupActions()
case 50 : m_MaxMainDenominatorBox->setCurrentItem(3);
break;
}
- m_MaxMainDenominatorBoxAction = new KWidgetAction(m_MaxMainDenominatorBox, i18n("Maximal Main Denominator"), ALT+Key_D, this, TQT_SLOT(MaxMainDenominatorBoxSlot()), actionCollection(), "MaxMainDenominatorBoxAction");
+ m_MaxMainDenominatorBoxAction = new KWidgetAction(m_MaxMainDenominatorBox, i18n("Maximal Main Denominator"), ALT+Key_D, TQT_TQOBJECT(this), TQT_SLOT(MaxMainDenominatorBoxSlot()), actionCollection(), "MaxMainDenominatorBoxAction");
// now connect the ComboBox's signal textChanged() to the slot function
TQObject::connect(m_MaxMainDenominatorBox, TQT_SIGNAL(activated(int)),
@@ -218,7 +218,7 @@ void MainQtWidget::setupActions()
// a label just describing the operation ComboBox
m_OperationLabel = new TQLabel(i18n("Operations:"), 0, "kde toolbar widget");
m_OperationLabelAction = new KWidgetAction(m_OperationLabel, i18n("Operations:"), ALT+Key_O,
- this, TQT_SLOT(OperationBoxSlot()),
+ TQT_TQOBJECT(this), TQT_SLOT(OperationBoxSlot()),
actionCollection(), "OperationLabelAction");
// the ComboBox holding possible combinations for operations
@@ -236,14 +236,14 @@ void MainQtWidget::setupActions()
}
TQToolTip::add( m_OperationBox, i18n( "The operations you want" ) );
TQWhatsThis::add( m_OperationBox, i18n( "Choose the type of operations you want for calculating fractions: Addition/Substraction, Multiplication/Division or All Operations Mixed. If you choose All Operations Mixed, the program will randomly choose addition, substraction, multiplication and/or division." ) );
- m_OperationBoxAction = new KWidgetAction(m_OperationBox, i18n("Operations:"), ALT+Key_O, this, TQT_SLOT(OperationBoxSlot()), actionCollection(), "OperationBoxAction");
+ m_OperationBoxAction = new KWidgetAction(m_OperationBox, i18n("Operations:"), ALT+Key_O, TQT_TQOBJECT(this), TQT_SLOT(OperationBoxSlot()), actionCollection(), "OperationBoxAction");
// now connect the ComboBox's signal textChanged() to the slot function
TQObject::connect(m_OperationBox, TQT_SIGNAL(activated(int)), this, TQT_SLOT(OperationBoxSlot()));
#if (KDE_VERSION_MINOR>=3) && (KDE_VERSION_MAJOR>=3)
if (!initialGeometrySet())
- resize( TQSize(725, 330).expandedTo(minimumSizeHint()));
+ resize( TQSize(725, 330).expandedTo(tqminimumSizeHint()));
setupGUI(ToolBar | Keys | StatusBar | Create);
setAutoSaveSettings();
#endif
@@ -252,10 +252,10 @@ void MainQtWidget::setupActions()
/* ------ private slots ------ */
-void MainQtWidget::NewTask()
+void MainTQtWidget::NewTask()
{
#ifdef DEBUG
- kdDebug() << "NewTask MainQtWidget" << endl;
+ kdDebug() << "NewTask MainTQtWidget" << endl;
kdDebug() << "pageIndex(m_taskview): " << m_exercises->pageIndex(m_taskview) << endl;
kdDebug() << "pageIndex(m_exerciseCompare): " << m_exercises->pageIndex(m_exerciseCompare) << endl;
kdDebug() << "pageIndex(m_exerciseConvert): " << m_exercises->pageIndex(m_exerciseConvert) << endl;
@@ -307,10 +307,10 @@ void MainQtWidget::NewTask()
return;
}
-void MainQtWidget::NrOfTermsBoxSlot()
+void MainTQtWidget::NrOfTermsBoxSlot()
{
#ifdef DEBUG
- kdDebug() << "MainQtWidget::NrOfTermsBoxSlot()" << endl;
+ kdDebug() << "MainTQtWidget::NrOfTermsBoxSlot()" << endl;
#endif
TQString curr_nr = m_NrOfTermsBox->currentText();
m_MaxMainDenominatorBox->clear();
@@ -363,10 +363,10 @@ void MainQtWidget::NrOfTermsBoxSlot()
(void) m_taskview->setTaskParameters(m_addSub, m_mulDiv, m_nrRatios, m_maxMainDenominator);
}
-void MainQtWidget::MaxMainDenominatorBoxSlot()
+void MainTQtWidget::MaxMainDenominatorBoxSlot()
{
#ifdef DEBUG
- kdDebug() << "MainQtWidget::MaxMainDenominatorBoxSlot()" << endl;
+ kdDebug() << "MainTQtWidget::MaxMainDenominatorBoxSlot()" << endl;
#endif
// get the max. size from the ComboBox, convert it to a number and store
@@ -378,10 +378,10 @@ void MainQtWidget::MaxMainDenominatorBoxSlot()
(void) m_taskview->setTaskParameters(m_addSub, m_mulDiv, m_nrRatios, m_maxMainDenominator);
}
-void MainQtWidget::OperationBoxSlot()
+void MainTQtWidget::OperationBoxSlot()
{
#ifdef DEBUG
- kdDebug() << "MainQtWidget::OperationBoxSlot()" << endl;
+ kdDebug() << "MainTQtWidget::OperationBoxSlot()" << endl;
#endif
int index = m_OperationBox->currentItem(); // get selected item
@@ -413,7 +413,7 @@ void MainQtWidget::OperationBoxSlot()
(void) m_taskview->setTaskParameters(m_addSub, m_mulDiv, m_nrRatios, m_maxMainDenominator);
}
-void MainQtWidget::slotPrefs()
+void MainTQtWidget::slotPrefs()
{
// do not show dialog twice
if (KConfigDialog::showDialog("settings"))
@@ -444,7 +444,7 @@ void MainQtWidget::slotPrefs()
return;
}
-void MainQtWidget::slotApplySettings()
+void MainTQtWidget::slotApplySettings()
{
// update the task view
m_taskview->update();
@@ -455,10 +455,10 @@ void MainQtWidget::slotApplySettings()
return;
}
-void MainQtWidget::slotAboutToShowPage(TQWidget * page)
+void MainTQtWidget::slotAboutToShowPage(TQWidget * page)
{
#ifdef DEBUG
- kdDebug() << "slotAboutToShowPage MainQtWidget" << endl;
+ kdDebug() << "slotAboutToShowPage MainTQtWidget" << endl;
kdDebug() << "pageIndex(m_taskview): " << m_exercises->pageIndex(m_taskview) << endl;
kdDebug() << "pageIndex(m_exerciseCompare): " << m_exercises->pageIndex(m_exerciseCompare) << endl;
kdDebug() << "pageIndex(m_exerciseConvert): " << m_exercises->pageIndex(m_exerciseConvert) << endl;
@@ -480,7 +480,7 @@ void MainQtWidget::slotAboutToShowPage(TQWidget * page)
return;
}
-bool MainQtWidget::queryExit()
+bool MainTQtWidget::queryExit()
{
writeOptions();
return true;
diff --git a/kbruch/src/mainqtwidget.h b/kbruch/src/mainqtwidget.h
index 2ecb96f4..989a998e 100644
--- a/kbruch/src/mainqtwidget.h
+++ b/kbruch/src/mainqtwidget.h
@@ -1,5 +1,5 @@
/***************************************************************************
- mainqtwidget.h - The main Qt/KDE window
+ mainqtwidget.h - The main TQt/KDE window
-------------------
begin : Tue Mar 16 00:00:00 CET 2003
copyright : (C) 2003-2004 by Sebastian Stein
@@ -14,8 +14,8 @@
* (at your option) any later version. *
* *
***************************************************************************/
-#ifndef MAINQTWIDGET_H
-#define MAINQTWIDGET_H
+#ifndef MAINTQTWIDGET_H
+#define MAINTQTWIDGET_H
#include <kmainwindow.h>
@@ -37,16 +37,17 @@ class TaskView;
* \author Sebastian Stein
* \author Eva Brucherseifer
**/
-class MainQtWidget : public KMainWindow
+class MainTQtWidget : public KMainWindow
{
Q_OBJECT
+ TQ_OBJECT
public:
/** constructor */
- MainQtWidget();
+ MainTQtWidget();
/** destructor */
- ~MainQtWidget();
+ ~MainTQtWidget();
private:
/** read the config file */
@@ -142,4 +143,4 @@ class MainQtWidget : public KMainWindow
bool queryExit();
};
-#endif // MainQtWidget
+#endif // MainTQtWidget
diff --git a/kbruch/src/ratio.cpp b/kbruch/src/ratio.cpp
index e3a79a36..0ba1e1c4 100644
--- a/kbruch/src/ratio.cpp
+++ b/kbruch/src/ratio.cpp
@@ -192,9 +192,9 @@ bool ratio::operator==(ratio right)
signed short orig_sign = 1, right_sign = 1;
/* we do not check the presign at this point */
- if (QABS(m_numerator) != QABS(right.numerator()))
+ if (TQABS(m_numerator) != TQABS(right.numerator()))
return false;
- if (QABS(m_denominator) != QABS(right.denominator()))
+ if (TQABS(m_denominator) != TQABS(right.denominator()))
return false;
/* check if the signs of the ratios are equivalent */
diff --git a/kbruch/src/rationalwidget.cpp b/kbruch/src/rationalwidget.cpp
index f930d882..d0d0d546 100644
--- a/kbruch/src/rationalwidget.cpp
+++ b/kbruch/src/rationalwidget.cpp
@@ -18,12 +18,12 @@
#include "rationalwidget.h"
#include "rationalwidget.moc"
-/* these includes are needed for Qt support */
+/* these includes are needed for TQt support */
#include <tqpainter.h>
#include <tqstring.h>
-RationalWidget::RationalWidget(TQWidget * parent, const char * name, const TQString pnumber, const uint pperiodStart, const uint pperiodLength):
- FractionBaseWidget(parent, name), m_number(pnumber),
+RationalWidget::RationalWidget(TQWidget * tqparent, const char * name, const TQString pnumber, const uint pperiodStart, const uint pperiodLength):
+ FractionBaseWidget(tqparent, name), m_number(pnumber),
m_periodStart(pperiodStart), m_periodLength(pperiodLength)
{
#ifdef DEBUG
@@ -64,7 +64,7 @@ void RationalWidget::paintEvent(TQPaintEvent* /* p_paintEvent */)
paint.setFont(m_font);
// set the pen for painting
- TQPen pen(Qt::SolidLine);
+ TQPen pen(TQt::SolidLine);
pen.setWidth(0);
paint.setPen(pen);
diff --git a/kbruch/src/rationalwidget.h b/kbruch/src/rationalwidget.h
index f03598ba..cccae714 100644
--- a/kbruch/src/rationalwidget.h
+++ b/kbruch/src/rationalwidget.h
@@ -34,10 +34,11 @@ class TQString;
class RationalWidget : public FractionBaseWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
/** constructor */
- RationalWidget(TQWidget * parent, const char * name, const TQString pnumber, const uint pperiodStart = 1, const uint pperiodLength = 0);
+ RationalWidget(TQWidget * tqparent, const char * name, const TQString pnumber, const uint pperiodStart = 1, const uint pperiodLength = 0);
/** destructor */
~RationalWidget();
diff --git a/kbruch/src/ratiowidget.cpp b/kbruch/src/ratiowidget.cpp
index 17f1cf04..ae92f09c 100644
--- a/kbruch/src/ratiowidget.cpp
+++ b/kbruch/src/ratiowidget.cpp
@@ -18,12 +18,12 @@
#include "ratiowidget.h"
#include "ratiowidget.moc"
-/* these includes are needed for Qt support */
+/* these includes are needed for TQt support */
#include <tqpainter.h>
-RatioWidget::RatioWidget(TQWidget * parent = 0, const char * name = 0,
+RatioWidget::RatioWidget(TQWidget * tqparent = 0, const char * name = 0,
const ratio para_ratio = *new ratio()) :
- FractionBaseWidget(parent, name), m_ratio(para_ratio)
+ FractionBaseWidget(tqparent, name), m_ratio(para_ratio)
{
#ifdef DEBUG
kdDebug() << "constructor RatioWidget" << endl;
@@ -56,7 +56,7 @@ void RatioWidget::paintEvent(TQPaintEvent* /* p_paintEvent */)
paint.setFont(m_font);
// set the pen for painting
- TQPen pen(Qt::SolidLine);
+ TQPen pen(TQt::SolidLine);
pen.setWidth(0);
paint.setPen(pen);
diff --git a/kbruch/src/ratiowidget.h b/kbruch/src/ratiowidget.h
index 8a64d3d4..c861741d 100644
--- a/kbruch/src/ratiowidget.h
+++ b/kbruch/src/ratiowidget.h
@@ -33,10 +33,11 @@
class RatioWidget : public FractionBaseWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
/** constructor */
- RatioWidget(TQWidget * parent, const char * name, const ratio para_ratio);
+ RatioWidget(TQWidget * tqparent, const char * name, const ratio para_ratio);
/** destructor */
~RatioWidget();
diff --git a/kbruch/src/resultwidget.cpp b/kbruch/src/resultwidget.cpp
index 7f493408..853e73da 100644
--- a/kbruch/src/resultwidget.cpp
+++ b/kbruch/src/resultwidget.cpp
@@ -18,14 +18,14 @@
#include "resultwidget.h"
#include "resultwidget.moc"
-/* these includes are needed for Qt support */
+/* these includes are needed for TQt support */
#include <tqpainter.h>
#include "settingsclass.h"
-ResultWidget::ResultWidget(TQWidget * parent = 0, const char * name = 0,
+ResultWidget::ResultWidget(TQWidget * tqparent = 0, const char * name = 0,
const ratio para_result = *new ratio()) :
- FractionBaseWidget(parent, name), m_result(para_result)
+ FractionBaseWidget(tqparent, name), m_result(para_result)
{
#ifdef DEBUG
kdDebug() << "constructor ResultWidget" << endl;
@@ -58,7 +58,7 @@ void ResultWidget::paintEvent(TQPaintEvent* /* p_paintEvent */)
paint.setFont(m_font);
// set the pen for painting
- TQPen pen(Qt::SolidLine);
+ TQPen pen(TQt::SolidLine);
pen.setWidth(0);
paint.setPen(pen);
@@ -73,7 +73,7 @@ void ResultWidget::paintEvent(TQPaintEvent* /* p_paintEvent */)
paintMiddle(paint, TQString("="), old_x, fm, m_colorOperation);
paintRatio(paint, m_result, old_x, fm, false);
- if (SettingsClass::showSpecialRatioNotation() == true && QABS(m_result.numerator()) >= QABS(m_result.denominator()))
+ if (SettingsClass::showSpecialRatioNotation() == true && TQABS(m_result.numerator()) >= TQABS(m_result.denominator()))
{
// result as mixed number
paintMiddle(paint, TQString("="), old_x, fm, m_colorOperation);
diff --git a/kbruch/src/resultwidget.h b/kbruch/src/resultwidget.h
index b42c3776..c742d1be 100644
--- a/kbruch/src/resultwidget.h
+++ b/kbruch/src/resultwidget.h
@@ -33,10 +33,11 @@
class ResultWidget : public FractionBaseWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
/** constructor */
- ResultWidget(TQWidget * parent, const char * name, const ratio para_result);
+ ResultWidget(TQWidget * tqparent, const char * name, const ratio para_result);
/** destructor */
~ResultWidget();
diff --git a/kbruch/src/statisticsview.cpp b/kbruch/src/statisticsview.cpp
index d6b8ff37..b3fee887 100644
--- a/kbruch/src/statisticsview.cpp
+++ b/kbruch/src/statisticsview.cpp
@@ -18,7 +18,7 @@
#include "statisticsview.h"
#include "statisticsview.moc"
-/* the includes are needed for Qt support */
+/* the includes are needed for TQt support */
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqpushbutton.h>
@@ -31,8 +31,8 @@
#include "settingsclass.h"
/* constructor */
-StatisticsView::StatisticsView(TQWidget * parent, const char * name):
- TQWidget(parent, name), m_count(0), m_correct(0)
+StatisticsView::StatisticsView(TQWidget * tqparent, const char * name):
+ TQWidget(tqparent, name), m_count(0), m_correct(0)
{
#ifdef DEBUG
kdDebug() << "constructor StatisticsView()" << endl;
@@ -48,17 +48,17 @@ StatisticsView::StatisticsView(TQWidget * parent, const char * name):
/* set the caption of the window */
// setCaption(i18n("Statistics"));
- /* add a layout as a base */
- layout1 = new TQVBoxLayout(this);
- layout1->setSpacing(6);
- layout1->setMargin(6);
+ /* add a tqlayout as a base */
+ tqlayout1 = new TQVBoxLayout(this);
+ tqlayout1->setSpacing(6);
+ tqlayout1->setMargin(6);
/* now add a v-spacer */
TQSpacerItem * v_spacer = new TQSpacerItem(1, 1);
- layout1->addItem(v_spacer);
+ tqlayout1->addItem(v_spacer);
/* create a grid to show the labels */
- labelGrid = new TQGridLayout(layout1, 3, 2);
+ labelGrid = new TQGridLayout(tqlayout1, 3, 2);
/* add 6 labels to the grid */
info1Label = new TQLabel(this);
@@ -112,10 +112,10 @@ StatisticsView::StatisticsView(TQWidget * parent, const char * name):
/* now add a v-spacer */
v_spacer = new TQSpacerItem(1, 1);
- layout1->addItem(v_spacer);
+ tqlayout1->addItem(v_spacer);
/* the Reset button */
- buttonLayout = new TQHBoxLayout(layout1);
+ buttonLayout = new TQHBoxLayout(tqlayout1);
resetBtn = new TQPushButton(i18n("&Reset"), this);
TQObject::connect(resetBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(resetStatistics()));
buttonLayout->addWidget(resetBtn);
@@ -142,7 +142,7 @@ StatisticsView::~StatisticsView()
SettingsClass::setCorrect(m_correct);
SettingsClass::writeConfig();
- /* no need to delete any child widgets, Qt does it by itself */
+ /* no need to delete any child widgets, TQt does it by itself */
}
/* called, if a task solved correctly */
@@ -150,14 +150,14 @@ void StatisticsView::addCorrect()
{
++m_count;
++m_correct;
- (void) calc(); /* repaint the statistics */
+ (void) calc(); /* tqrepaint the statistics */
}
/* called, if a task was solved wrong */
void StatisticsView::addWrong()
{
++m_count;
- (void) calc(); /* repaint the statistics */
+ (void) calc(); /* tqrepaint the statistics */
}
@@ -169,7 +169,7 @@ void StatisticsView::calc()
TQString new_text;
TQString number;
- new_text = TQString("<b>%1</b>").arg(m_count);
+ new_text = TQString("<b>%1</b>").tqarg(m_count);
result1Label->setText(new_text);
/* we have to be careful with division by 0 */
@@ -179,11 +179,11 @@ void StatisticsView::calc()
result3Label->setText("- (- %)");
} else {
/* set the correct label */
- new_text = TQString("%1 (%2 %)").arg(m_correct).arg(int(double(m_correct) / m_count * 100));
+ new_text = TQString("%1 (%2 %)").tqarg(m_correct).tqarg(int(double(m_correct) / m_count * 100));
result2Label->setText(new_text);
/* set the incorrect label */
- new_text = TQString("%1 (%2 %)").arg(m_count - m_correct).arg(int(double(m_count - m_correct) / m_count * 100));
+ new_text = TQString("%1 (%2 %)").tqarg(m_count - m_correct).tqarg(int(double(m_count - m_correct) / m_count * 100));
result3Label->setText(new_text);
}
}
diff --git a/kbruch/src/statisticsview.h b/kbruch/src/statisticsview.h
index b7948761..60ea147c 100644
--- a/kbruch/src/statisticsview.h
+++ b/kbruch/src/statisticsview.h
@@ -34,13 +34,14 @@ class TQGridLayout;
* \author Eva Brucherseifer
*/
-class StatisticsView : public QWidget
+class StatisticsView : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
/** constructor */
- StatisticsView(TQWidget * parent = 0, const char * name = 0);
+ StatisticsView(TQWidget * tqparent = 0, const char * name = 0);
/** destructor */
~StatisticsView();
@@ -65,7 +66,7 @@ private:
TQPushButton * resetBtn;
TQHBoxLayout * buttonLayout;
- TQVBoxLayout * layout1;
+ TQVBoxLayout * tqlayout1;
TQGridLayout * labelGrid;
TQLabel * result1Label;
TQLabel * result2Label;
diff --git a/kbruch/src/taskview.cpp b/kbruch/src/taskview.cpp
index a15520a8..6318c7bf 100644
--- a/kbruch/src/taskview.cpp
+++ b/kbruch/src/taskview.cpp
@@ -24,7 +24,7 @@
#include <kapplication.h>
#include <knumvalidator.h>
-/* these includes are needed for Qt support */
+/* these includes are needed for TQt support */
#include <tqlabel.h>
#include <tqlayout.h>
#include <tqlineedit.h>
@@ -38,9 +38,9 @@
/* ----- public member functions ----- */
/* constructor */
-TaskView::TaskView(TQWidget * parent, const char * name, bool padd_sub,
+TaskView::TaskView(TQWidget * tqparent, const char * name, bool padd_sub,
bool pmul_div, unsigned int pnr_ratios, unsigned int pmax_md):
- ExerciseBase(parent, name), add_sub(padd_sub), mul_div(pmul_div),
+ ExerciseBase(tqparent, name), add_sub(padd_sub), mul_div(pmul_div),
nr_ratios(pnr_ratios), max_md(pmax_md)
{
#ifdef DEBUG
@@ -113,10 +113,10 @@ TaskView::TaskView(TQWidget * parent, const char * name, bool padd_sub,
// --- that is the end of the horizontal line ---
// in RTL desktops, we still need to allign the
- // execise to the left. On Qt4, you can set the direction
- // of the layout to LTR (instead of inherit), but on Qt3
+ // execise to the left. On TQt4, you can set the direction
+ // of the tqlayout to LTR (instead of inherit), but on TQt3
// the only way of fixing it is inserting the widgets in reversed
- // order to the layout.
+ // order to the tqlayout.
//
// if you need help with this feel free to contact me - Diego <elcuco@kde.org> )
// This should fix parts of bug #116831
@@ -152,16 +152,16 @@ TaskView::TaskView(TQWidget * parent, const char * name, bool padd_sub,
m_checkButton->setText(i18n("&Check Task"));
m_checkButton->setDefault(true); // is the default button of the dialog
TQToolTip::add(m_checkButton, i18n("Click on this button to check your result. The button will not work if you have not entered a result yet."));
- lowerHBox->addWidget(m_checkButton, 1, Qt::AlignRight);
+ lowerHBox->addWidget(m_checkButton, 1, TQt::AlignRight);
TQObject::connect(m_checkButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCheckButtonClicked()));
// that the user can start typing without moving the focus
numer_edit->setFocus();
- // show the whole layout
+ // show the whole tqlayout
baseWidget->show();
- // show the whole layout
+ // show the whole tqlayout
m_taskWidget->show();
m_resultWidget->hide();
@@ -177,7 +177,7 @@ TaskView::~TaskView()
kdDebug() << "destructor TaskView()" << endl;
#endif
- /* no need to delete any child widgets, Qt does it by itself */
+ /* no need to delete any child widgets, TQt does it by itself */
}
/** the parameters of task generation can be set with this function */
diff --git a/kbruch/src/taskview.h b/kbruch/src/taskview.h
index 961adce2..91e650b2 100644
--- a/kbruch/src/taskview.h
+++ b/kbruch/src/taskview.h
@@ -51,10 +51,11 @@ class TQFrame;
class TaskView : public ExerciseBase
{
Q_OBJECT
+ TQ_OBJECT
public:
/** constructor */
- TaskView(TQWidget * parent = 0, const char * name = 0,
+ TaskView(TQWidget * tqparent = 0, const char * name = 0,
bool padd_sub = true, bool pmul_div = false,
unsigned int pnr_ratios = 2, unsigned int pmax_md = 10);
diff --git a/kbruch/src/taskvieweroptionsbase.ui b/kbruch/src/taskvieweroptionsbase.ui
index 97cba6ed..92775120 100644
--- a/kbruch/src/taskvieweroptionsbase.ui
+++ b/kbruch/src/taskvieweroptionsbase.ui
@@ -1,10 +1,10 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>TaskViewerOptionsBase</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>TaskViewerOptionsBase</cstring>
</property>
- <property name="geometry">
+ <property name="tqgeometry">
<rect>
<x>0</x>
<y>0</y>
@@ -16,9 +16,9 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLayoutWidget" row="0" column="0">
+ <widget class="TQLayoutWidget" row="0" column="0">
<property name="name">
- <cstring>layout2</cstring>
+ <cstring>tqlayout2</cstring>
</property>
<vbox>
<property name="name">
@@ -40,9 +40,9 @@
<string>Change the font of the numbers</string>
</property>
</widget>
- <widget class="QGroupBox">
+ <widget class="TQGroupBox">
<property name="name">
- <cstring>colorGroupBox</cstring>
+ <cstring>tqcolorGroupBox</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
@@ -55,11 +55,11 @@
<property name="title">
<string>Colors</string>
</property>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout7</cstring>
+ <cstring>tqlayout7</cstring>
</property>
- <property name="geometry">
+ <property name="tqgeometry">
<rect>
<x>10</x>
<y>20</y>
@@ -115,7 +115,7 @@
<string>Change the color of the fraction bar</string>
</property>
</widget>
- <widget class="QLabel" row="2" column="0">
+ <widget class="TQLabel" row="2" column="0">
<property name="name">
<cstring>fractionBarLabel</cstring>
</property>
@@ -131,7 +131,7 @@
<string>Fraction bar:</string>
</property>
</widget>
- <widget class="QLabel" row="1" column="0">
+ <widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>operationLabel</cstring>
</property>
@@ -165,7 +165,7 @@
<string>Change the color of the numbers</string>
</property>
</widget>
- <widget class="QLabel" row="0" column="0">
+ <widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>numberLabel</cstring>
</property>
@@ -184,7 +184,7 @@
</grid>
</widget>
</widget>
- <widget class="QGroupBox">
+ <widget class="TQGroupBox">
<property name="name">
<cstring>groupBox2</cstring>
</property>
@@ -195,7 +195,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QCheckBox" row="0" column="0">
+ <widget class="TQCheckBox" row="0" column="0">
<property name="name">
<cstring>kcfg_showSpecialRatioNotation</cstring>
</property>
@@ -214,7 +214,7 @@
</widget>
<customwidgets>
</customwidgets>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>kfontdialog.h</includehint>
<includehint>kcolorbutton.h</includehint>
diff --git a/kbruch/src/taskwidget.cpp b/kbruch/src/taskwidget.cpp
index 1807283e..795bc4cb 100644
--- a/kbruch/src/taskwidget.cpp
+++ b/kbruch/src/taskwidget.cpp
@@ -21,12 +21,12 @@
/* these includes are needed for KDE support */
#include <klocale.h>
-/* these includes are needed for Qt support */
+/* these includes are needed for TQt support */
#include <tqpainter.h>
-TaskWidget::TaskWidget(TQWidget * parent = 0, const char * name = 0,
+TaskWidget::TaskWidget(TQWidget * tqparent = 0, const char * name = 0,
const task para_task = *new task()) :
- FractionBaseWidget(parent, name), m_task(para_task)
+ FractionBaseWidget(tqparent, name), m_task(para_task)
{
#ifdef DEBUG
kdDebug() << "constructor TaskWidget" << endl;
@@ -65,7 +65,7 @@ void TaskWidget::paintEvent(TQPaintEvent* /* p_paintEvent */)
paint.setFont(m_font);
// set the pen for painting
- TQPen pen(Qt::SolidLine);
+ TQPen pen(TQt::SolidLine);
pen.setWidth(0);
paint.setPen(pen);
diff --git a/kbruch/src/taskwidget.h b/kbruch/src/taskwidget.h
index 2d7238ae..b2bd6f59 100644
--- a/kbruch/src/taskwidget.h
+++ b/kbruch/src/taskwidget.h
@@ -43,10 +43,11 @@
class TaskWidget : public FractionBaseWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
/** constructor */
- TaskWidget(TQWidget * parent, const char * name, const task para_task);
+ TaskWidget(TQWidget * tqparent, const char * name, const task para_task);
/** destructor */
~TaskWidget();
diff --git a/kbruch/testcases/primenumber_test.cpp b/kbruch/testcases/primenumber_test.cpp
index c0e322fb..0a5ee2b6 100644
--- a/kbruch/testcases/primenumber_test.cpp
+++ b/kbruch/testcases/primenumber_test.cpp
@@ -36,52 +36,52 @@ class primenumber_test
/** test the prime number algorithm */
void test_isPrimeNumber()
{
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(0) == 0);
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(2) == 1);
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(3) == 1);
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(4) == 0);
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(5) == 1);
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(6) == 0);
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(7) == 1);
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(8) == 0);
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(9) == 0);
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(23) == 1);
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(9) == 0);
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(9) == 0);
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(6) == 0);
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(101) == 1);
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(323) == 0); // 17 * 19
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(1001) == 0); // 7 * 143
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(1002) == 0); // 2 * 501
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(3) == 1);
- BOOST_REQUIRE(m_primenumber.isPrimeNumber(2) == 1);
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(0) == 0);
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(2) == 1);
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(3) == 1);
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(4) == 0);
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(5) == 1);
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(6) == 0);
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(7) == 1);
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(8) == 0);
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(9) == 0);
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(23) == 1);
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(9) == 0);
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(9) == 0);
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(6) == 0);
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(101) == 1);
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(323) == 0); // 17 * 19
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(1001) == 0); // 7 * 143
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(1002) == 0); // 2 * 501
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(3) == 1);
+ BOOST_RETQUIRE(m_primenumber.isPrimeNumber(2) == 1);
}
/** test the get_first() function */
void test_get_first()
{
- BOOST_REQUIRE(m_primenumber.get_first() == 2);
+ BOOST_RETQUIRE(m_primenumber.get_first() == 2);
}
/** test the move and get functions */
void test_move_get_func()
{
m_primenumber.move_first();
- BOOST_REQUIRE(m_primenumber.get_current() == 2);
- BOOST_REQUIRE(m_primenumber.get_next() == 3);
+ BOOST_RETQUIRE(m_primenumber.get_current() == 2);
+ BOOST_RETQUIRE(m_primenumber.get_next() == 3);
m_primenumber.move_forward();
- BOOST_REQUIRE(m_primenumber.get_current() == 5);
+ BOOST_RETQUIRE(m_primenumber.get_current() == 5);
m_primenumber.move_back();
- BOOST_REQUIRE(m_primenumber.get_current() == 3);
+ BOOST_RETQUIRE(m_primenumber.get_current() == 3);
unsigned int tmp = m_primenumber.get_last();
m_primenumber.move_last();
- BOOST_REQUIRE(m_primenumber.get_current() == tmp);
+ BOOST_RETQUIRE(m_primenumber.get_current() == tmp);
m_primenumber.move_forward();
- BOOST_REQUIRE(m_primenumber.get_last() != tmp);
+ BOOST_RETQUIRE(m_primenumber.get_last() != tmp);
}
private:
diff --git a/kbruch/testcases/ratio_test.cpp b/kbruch/testcases/ratio_test.cpp
index bdc4419b..0dac9dfe 100644
--- a/kbruch/testcases/ratio_test.cpp
+++ b/kbruch/testcases/ratio_test.cpp
@@ -38,29 +38,29 @@ class ratio_test
{
// check basic initialisation
ratio * ratio_a = new ratio();
- BOOST_REQUIRE(ratio_a->numerator() == 0);
- BOOST_REQUIRE(ratio_a->denominator() == 1);
+ BOOST_RETQUIRE(ratio_a->numerator() == 0);
+ BOOST_RETQUIRE(ratio_a->denominator() == 1);
// a denominator with value 0 is never allowed
ratio * ratio_b = new ratio(2, 0);
- BOOST_REQUIRE(ratio_b->numerator() == 2);
- BOOST_REQUIRE(ratio_b->denominator() == 1); // division by zero not allowed
+ BOOST_RETQUIRE(ratio_b->numerator() == 2);
+ BOOST_RETQUIRE(ratio_b->denominator() == 1); // division by zero not allowed
// a new ratio should always be reduced
ratio * ratio_c = new ratio(2, 4);
- BOOST_REQUIRE(ratio_c->numerator() == 1);
- BOOST_REQUIRE(ratio_c->denominator() == 2);
+ BOOST_RETQUIRE(ratio_c->numerator() == 1);
+ BOOST_RETQUIRE(ratio_c->denominator() == 2);
// check copy constructor
ratio * ratio_d = new ratio(*ratio_c);
- BOOST_REQUIRE(ratio_d->numerator() == 1);
- BOOST_REQUIRE(ratio_d->denominator() == 2);
+ BOOST_RETQUIRE(ratio_d->numerator() == 1);
+ BOOST_RETQUIRE(ratio_d->denominator() == 2);
// the copy constructor is not allowed to reduce the new ratio
ratio_d->setNumerator(4, false);
ratio * ratio_e = new ratio(*ratio_d);
- BOOST_REQUIRE(ratio_e->numerator() == 4);
- BOOST_REQUIRE(ratio_e->denominator() == 2);
+ BOOST_RETQUIRE(ratio_e->numerator() == 4);
+ BOOST_RETQUIRE(ratio_e->denominator() == 2);
delete(ratio_a);
delete(ratio_b);
@@ -77,33 +77,33 @@ class ratio_test
// check setNumerator() and numerator() (get)
ratio * ratio_a = new ratio();
ratio_a->setNumerator(10);
- BOOST_REQUIRE(ratio_a->numerator() == 10);
- BOOST_REQUIRE(ratio_a->denominator() == 1);
+ BOOST_RETQUIRE(ratio_a->numerator() == 10);
+ BOOST_RETQUIRE(ratio_a->denominator() == 1);
// check setDenominator() and denominator() (get)
ratio_a->setDenominator(7);
- BOOST_REQUIRE(ratio_a->numerator() == 10);
- BOOST_REQUIRE(ratio_a->denominator() == 7);
+ BOOST_RETQUIRE(ratio_a->numerator() == 10);
+ BOOST_RETQUIRE(ratio_a->denominator() == 7);
// now check if the ratio gets reduced
ratio_a->setNumerator(14);
- BOOST_REQUIRE(ratio_a->numerator() == 2);
- BOOST_REQUIRE(ratio_a->denominator() == 1);
+ BOOST_RETQUIRE(ratio_a->numerator() == 2);
+ BOOST_RETQUIRE(ratio_a->denominator() == 1);
// lets do the same, but with out reducing
ratio_a->setNumerator(14, false);
ratio_a->setDenominator(7, false);
- BOOST_REQUIRE(ratio_a->numerator() == 14);
- BOOST_REQUIRE(ratio_a->denominator() == 7);
+ BOOST_RETQUIRE(ratio_a->numerator() == 14);
+ BOOST_RETQUIRE(ratio_a->denominator() == 7);
// now the = operator
ratio * ratio_b = new ratio();
*ratio_b = *ratio_a;
- BOOST_REQUIRE(ratio_b->numerator() == 14);
- BOOST_REQUIRE(ratio_b->denominator() == 7);
+ BOOST_RETQUIRE(ratio_b->numerator() == 14);
+ BOOST_RETQUIRE(ratio_b->denominator() == 7);
// make sure we didn't just copied the pointers
- BOOST_REQUIRE(ratio_a != ratio_b);
+ BOOST_RETQUIRE(ratio_a != ratio_b);
delete(ratio_a);
delete(ratio_b);
@@ -116,13 +116,13 @@ class ratio_test
{
ratio ratio_a;
ratio_a = 8;
- BOOST_REQUIRE(ratio_a.numerator() == 8);
- BOOST_REQUIRE(ratio_a.denominator() == 1);
+ BOOST_RETQUIRE(ratio_a.numerator() == 8);
+ BOOST_RETQUIRE(ratio_a.denominator() == 1);
ratio ratio_b(2, 3);
ratio_a = ratio_b;
- BOOST_REQUIRE(ratio_a.numerator() == 2);
- BOOST_REQUIRE(ratio_a.denominator() == 3);
+ BOOST_RETQUIRE(ratio_a.numerator() == 2);
+ BOOST_RETQUIRE(ratio_a.denominator() == 3);
return;
}
@@ -140,29 +140,29 @@ class ratio_test
// check + operator
ratio ratio_c = *ratio_a + *ratio_b;
- BOOST_REQUIRE(ratio_c.numerator() == 5);
- BOOST_REQUIRE(ratio_c.denominator() == 2);
+ BOOST_RETQUIRE(ratio_c.numerator() == 5);
+ BOOST_RETQUIRE(ratio_c.denominator() == 2);
// it should be the same if we change the addends
ratio_c = *ratio_b + *ratio_a;
- BOOST_REQUIRE(ratio_c.numerator() == 5);
- BOOST_REQUIRE(ratio_c.denominator() == 2);
+ BOOST_RETQUIRE(ratio_c.numerator() == 5);
+ BOOST_RETQUIRE(ratio_c.denominator() == 2);
// check - operator
ratio_c = *ratio_b - *ratio_a;
- BOOST_REQUIRE(ratio_c.numerator() == -3);
- BOOST_REQUIRE(ratio_c.denominator() == 2);
+ BOOST_RETQUIRE(ratio_c.numerator() == -3);
+ BOOST_RETQUIRE(ratio_c.denominator() == 2);
// it should not be the same if we change the subtrahends
ratio_c = *ratio_a - *ratio_b;
- BOOST_REQUIRE(ratio_c.numerator() == 3);
- BOOST_REQUIRE(ratio_c.denominator() == 2);
+ BOOST_RETQUIRE(ratio_c.numerator() == 3);
+ BOOST_RETQUIRE(ratio_c.denominator() == 2);
// now check if we can get 0/1
*ratio_a = *ratio_b;
ratio_c = *ratio_a - *ratio_b;
- BOOST_REQUIRE(ratio_c.numerator() == 0);
- BOOST_REQUIRE(ratio_c.denominator() == 1);
+ BOOST_RETQUIRE(ratio_c.numerator() == 0);
+ BOOST_RETQUIRE(ratio_c.denominator() == 1);
delete(ratio_a);
delete(ratio_b);
@@ -183,32 +183,32 @@ class ratio_test
// check * operator
ratio ratio_c = *ratio_a * *ratio_b;
- BOOST_REQUIRE(ratio_c.numerator() == 1);
- BOOST_REQUIRE(ratio_c.denominator() == 2);
+ BOOST_RETQUIRE(ratio_c.numerator() == 1);
+ BOOST_RETQUIRE(ratio_c.denominator() == 2);
// it should be the same if we change the addends
ratio_c = *ratio_b * *ratio_a;
- BOOST_REQUIRE(ratio_c.numerator() == 1);
- BOOST_REQUIRE(ratio_c.denominator() == 2);
+ BOOST_RETQUIRE(ratio_c.numerator() == 1);
+ BOOST_RETQUIRE(ratio_c.denominator() == 2);
// check / operator
ratio_c = *ratio_b / *ratio_a;
- BOOST_REQUIRE(ratio_c.numerator() == 1);
- BOOST_REQUIRE(ratio_c.denominator() == 8);
+ BOOST_RETQUIRE(ratio_c.numerator() == 1);
+ BOOST_RETQUIRE(ratio_c.denominator() == 8);
// it should not be the same if we change the subtrahends
ratio_c = *ratio_a / *ratio_b;
- BOOST_REQUIRE(ratio_c.numerator() == 8);
- BOOST_REQUIRE(ratio_c.denominator() == 1);
+ BOOST_RETQUIRE(ratio_c.numerator() == 8);
+ BOOST_RETQUIRE(ratio_c.denominator() == 1);
// now check if we can get 0/1
*ratio_a = 0;
ratio_c = *ratio_a * *ratio_b;
- BOOST_REQUIRE(ratio_c.numerator() == 0);
- BOOST_REQUIRE(ratio_c.denominator() == 1);
+ BOOST_RETQUIRE(ratio_c.numerator() == 0);
+ BOOST_RETQUIRE(ratio_c.denominator() == 1);
ratio_c = *ratio_a / *ratio_b;
- BOOST_REQUIRE(ratio_c.numerator() == 0);
- BOOST_REQUIRE(ratio_c.denominator() == 1);
+ BOOST_RETQUIRE(ratio_c.numerator() == 0);
+ BOOST_RETQUIRE(ratio_c.denominator() == 1);
delete(ratio_a);
delete(ratio_b);
@@ -221,8 +221,8 @@ class ratio_test
{
ratio ratio_a(2, 3);
ratio_a.reziproc();
- BOOST_REQUIRE(ratio_a.numerator() == 3);
- BOOST_REQUIRE(ratio_a.denominator() == 2);
+ BOOST_RETQUIRE(ratio_a.numerator() == 3);
+ BOOST_RETQUIRE(ratio_a.denominator() == 2);
return;
}
@@ -234,8 +234,8 @@ class ratio_test
ratio_a.setNumerator(51, false);
ratio_a.setDenominator(17, false);
ratio_a.reduce();
- BOOST_REQUIRE(ratio_a.numerator() == 3);
- BOOST_REQUIRE(ratio_a.denominator() == 1);
+ BOOST_RETQUIRE(ratio_a.numerator() == 3);
+ BOOST_RETQUIRE(ratio_a.denominator() == 1);
return;
}
@@ -249,11 +249,11 @@ class ratio_test
ratio ratio_d(2, -3);
ratio ratio_e(-2, 3);
- BOOST_REQUIRE((ratio_a == ratio_a) == true);
- BOOST_REQUIRE((ratio_a == ratio_b) == true);
- BOOST_REQUIRE((ratio_a == ratio_c) == true);
- BOOST_REQUIRE((ratio_a == ratio_d) == false);
- BOOST_REQUIRE((ratio_a == ratio_e) == false);
+ BOOST_RETQUIRE((ratio_a == ratio_a) == true);
+ BOOST_RETQUIRE((ratio_a == ratio_b) == true);
+ BOOST_RETQUIRE((ratio_a == ratio_c) == true);
+ BOOST_RETQUIRE((ratio_a == ratio_d) == false);
+ BOOST_RETQUIRE((ratio_a == ratio_e) == false);
return;
}
@@ -267,21 +267,21 @@ class ratio_test
ratio ratio_d(2, -3);
ratio ratio_e(-2, 3);
- BOOST_REQUIRE((ratio_a < ratio_a) == false);
- BOOST_REQUIRE((ratio_a < ratio_b) == false);
- BOOST_REQUIRE((ratio_a < ratio_c) == false);
- BOOST_REQUIRE((ratio_a < ratio_d) == false);
- BOOST_REQUIRE((ratio_a < ratio_e) == false);
+ BOOST_RETQUIRE((ratio_a < ratio_a) == false);
+ BOOST_RETQUIRE((ratio_a < ratio_b) == false);
+ BOOST_RETQUIRE((ratio_a < ratio_c) == false);
+ BOOST_RETQUIRE((ratio_a < ratio_d) == false);
+ BOOST_RETQUIRE((ratio_a < ratio_e) == false);
ratio_a = ratio(-2, 3);
- BOOST_REQUIRE((ratio_a < ratio_a) == false);
- BOOST_REQUIRE((ratio_a < ratio_b) == true);
- BOOST_REQUIRE((ratio_a < ratio_c) == true);
- BOOST_REQUIRE((ratio_a < ratio_d) == false);
- BOOST_REQUIRE((ratio_a < ratio_e) == false);
+ BOOST_RETQUIRE((ratio_a < ratio_a) == false);
+ BOOST_RETQUIRE((ratio_a < ratio_b) == true);
+ BOOST_RETQUIRE((ratio_a < ratio_c) == true);
+ BOOST_RETQUIRE((ratio_a < ratio_d) == false);
+ BOOST_RETQUIRE((ratio_a < ratio_e) == false);
- BOOST_REQUIRE((ratio(5, 8) < ratio(2, 1)) == true);
+ BOOST_RETQUIRE((ratio(5, 8) < ratio(2, 1)) == true);
return;
}
@@ -296,21 +296,21 @@ class ratio_test
ratio ratio_e(-2, 3);
ratio ratio_f(-4, 3);
- BOOST_REQUIRE((ratio_a > ratio_a) == false);
- BOOST_REQUIRE((ratio_a > ratio_b) == false);
- BOOST_REQUIRE((ratio_a > ratio_c) == false);
- BOOST_REQUIRE((ratio_a > ratio_d) == true);
- BOOST_REQUIRE((ratio_a > ratio_e) == true);
- BOOST_REQUIRE((ratio_a > ratio_f) == true);
+ BOOST_RETQUIRE((ratio_a > ratio_a) == false);
+ BOOST_RETQUIRE((ratio_a > ratio_b) == false);
+ BOOST_RETQUIRE((ratio_a > ratio_c) == false);
+ BOOST_RETQUIRE((ratio_a > ratio_d) == true);
+ BOOST_RETQUIRE((ratio_a > ratio_e) == true);
+ BOOST_RETQUIRE((ratio_a > ratio_f) == true);
ratio_a = ratio(-2, 3);
- BOOST_REQUIRE((ratio_a > ratio_a) == false);
- BOOST_REQUIRE((ratio_a > ratio_b) == false);
- BOOST_REQUIRE((ratio_a > ratio_c) == false);
- BOOST_REQUIRE((ratio_a > ratio_d) == false);
- BOOST_REQUIRE((ratio_a > ratio_e) == false);
- BOOST_REQUIRE((ratio_a > ratio_f) == true);
+ BOOST_RETQUIRE((ratio_a > ratio_a) == false);
+ BOOST_RETQUIRE((ratio_a > ratio_b) == false);
+ BOOST_RETQUIRE((ratio_a > ratio_c) == false);
+ BOOST_RETQUIRE((ratio_a > ratio_d) == false);
+ BOOST_RETQUIRE((ratio_a > ratio_e) == false);
+ BOOST_RETQUIRE((ratio_a > ratio_f) == true);
return;
}