summaryrefslogtreecommitdiffstats
path: root/kbruch
diff options
context:
space:
mode:
Diffstat (limited to 'kbruch')
-rw-r--r--kbruch/src/exercisebase.cpp4
-rw-r--r--kbruch/src/exercisebase.h6
-rw-r--r--kbruch/src/exercisecompare.cpp86
-rw-r--r--kbruch/src/exercisecompare.h18
-rw-r--r--kbruch/src/exerciseconvert.cpp88
-rw-r--r--kbruch/src/exerciseconvert.h20
-rw-r--r--kbruch/src/exercisefactorize.cpp160
-rw-r--r--kbruch/src/exercisefactorize.h62
-rw-r--r--kbruch/src/factorizedwidget.cpp14
-rw-r--r--kbruch/src/factorizedwidget.h8
-rw-r--r--kbruch/src/fractionbasewidget.cpp18
-rw-r--r--kbruch/src/fractionbasewidget.h20
-rw-r--r--kbruch/src/mainqtwidget.cpp110
-rw-r--r--kbruch/src/mainqtwidget.h14
-rw-r--r--kbruch/src/primenumber.h4
-rw-r--r--kbruch/src/ratio.cpp4
-rw-r--r--kbruch/src/ratio.h8
-rw-r--r--kbruch/src/rationalwidget.cpp18
-rw-r--r--kbruch/src/rationalwidget.h8
-rw-r--r--kbruch/src/ratiowidget.cpp12
-rw-r--r--kbruch/src/ratiowidget.h6
-rw-r--r--kbruch/src/resultwidget.cpp16
-rw-r--r--kbruch/src/resultwidget.h6
-rw-r--r--kbruch/src/statisticsview.cpp76
-rw-r--r--kbruch/src/statisticsview.h24
-rw-r--r--kbruch/src/task.cpp4
-rw-r--r--kbruch/src/task.h10
-rw-r--r--kbruch/src/taskview.cpp88
-rw-r--r--kbruch/src/taskview.h22
-rw-r--r--kbruch/src/taskwidget.cpp14
-rw-r--r--kbruch/src/taskwidget.h6
31 files changed, 477 insertions, 477 deletions
diff --git a/kbruch/src/exercisebase.cpp b/kbruch/src/exercisebase.cpp
index f8d376c5..649bb6c8 100644
--- a/kbruch/src/exercisebase.cpp
+++ b/kbruch/src/exercisebase.cpp
@@ -25,8 +25,8 @@
/* ----- public member functions ----- */
/* constructor */
-ExerciseBase::ExerciseBase(QWidget * parent, const char * name):
- QWidget(parent, name)
+ExerciseBase::ExerciseBase(TQWidget * parent, const char * name):
+ TQWidget(parent, name)
{
#ifdef DEBUG
kdDebug() << "constructor ExerciseBase()" << endl;
diff --git a/kbruch/src/exercisebase.h b/kbruch/src/exercisebase.h
index a43992e7..87fe03b5 100644
--- a/kbruch/src/exercisebase.h
+++ b/kbruch/src/exercisebase.h
@@ -25,9 +25,9 @@
#include <kdebug.h>
#endif
-#include <qwidget.h>
+#include <tqwidget.h>
-/*! Constructs a QWidget.
+/*! Constructs a TQWidget.
*
* It is the base class for showing the different exercises.
*
@@ -39,7 +39,7 @@ class ExerciseBase : public QWidget
public:
/** constructor */
- ExerciseBase(QWidget * parent = 0, const char * name = 0);
+ ExerciseBase(TQWidget * parent = 0, const char * name = 0);
/** destructor */
~ExerciseBase();
diff --git a/kbruch/src/exercisecompare.cpp b/kbruch/src/exercisecompare.cpp
index c0d6466d..f6652e56 100644
--- a/kbruch/src/exercisecompare.cpp
+++ b/kbruch/src/exercisecompare.cpp
@@ -23,11 +23,11 @@
#include <klocale.h>
/* these includes are needed for Qt support */
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
+#include <tqtooltip.h>
+#include <tqwhatsthis.h>
/* standard C++ library includes */
#include <stdlib.h>
@@ -35,7 +35,7 @@
/* ----- public member functions ----- */
/* constructor */
-ExerciseCompare::ExerciseCompare(QWidget * parent, const char * name):
+ExerciseCompare::ExerciseCompare(TQWidget * parent, const char * name):
ExerciseBase(parent, name)
{
#ifdef DEBUG
@@ -43,31 +43,31 @@ ExerciseCompare::ExerciseCompare(QWidget * parent, const char * name):
#endif
/* create a new task */
- QApplication::setOverrideCursor(waitCursor); /* show the sand clock */
+ TQApplication::setOverrideCursor(waitCursor); /* show the sand clock */
createTask();
- QApplication::restoreOverrideCursor(); /* show the normal cursor */
+ TQApplication::restoreOverrideCursor(); /* show the normal cursor */
// the next thing to do on a button click would be to check the entered
// result
m_currentState = _CHECK_TASK;
- baseWidget = new QWidget(this, "baseWidget");
- baseGrid = new QGridLayout(this, 1, 1, 0, -1, "baseGrid");
+ baseWidget = new TQWidget(this, "baseWidget");
+ baseGrid = new TQGridLayout(this, 1, 1, 0, -1, "baseGrid");
baseGrid->addWidget(baseWidget, 0, 0);
// this is a VBox
- realLayout = new QVBoxLayout(baseWidget, 5, 5, "realLayout");
+ realLayout = new TQVBoxLayout(baseWidget, 5, 5, "realLayout");
// add a spacer at the top of the VBox
- QSpacerItem * v_spacer = new QSpacerItem(1, 1);
+ TQSpacerItem * v_spacer = new TQSpacerItem(1, 1);
realLayout->addItem(v_spacer);
// now a line holding the task, input fields and result
- QHBoxLayout * taskLineHBoxLayout = new QHBoxLayout(5, "taskLineHBoxLayout");
+ TQHBoxLayout * taskLineHBoxLayout = new TQHBoxLayout(5, "taskLineHBoxLayout");
realLayout->addLayout(taskLineHBoxLayout);
// spacer
- v_spacer = new QSpacerItem(1, 1);
+ v_spacer = new TQSpacerItem(1, 1);
taskLineHBoxLayout->addItem(v_spacer);
// first the first ratio widget
@@ -75,22 +75,22 @@ ExerciseCompare::ExerciseCompare(QWidget * parent, const char * name):
taskLineHBoxLayout->addWidget(m_firstRatioWidget);
// spacer
- v_spacer = new QSpacerItem(1, 1);
+ v_spacer = new TQSpacerItem(1, 1);
taskLineHBoxLayout->addItem(v_spacer);
// now the button where the user has to choose the comparison sign
- m_signButton = new QPushButton(baseWidget, "m_signButton");
+ m_signButton = new TQPushButton(baseWidget, "m_signButton");
// RTL BUG, see slotSignButtonClicked() for more information
- m_signButton->setText( QApplication::reverseLayout()?">":"<");
+ m_signButton->setText( TQApplication::reverseLayout()?">":"<");
m_signButtonState = lessThen;
taskLineHBoxLayout->addWidget(m_signButton);
- QObject::connect(m_signButton, SIGNAL(clicked()), this, SLOT(slotSignButtonClicked()));
- QToolTip::add(m_signButton, i18n("Click on this button to change the comparison sign."));
+ TQObject::connect(m_signButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSignButtonClicked()));
+ TQToolTip::add(m_signButton, i18n("Click on this button to change the comparison sign."));
// spacer
- v_spacer = new QSpacerItem(1, 1);
+ v_spacer = new TQSpacerItem(1, 1);
taskLineHBoxLayout->addItem(v_spacer);
// now the second ratio widget
@@ -98,11 +98,11 @@ ExerciseCompare::ExerciseCompare(QWidget * parent, const char * name):
taskLineHBoxLayout->addWidget(m_secondRatioWidget);
// spacer
- v_spacer = new QSpacerItem(1, 1);
+ v_spacer = new TQSpacerItem(1, 1);
taskLineHBoxLayout->addItem(v_spacer);
// at the right end we have a label just showing CORRECT or WRONG
- result_label = new QLabel(baseWidget, "result_label");
+ result_label = new TQLabel(baseWidget, "result_label");
result_label->setText(i18n("WRONG"));
taskLineHBoxLayout->addWidget(result_label);
result_label->hide();
@@ -110,21 +110,21 @@ ExerciseCompare::ExerciseCompare(QWidget * parent, const char * name):
// --- that is the end of the horizontal line ---
// add another spacer in the middle of the VBox
- v_spacer = new QSpacerItem(1, 1);
+ v_spacer = new TQSpacerItem(1, 1);
realLayout->addItem(v_spacer);
// the lower part of the VBox holds just a right aligned button
- QHBoxLayout * lowerHBox = new QHBoxLayout(1, "lowerHBox");
+ TQHBoxLayout * lowerHBox = new TQHBoxLayout(1, "lowerHBox");
realLayout->addLayout(lowerHBox);
lowerHBox->addStretch(100);
// the right aligned button
- m_checkButton = new QPushButton( baseWidget, "m_checkButton" );
+ m_checkButton = new TQPushButton( baseWidget, "m_checkButton" );
m_checkButton->setText(i18n("&Check Task"));
m_checkButton->setDefault(true); // is the default button of the dialog
- QToolTip::add(m_checkButton, i18n("Click on this button to check your result."));
+ TQToolTip::add(m_checkButton, i18n("Click on this button to check your result."));
lowerHBox->addWidget(m_checkButton, 1, Qt::AlignRight);
- QObject::connect(m_checkButton, SIGNAL(clicked()), this, SLOT(slotCheckButtonClicked()));
+ TQObject::connect(m_checkButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCheckButtonClicked()));
// that the user can start typing without moving the focus
m_signButton->setFocus();
@@ -133,8 +133,8 @@ ExerciseCompare::ExerciseCompare(QWidget * parent, const char * name):
baseWidget->show();
// add tooltip and qwhatsthis help to the widget
- QToolTip::add(this, i18n("In this exercise you have to compare 2 given fractions."));
- QWhatsThis::add(this, i18n("In this exercise you have to compare 2 given fractions by choosing the correct comparison sign. You can change the comparison sign by just clicking on the button showing the sign."));
+ TQToolTip::add(this, i18n("In this exercise you have to compare 2 given fractions."));
+ TQWhatsThis::add(this, i18n("In this exercise you have to compare 2 given fractions by choosing the correct comparison sign. You can change the comparison sign by just clicking on the button showing the sign."));
}
/* destructor */
@@ -178,7 +178,7 @@ void ExerciseCompare::update()
m_secondRatioWidget->updateAndRepaint();
// update for itself
- ((QWidget *) this)->update();
+ ((TQWidget *) this)->update();
}
@@ -203,12 +203,12 @@ void ExerciseCompare::createTask()
- emits signals if task was solved correctly or wrong */
void ExerciseCompare::showResult()
{
- QPalette pal;
- QColorGroup cg;
+ TQPalette pal;
+ TQColorGroup cg;
bool result = m_firstRatio < m_secondRatio;
// change the tooltip of the check button
- QToolTip::add(m_checkButton, i18n("Click on this button to get to the next task."));
+ TQToolTip::add(m_checkButton, i18n("Click on this button to get to the next task."));
// disable sign button
m_signButton->setEnabled(false);
@@ -223,10 +223,10 @@ void ExerciseCompare::showResult()
result_label->setText(i18n("CORRECT"));
pal = result_label->palette(); /* set green font color */
cg = pal.active();
- cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0));
+ cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0));
pal.setActive(cg);
cg = pal.inactive();
- cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0));
+ cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0));
pal.setInactive(cg);
result_label->setPalette(pal);
result_label->show(); /* show the result at the end of the task */
@@ -238,10 +238,10 @@ void ExerciseCompare::showResult()
result_label->setText(i18n("WRONG"));
pal = result_label->palette(); /* set red font color */
cg = pal.active();
- cg.setColor(QColorGroup::Foreground, QColor(red));
+ cg.setColor(TQColorGroup::Foreground, TQColor(red));
pal.setActive(cg);
cg = pal.inactive();
- cg.setColor(QColorGroup::Foreground, QColor(red));
+ cg.setColor(TQColorGroup::Foreground, TQColor(red));
pal.setInactive(cg);
result_label->setPalette(pal);
@@ -255,7 +255,7 @@ void ExerciseCompare::showResult()
void ExerciseCompare::nextTask()
{
// change the tooltip of the check button
- QToolTip::add(m_checkButton, i18n("Click on this button to check your result."));
+ TQToolTip::add(m_checkButton, i18n("Click on this button to check your result."));
// enable sign button
m_signButton->setEnabled(true);
@@ -264,13 +264,13 @@ void ExerciseCompare::nextTask()
// reset the signButton
// RTL BUG, see slotSignButtonClicked() for more information
- m_signButton->setText( QApplication::reverseLayout()?">":"<");
+ m_signButton->setText( TQApplication::reverseLayout()?">":"<");
m_signButtonState = lessThen;
/* create a new task */
- QApplication::setOverrideCursor(waitCursor); /* show the sand clock */
+ TQApplication::setOverrideCursor(waitCursor); /* show the sand clock */
createTask();
- QApplication::restoreOverrideCursor(); /* show the normal cursor */
+ TQApplication::restoreOverrideCursor(); /* show the normal cursor */
// set the ratio widgets with the new ratios
m_firstRatioWidget->setRatio(m_firstRatio);
@@ -316,10 +316,10 @@ void ExerciseCompare::slotSignButtonClicked()
if (m_signButtonState == lessThen)
{
- m_signButton->setText( QApplication::reverseLayout()?"<":">");
+ m_signButton->setText( TQApplication::reverseLayout()?"<":">");
m_signButtonState = greaterThen;
} else {
- m_signButton->setText( QApplication::reverseLayout()?">":"<");
+ m_signButton->setText( TQApplication::reverseLayout()?">":"<");
m_signButtonState = lessThen;
}
diff --git a/kbruch/src/exercisecompare.h b/kbruch/src/exercisecompare.h
index a1c656c2..67d16c61 100644
--- a/kbruch/src/exercisecompare.h
+++ b/kbruch/src/exercisecompare.h
@@ -34,9 +34,9 @@ class QPushButton;
class QVBoxLayout;
-#include <qwidget.h>
+#include <tqwidget.h>
-/*! Constructs a QWidget, which shows the task to the user.
+/*! Constructs a TQWidget, which shows the task to the user.
* The class also provides input fields, so that the user can enter the result.
* It also controls the interaction, so that the entered result gets checked
* and a new task can be generated.
@@ -48,7 +48,7 @@ class ExerciseCompare : public ExerciseBase
public:
/** constructor */
- ExerciseCompare(QWidget * parent = 0, const char * name = 0);
+ ExerciseCompare(TQWidget * parent = 0, const char * name = 0);
/** destructor */
~ExerciseCompare();
@@ -72,13 +72,13 @@ private:
RatioWidget* m_firstRatioWidget;
RatioWidget* m_secondRatioWidget;
- QPushButton* m_checkButton;
- QPushButton* m_signButton;
- QLabel* result_label;
+ TQPushButton* m_checkButton;
+ TQPushButton* m_signButton;
+ TQLabel* result_label;
- QGridLayout* baseGrid;
- QWidget* baseWidget;
- QVBoxLayout* realLayout;
+ TQGridLayout* baseGrid;
+ TQWidget* baseWidget;
+ TQVBoxLayout* realLayout;
ratio m_firstRatio;
ratio m_secondRatio;
diff --git a/kbruch/src/exerciseconvert.cpp b/kbruch/src/exerciseconvert.cpp
index 1207ecbf..967c960d 100644
--- a/kbruch/src/exerciseconvert.cpp
+++ b/kbruch/src/exerciseconvert.cpp
@@ -25,12 +25,12 @@
#include <knumvalidator.h>
/* these includes are needed for Qt support */
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
+#include <tqpushbutton.h>
+#include <tqtooltip.h>
+#include <tqwhatsthis.h>
/* standard C++ library includes */
#include <stdlib.h>
@@ -41,7 +41,7 @@
/* ----- public member functions ----- */
/* constructor */
-ExerciseConvert::ExerciseConvert(QWidget * parent, const char * name):
+ExerciseConvert::ExerciseConvert(TQWidget * parent, const char * name):
ExerciseBase(parent, name)
{
#ifdef DEBUG
@@ -49,27 +49,27 @@ ExerciseConvert::ExerciseConvert(QWidget * parent, const char * name):
#endif
/* create a new task */
- QApplication::setOverrideCursor(waitCursor); /* show the sand clock */
+ TQApplication::setOverrideCursor(waitCursor); /* show the sand clock */
createTask();
- QApplication::restoreOverrideCursor(); /* show the normal cursor */
+ TQApplication::restoreOverrideCursor(); /* show the normal cursor */
// the next thing to do on a button click would be to check the entered
// result
m_currentState = _CHECK_TASK;
- baseWidget = new QWidget(this, "baseWidget");
- baseGrid = new QGridLayout(this, 1, 1, 0, -1, "baseGrid");
+ baseWidget = new TQWidget(this, "baseWidget");
+ baseGrid = new TQGridLayout(this, 1, 1, 0, -1, "baseGrid");
baseGrid->addWidget(baseWidget, 0, 0);
// this is a VBox
- realLayout = new QVBoxLayout(baseWidget, 5, 5, "realLayout");
+ realLayout = new TQVBoxLayout(baseWidget, 5, 5, "realLayout");
// add a spacer at the top of the VBox
- QSpacerItem * v_spacer = new QSpacerItem(1, 1);
+ TQSpacerItem * v_spacer = new TQSpacerItem(1, 1);
realLayout->addItem(v_spacer);
// now a line holding the task, input fields and result
- QHBoxLayout * taskLineHBoxLayout = new QHBoxLayout(5, "taskLineHBoxLayout");
+ TQHBoxLayout * taskLineHBoxLayout = new TQHBoxLayout(5, "taskLineHBoxLayout");
realLayout->addLayout(taskLineHBoxLayout);
// first left is the rational widget
@@ -77,28 +77,28 @@ ExerciseConvert::ExerciseConvert(QWidget * parent, const char * name):
// taskLineHBoxLayout->addWidget(m_rationalWidget);
// now we have the input fields aligned in a VBox
- QVBoxLayout * inputLayout = new QVBoxLayout(5, "inputLayout");
+ TQVBoxLayout * inputLayout = new TQVBoxLayout(5, "inputLayout");
// taskLineHBoxLayout->addLayout(inputLayout);
// to validate, that the input is an int
KIntValidator *valnum = new KIntValidator( this );
/* add input box so the user can enter numerator */
- numer_edit = new QLineEdit(baseWidget, "numer_edit");
+ numer_edit = new TQLineEdit(baseWidget, "numer_edit");
numer_edit->setValidator( valnum ); // use the int validator
- QToolTip::add(numer_edit, i18n("Enter the numerator of your result"));
+ TQToolTip::add(numer_edit, i18n("Enter the numerator of your result"));
inputLayout->addWidget(numer_edit);
/* add a line between the edit boxes */
- edit_line = new QFrame(baseWidget, "edit_line");
- edit_line->setGeometry(QRect(100, 100, 20, 20));
- edit_line->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ edit_line = new TQFrame(baseWidget, "edit_line");
+ edit_line->setGeometry(TQRect(100, 100, 20, 20));
+ edit_line->setFrameStyle(TQFrame::HLine | TQFrame::Sunken);
inputLayout->addWidget(edit_line);
/* add input box so the user can enter denominator */
- deno_edit = new QLineEdit(baseWidget, "deno_edit");
+ deno_edit = new TQLineEdit(baseWidget, "deno_edit");
deno_edit->setValidator( valnum ); // use the int validator
- QToolTip::add(deno_edit, i18n("Enter the denominator of your result"));
+ TQToolTip::add(deno_edit, i18n("Enter the denominator of your result"));
inputLayout->addWidget(deno_edit);
// next is the result widget
@@ -107,13 +107,13 @@ ExerciseConvert::ExerciseConvert(QWidget * parent, const char * name):
m_resultWidget->hide();
// at the right end we have a label just showing CORRECT or WRONG
- result_label = new QLabel(baseWidget, "result_lable");
+ result_label = new TQLabel(baseWidget, "result_lable");
result_label->setText(i18n("WRONG"));
// taskLineHBoxLayout->addWidget(result_label);
result_label->hide();
// add another spacer in the middle of the VBox
- v_spacer = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum);
+ v_spacer = new TQSpacerItem(1, 1, TQSizePolicy::Expanding, TQSizePolicy::Minimum);
// taskLineHBoxLayout->addItem(v_spacer);
// --- that is the end of the horizontal line ---
@@ -126,7 +126,7 @@ ExerciseConvert::ExerciseConvert(QWidget * parent, const char * name):
//
// if you need help with this feel free to contact me - Diego <elcuco@kde.org> )
// This should fix parts of bug #116831
- if (QApplication::reverseLayout())
+ if (TQApplication::reverseLayout())
{
taskLineHBoxLayout->addItem(v_spacer);
taskLineHBoxLayout->addWidget(result_label);
@@ -144,21 +144,21 @@ ExerciseConvert::ExerciseConvert(QWidget * parent, const char * name):
}
// add another spacer in the middle of the VBox
- v_spacer = new QSpacerItem(1, 1);
+ v_spacer = new TQSpacerItem(1, 1);
realLayout->addItem(v_spacer);
// the lower part of the VBox holds just a right aligned button
- QHBoxLayout * lowerHBox = new QHBoxLayout(1, "lowerHBox");
+ TQHBoxLayout * lowerHBox = new TQHBoxLayout(1, "lowerHBox");
realLayout->addLayout(lowerHBox);
lowerHBox->addStretch(100);
// the right aligned button
- m_checkButton = new QPushButton( baseWidget, "m_checkButton" );
+ m_checkButton = new TQPushButton( baseWidget, "m_checkButton" );
m_checkButton->setText(i18n("&Check Task"));
m_checkButton->setDefault(true); // is the default button of the dialog
- QToolTip::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."));
+ 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);
- QObject::connect(m_checkButton, SIGNAL(clicked()), this, SLOT(slotCheckButtonClicked()));
+ TQObject::connect(m_checkButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCheckButtonClicked()));
// that the user can start typing without moving the focus
numer_edit->setFocus();
@@ -167,8 +167,8 @@ ExerciseConvert::ExerciseConvert(QWidget * parent, const char * name):
baseWidget->show();
// add tooltip and qwhatsthis help to the widget
- QToolTip::add(this, i18n("In this exercise you have to convert a number into a fraction."));
- QWhatsThis::add(this, i18n("In this exercise you have to convert a given number into a fraction by entering numerator and denominator. Do not forget to reduce the result!"));
+ TQToolTip::add(this, i18n("In this exercise you have to convert a number into a fraction."));
+ TQWhatsThis::add(this, i18n("In this exercise you have to convert a given number into a fraction by entering numerator and denominator. Do not forget to reduce the result!"));
}
/* destructor */
@@ -212,7 +212,7 @@ void ExerciseConvert::update()
m_resultWidget->updateAndRepaint();
// update for itself
- ((QWidget *) this)->update();
+ ((TQWidget *) this)->update();
}
@@ -329,13 +329,13 @@ void ExerciseConvert::createTask()
- emits signals if task was solved correctly or wrong */
void ExerciseConvert::showResult()
{
- QString tmp_str; /* to build a string for a label */
- QPalette pal;
- QColorGroup cg;
+ TQString tmp_str; /* to build a string for a label */
+ TQPalette pal;
+ TQColorGroup cg;
ratio entered_result;
// change the tooltip of the check button
- QToolTip::add(m_checkButton, i18n("Click on this button to get to the next task."));
+ TQToolTip::add(m_checkButton, i18n("Click on this button to get to the next task."));
numer_edit->setEnabled(false);
deno_edit->setEnabled(false);
@@ -372,10 +372,10 @@ void ExerciseConvert::showResult()
result_label->setText(i18n("CORRECT"));
pal = result_label->palette(); /* set green font color */
cg = pal.active();
- cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0));
+ cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0));
pal.setActive(cg);
cg = pal.inactive();
- cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0));
+ cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0));
pal.setInactive(cg);
result_label->setPalette(pal);
result_label->show(); /* show the result at the end of the task */
@@ -387,10 +387,10 @@ void ExerciseConvert::showResult()
result_label->setText(i18n("WRONG"));
pal = result_label->palette(); /* set red font color */
cg = pal.active();
- cg.setColor(QColorGroup::Foreground, QColor(red));
+ cg.setColor(TQColorGroup::Foreground, TQColor(red));
pal.setActive(cg);
cg = pal.inactive();
- cg.setColor(QColorGroup::Foreground, QColor(red));
+ cg.setColor(TQColorGroup::Foreground, TQColor(red));
pal.setInactive(cg);
result_label->setPalette(pal);
@@ -420,7 +420,7 @@ void ExerciseConvert::showResult()
void ExerciseConvert::nextTask()
{
// change the tooltip of the check button
- QToolTip::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."));
+ 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."));
numer_edit->setEnabled(true);
deno_edit->setEnabled(true);
@@ -434,9 +434,9 @@ void ExerciseConvert::nextTask()
numer_edit->setFocus();
/* create a new task */
- QApplication::setOverrideCursor(waitCursor); /* show the sand clock */
+ TQApplication::setOverrideCursor(waitCursor); /* show the sand clock */
createTask();
- QApplication::restoreOverrideCursor(); /* show the normal cursor */
+ TQApplication::restoreOverrideCursor(); /* show the normal cursor */
// update the task widget
m_rationalWidget->setRational(m_number, m_periodStart, m_periodLength);
diff --git a/kbruch/src/exerciseconvert.h b/kbruch/src/exerciseconvert.h
index cfbb3e0c..c4b8ff31 100644
--- a/kbruch/src/exerciseconvert.h
+++ b/kbruch/src/exerciseconvert.h
@@ -46,7 +46,7 @@ class ExerciseConvert : public ExerciseBase
public:
/** constructor */
- ExerciseConvert(QWidget * parent = 0, const char * name = 0);
+ ExerciseConvert(TQWidget * parent = 0, const char * name = 0);
/** destructor */
~ExerciseConvert();
@@ -68,23 +68,23 @@ signals:
private:
short m_currentState;
- QString m_number;
+ TQString m_number;
uint m_periodStart;
uint m_periodLength;
ratio m_result;
RationalWidget* m_rationalWidget;
ResultWidget* m_resultWidget;
- QLineEdit* numer_edit;
- QFrame* edit_line;
- QLineEdit* deno_edit;
+ TQLineEdit* numer_edit;
+ TQFrame* edit_line;
+ TQLineEdit* deno_edit;
- QPushButton* m_checkButton;
- QLabel* result_label;
+ TQPushButton* m_checkButton;
+ TQLabel* result_label;
- QGridLayout* baseGrid;
- QWidget* baseWidget;
- QVBoxLayout* realLayout;
+ TQGridLayout* baseGrid;
+ TQWidget* baseWidget;
+ TQVBoxLayout* realLayout;
void createTask();
void showResult();
diff --git a/kbruch/src/exercisefactorize.cpp b/kbruch/src/exercisefactorize.cpp
index b411e032..3a2d64dd 100644
--- a/kbruch/src/exercisefactorize.cpp
+++ b/kbruch/src/exercisefactorize.cpp
@@ -25,12 +25,12 @@
#include <knumvalidator.h>
/* these includes are needed for Qt support */
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
+#include <tqpushbutton.h>
+#include <tqtooltip.h>
+#include <tqwhatsthis.h>
/* standard C++ library includes */
#include <stdlib.h>
@@ -44,27 +44,27 @@
/* ----- public member functions ----- */
/* constructor */
-ExerciseFactorize::ExerciseFactorize(QWidget * parent, const char * name):
+ExerciseFactorize::ExerciseFactorize(TQWidget * parent, const char * name):
ExerciseBase(parent, name)
{
- QPalette pal;
- QColorGroup cg;
+ TQPalette pal;
+ TQColorGroup cg;
#ifdef DEBUG
kdDebug() << "constructor ExerciseFactorize()" << endl;
#endif
/* create a new task */
- QApplication::setOverrideCursor(waitCursor); /* show the sand clock */
+ TQApplication::setOverrideCursor(waitCursor); /* show the sand clock */
createTask();
- QApplication::restoreOverrideCursor(); /* show the normal cursor */
+ TQApplication::restoreOverrideCursor(); /* show the normal cursor */
// the next thing to do on a button click would be to check the entered
// result
m_currentState = _CHECK_TASK;
- Form1Layout = new QVBoxLayout( this, 11, 6, "Form1Layout");
+ Form1Layout = new TQVBoxLayout( this, 11, 6, "Form1Layout");
- layout9 = new QVBoxLayout( 0, 0, 6, "layout9");
+ layout9 = new TQVBoxLayout( 0, 0, 6, "layout9");
// The following method fix the problem in
// bug #116831, reverse order in RTL desktops.
@@ -72,10 +72,10 @@ ExerciseFactorize::ExerciseFactorize(QWidget * parent, const char * name):
layout4 = createFactorsLayout();
layout9->addLayout(layout4);
- spacer2 = new QSpacerItem( 20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ spacer2 = new TQSpacerItem( 20, 21, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
layout9->addItem( spacer2 );
- layout2 = new QVBoxLayout( 0, 0, 6, "layout2");
+ layout2 = new TQVBoxLayout( 0, 0, 6, "layout2");
// The following method fix the problem in
// bug #116831, reverse order in RTL desktops.
@@ -83,24 +83,24 @@ ExerciseFactorize::ExerciseFactorize(QWidget * parent, const char * name):
layout1 = createButtonsLayout();
layout2->addLayout(layout1);
- m_removeLastFactorButton = new QPushButton( this, "m_removeLastFactorButton" );
+ m_removeLastFactorButton = new TQPushButton( this, "m_removeLastFactorButton" );
layout2->addWidget( m_removeLastFactorButton );
layout9->addLayout( layout2 );
- spacer4 = new QSpacerItem( 20, 21, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ spacer4 = new TQSpacerItem( 20, 21, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
layout9->addItem( spacer4 );
- layout7 = new QHBoxLayout( 0, 0, 6, "layout7");
- spacer3 = new QSpacerItem( 361, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+ layout7 = new TQHBoxLayout( 0, 0, 6, "layout7");
+ spacer3 = new TQSpacerItem( 361, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
layout7->addItem( spacer3 );
- m_checkButton = new QPushButton( this, "m_checkButton" );
+ m_checkButton = new TQPushButton( this, "m_checkButton" );
layout7->addWidget( m_checkButton );
layout9->addLayout( layout7 );
Form1Layout->addLayout( layout9 );
// the current task
- QString tmp_str;
+ TQString tmp_str;
tmp_str.setNum(m_taskNumber);
m_taskLabel->setText(tmp_str);
@@ -126,35 +126,35 @@ ExerciseFactorize::ExerciseFactorize(QWidget * parent, const char * name):
m_factor13Button->setText( i18n( "13" ) );
m_factor17Button->setText( i18n( "17" ) );
m_factor19Button->setText( i18n( "19" ) );
- QObject::connect(m_factor2Button, SIGNAL(clicked()), this, SLOT(slotFactor2ButtonClicked()));
- QObject::connect(m_factor3Button, SIGNAL(clicked()), this, SLOT(slotFactor3ButtonClicked()));
- QObject::connect(m_factor5Button, SIGNAL(clicked()), this, SLOT(slotFactor5ButtonClicked()));
- QObject::connect(m_factor7Button, SIGNAL(clicked()), this, SLOT(slotFactor7ButtonClicked()));
- QObject::connect(m_factor11Button, SIGNAL(clicked()), this, SLOT(slotFactor11ButtonClicked()));
- QObject::connect(m_factor13Button, SIGNAL(clicked()), this, SLOT(slotFactor13ButtonClicked()));
- QObject::connect(m_factor17Button, SIGNAL(clicked()), this, SLOT(slotFactor17ButtonClicked()));
- QObject::connect(m_factor19Button, SIGNAL(clicked()), this, SLOT(slotFactor19ButtonClicked()));
+ TQObject::connect(m_factor2Button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFactor2ButtonClicked()));
+ TQObject::connect(m_factor3Button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFactor3ButtonClicked()));
+ TQObject::connect(m_factor5Button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFactor5ButtonClicked()));
+ TQObject::connect(m_factor7Button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFactor7ButtonClicked()));
+ TQObject::connect(m_factor11Button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFactor11ButtonClicked()));
+ TQObject::connect(m_factor13Button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFactor13ButtonClicked()));
+ TQObject::connect(m_factor17Button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFactor17ButtonClicked()));
+ TQObject::connect(m_factor19Button, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotFactor19ButtonClicked()));
// add tooltips to the factor buttons
- QToolTip::add(m_factor2Button, i18n("Add prime factor 2."));
- QToolTip::add(m_factor3Button, i18n("Add prime factor 3."));
- QToolTip::add(m_factor5Button, i18n("Add prime factor 5."));
- QToolTip::add(m_factor7Button, i18n("Add prime factor 7."));
- QToolTip::add(m_factor11Button, i18n("Add prime factor 11."));
- QToolTip::add(m_factor13Button, i18n("Add prime factor 13."));
- QToolTip::add(m_factor17Button, i18n("Add prime factor 17."));
- QToolTip::add(m_factor19Button, i18n("Add prime factor 19."));
+ TQToolTip::add(m_factor2Button, i18n("Add prime factor 2."));
+ TQToolTip::add(m_factor3Button, i18n("Add prime factor 3."));
+ TQToolTip::add(m_factor5Button, i18n("Add prime factor 5."));
+ TQToolTip::add(m_factor7Button, i18n("Add prime factor 7."));
+ TQToolTip::add(m_factor11Button, i18n("Add prime factor 11."));
+ TQToolTip::add(m_factor13Button, i18n("Add prime factor 13."));
+ TQToolTip::add(m_factor17Button, i18n("Add prime factor 17."));
+ TQToolTip::add(m_factor19Button, i18n("Add prime factor 19."));
// the remove last factor button
m_removeLastFactorButton->setText( i18n( "&Remove Last Factor" ) );
m_removeLastFactorButton->setEnabled(false);
- QObject::connect(m_removeLastFactorButton, SIGNAL(clicked()), this, SLOT(slotRemoveLastFactorButtonClicked()));
- QToolTip::add(m_removeLastFactorButton, i18n("Removes the last entered prime factor."));
+ TQObject::connect(m_removeLastFactorButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotRemoveLastFactorButtonClicked()));
+ TQToolTip::add(m_removeLastFactorButton, i18n("Removes the last entered prime factor."));
// the check task button
m_checkButton->setText( i18n( "&Check Task" ) );
- QToolTip::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."));
- QObject::connect(m_checkButton, SIGNAL(clicked()), this, SLOT(slotCheckButtonClicked()));
+ 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."));
+ TQObject::connect(m_checkButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCheckButtonClicked()));
m_checkButton->setDefault(true); // is the default button of the dialog
// that the user can start choosing the prime factors
@@ -170,8 +170,8 @@ ExerciseFactorize::ExerciseFactorize(QWidget * parent, const char * name):
setTabOrder(m_factor19Button, m_removeLastFactorButton);
// add tooltip and qwhatsthis help to the widget
- QToolTip::add(this, i18n("In this exercise you have to factorize a given number."));
- QWhatsThis::add(this, i18n("In this exercise you have to factorize a given number. You have to enter all prime factors of the number. You can add a prime factor by clicking on the corresponding button. The chosen prime factors will be shown in the input field. Do not forget to enter all prime factors, even when a prime factor repeats several times!"));
+ TQToolTip::add(this, i18n("In this exercise you have to factorize a given number."));
+ TQWhatsThis::add(this, i18n("In this exercise you have to factorize a given number. You have to enter all prime factors of the number. You can add a prime factor by clicking on the corresponding button. The chosen prime factors will be shown in the input field. Do not forget to enter all prime factors, even when a prime factor repeats several times!"));
}
/* destructor */
@@ -220,7 +220,7 @@ void ExerciseFactorize::update()
m_factorsWidget->updateAndRepaint();
// update for itself
- ((QWidget *) this)->update();
+ ((TQWidget *) this)->update();
}
@@ -234,34 +234,34 @@ void ExerciseFactorize::update()
/** Create the layout that hold the exercise widgets
*/
-QHBoxLayout* ExerciseFactorize::createFactorsLayout()
+TQHBoxLayout* ExerciseFactorize::createFactorsLayout()
{
// first create all widgets
- QHBoxLayout* layout = new QHBoxLayout( 0, 0, 6, "layout4");
+ TQHBoxLayout* layout = new TQHBoxLayout( 0, 0, 6, "layout4");
- m_taskLabel = new QLabel( this, "m_taskLabel" );
+ m_taskLabel = new TQLabel( this, "m_taskLabel" );
- m_equalSignLabel = new QLabel( this, "m_equalSignLabel" );
+ m_equalSignLabel = new TQLabel( this, "m_equalSignLabel" );
- m_factorsEnteredEdit = new QLineEdit( this, "m_factorsEnteredEdit" );
+ m_factorsEnteredEdit = new TQLineEdit( this, "m_factorsEnteredEdit" );
m_factorsEnteredEdit->setReadOnly(true);
m_factorsEnteredEdit->setEnabled(false);
- m_factorsEnteredEdit->setPaletteForegroundColor(QColor(0, 0, 0));
+ m_factorsEnteredEdit->setPaletteForegroundColor(TQColor(0, 0, 0));
m_factorsWidget =
new FactorizedWidget( this, "m_factorsWidget", m_factorsResult);
m_factorsWidget->hide();
- result_label = new QLabel( this, "result_label" );
+ result_label = new TQLabel( this, "result_label" );
- spacer1 = new QSpacerItem( 25, 20, QSizePolicy::Expanding,
- QSizePolicy::Minimum );
+ spacer1 = new TQSpacerItem( 25, 20, TQSizePolicy::Expanding,
+ TQSizePolicy::Minimum );
// now add the widgets to the layout.
// if we are in a RTL desktop, add them
// in a reverse order
- if (QApplication::reverseLayout())
+ if (TQApplication::reverseLayout())
{
layout->addItem( spacer1 );
layout->addWidget( result_label );
@@ -292,28 +292,28 @@ QHBoxLayout* ExerciseFactorize::createFactorsLayout()
/** Create the layout that hold the exercise widgets
*/
-QGridLayout* ExerciseFactorize::createButtonsLayout()
+TQGridLayout* ExerciseFactorize::createButtonsLayout()
{
const int _COLS = 4; // number of buttons in each row
const int _ROWS = 2; // number of rows
- QGridLayout* layout = new QGridLayout( 0, 1, 1, 0, 6, "layout1");
+ TQGridLayout* layout = new TQGridLayout( 0, 1, 1, 0, 6, "layout1");
// first row buttons
- m_factor2Button = new QPushButton( this, "m_factor2Button" );
- m_factor3Button = new QPushButton( this, "m_factor3Button" );
- m_factor5Button = new QPushButton( this, "m_factor5Button" );
- m_factor7Button = new QPushButton( this, "m_factor7Button" );
+ m_factor2Button = new TQPushButton( this, "m_factor2Button" );
+ m_factor3Button = new TQPushButton( this, "m_factor3Button" );
+ m_factor5Button = new TQPushButton( this, "m_factor5Button" );
+ m_factor7Button = new TQPushButton( this, "m_factor7Button" );
// second row buttons
- m_factor11Button = new QPushButton( this, "m_factor11Button" );
- m_factor13Button = new QPushButton( this, "m_factor13Button" );
- m_factor17Button = new QPushButton( this, "m_factor17Button" );
- m_factor19Button = new QPushButton( this, "m_factor19Button" );
+ m_factor11Button = new TQPushButton( this, "m_factor11Button" );
+ m_factor13Button = new TQPushButton( this, "m_factor13Button" );
+ m_factor17Button = new TQPushButton( this, "m_factor17Button" );
+ m_factor19Button = new TQPushButton( this, "m_factor19Button" );
// temp array to help with adding the buttons
// to the grid
- QPushButton* buttons[_ROWS][_COLS] =
+ TQPushButton* buttons[_ROWS][_COLS] =
{
{
m_factor2Button,
@@ -335,7 +335,7 @@ QGridLayout* ExerciseFactorize::createButtonsLayout()
// if we are in a RTL desktop, this helps adding the
// buttons in a reverse order
- if (QApplication::reverseLayout())
+ if (TQApplication::reverseLayout())
{
buttonIdxStart = _COLS - 1;
step = -1;
@@ -390,13 +390,13 @@ void ExerciseFactorize::createTask()
- emits signals if task was solved correctly or wrong */
void ExerciseFactorize::showResult()
{
- QString tmp_str, tmp_str2; /* to build a string for a label */
- QPalette pal;
- QColorGroup cg;
+ TQString tmp_str, tmp_str2; /* to build a string for a label */
+ TQPalette pal;
+ TQColorGroup cg;
uint uint_result = 0;
// change the tooltip of the check button
- QToolTip::add(m_checkButton, i18n("Click on this button to get to the next task."));
+ TQToolTip::add(m_checkButton, i18n("Click on this button to get to the next task."));
// disable prime factor buttons
m_factor2Button->setEnabled(false);
@@ -435,10 +435,10 @@ void ExerciseFactorize::showResult()
result_label->setText(i18n("CORRECT"));
pal = result_label->palette(); /* set green font color */
cg = pal.active();
- cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0));
+ cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0));
pal.setActive(cg);
cg = pal.inactive();
- cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0));
+ cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0));
pal.setInactive(cg);
result_label->setPalette(pal);
} else {
@@ -449,10 +449,10 @@ void ExerciseFactorize::showResult()
result_label->setText(i18n("WRONG"));
pal = result_label->palette(); /* set red font color */
cg = pal.active();
- cg.setColor(QColorGroup::Foreground, QColor(red));
+ cg.setColor(TQColorGroup::Foreground, TQColor(red));
pal.setActive(cg);
cg = pal.inactive();
- cg.setColor(QColorGroup::Foreground, QColor(red));
+ cg.setColor(TQColorGroup::Foreground, TQColor(red));
pal.setInactive(cg);
result_label->setPalette(pal);
@@ -467,7 +467,7 @@ void ExerciseFactorize::showResult()
void ExerciseFactorize::nextTask()
{
// change the tooltip of the check button
- QToolTip::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."));
+ 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."));
// enable prime factor buttons
m_factor2Button->setEnabled(true);
@@ -493,12 +493,12 @@ void ExerciseFactorize::nextTask()
m_factor2Button->setFocus();
/* create a new task */
- QApplication::setOverrideCursor(waitCursor); /* show the sand clock */
+ TQApplication::setOverrideCursor(waitCursor); /* show the sand clock */
createTask();
- QApplication::restoreOverrideCursor(); /* show the normal cursor */
+ TQApplication::restoreOverrideCursor(); /* show the normal cursor */
// update the task widget
- QString tmp_str;
+ TQString tmp_str;
tmp_str.setNum(m_taskNumber);
m_taskLabel->setText(tmp_str);
@@ -522,8 +522,8 @@ void ExerciseFactorize::addFactor(uint factor)
void ExerciseFactorize::updateEnteredEdit()
{
// the string to be shown in the entered edit
- QString str_output = "";
- QString str_tmp;
+ TQString str_output = "";
+ TQString str_tmp;
// find the end of the list
uintList::iterator it;
diff --git a/kbruch/src/exercisefactorize.h b/kbruch/src/exercisefactorize.h
index 30cc2d8d..a3460c16 100644
--- a/kbruch/src/exercisefactorize.h
+++ b/kbruch/src/exercisefactorize.h
@@ -24,9 +24,9 @@
#include <kdebug.h>
#endif
-#include <qvaluelist.h>
-#include <qvariant.h>
-#include <qwidget.h>
+#include <tqvaluelist.h>
+#include <tqvariant.h>
+#include <tqwidget.h>
#include "exercisebase.h"
#include "ratio.h"
@@ -43,7 +43,7 @@ class QLineEdit;
class QPushButton;
// a list containing uints
-typedef QValueList<uint> uintList;
+typedef TQValueList<uint> uintList;
// set a macro how much numbers are given to factorize
#define numberPossibleTasks 45
@@ -63,7 +63,7 @@ class ExerciseFactorize : public ExerciseBase
public:
/** constructor */
- ExerciseFactorize(QWidget * parent = 0, const char * name = 0);
+ ExerciseFactorize(TQWidget * parent = 0, const char * name = 0);
/** destructor */
~ExerciseFactorize();
@@ -90,27 +90,27 @@ private:
uintList m_factorsEntered;
uintList m_factorsResult;
- QLabel* m_taskLabel;
- QLabel* m_equalSignLabel;
- QLineEdit* m_factorsEnteredEdit;
+ TQLabel* m_taskLabel;
+ TQLabel* m_equalSignLabel;
+ TQLineEdit* m_factorsEnteredEdit;
FactorizedWidget* m_factorsWidget;
- QLabel* result_label;
+ TQLabel* result_label;
// buttons for the different prime factors
- QPushButton* m_factor2Button;
- QPushButton* m_factor3Button;
- QPushButton* m_factor5Button;
- QPushButton* m_factor7Button;
- QPushButton* m_factor11Button;
- QPushButton* m_factor13Button;
- QPushButton* m_factor17Button;
- QPushButton* m_factor19Button;
+ TQPushButton* m_factor2Button;
+ TQPushButton* m_factor3Button;
+ TQPushButton* m_factor5Button;
+ TQPushButton* m_factor7Button;
+ TQPushButton* m_factor11Button;
+ TQPushButton* m_factor13Button;
+ TQPushButton* m_factor17Button;
+ TQPushButton* m_factor19Button;
// button to remove the last entered factor
- QPushButton* m_removeLastFactorButton;
- QPushButton* m_checkButton;
+ TQPushButton* m_removeLastFactorButton;
+ TQPushButton* m_checkButton;
//
@@ -120,10 +120,10 @@ private:
//
/** create the factor widgets layout */
- QHBoxLayout* createFactorsLayout();
+ TQHBoxLayout* createFactorsLayout();
/** create the (answer) buttons layout */
- QGridLayout* createButtonsLayout();
+ TQGridLayout* createButtonsLayout();
void createTask();
@@ -134,16 +134,16 @@ private:
void updateEnteredEdit();
protected:
- QVBoxLayout* Form1Layout;
- QVBoxLayout* layout9;
- QSpacerItem* spacer4;
- QHBoxLayout* layout4;
- QSpacerItem* spacer1;
- QSpacerItem* spacer2;
- QVBoxLayout* layout2;
- QGridLayout* layout1;
- QHBoxLayout* layout7;
- QSpacerItem* spacer3;
+ TQVBoxLayout* Form1Layout;
+ TQVBoxLayout* layout9;
+ TQSpacerItem* spacer4;
+ TQHBoxLayout* layout4;
+ TQSpacerItem* spacer1;
+ TQSpacerItem* spacer2;
+ TQVBoxLayout* layout2;
+ TQGridLayout* layout1;
+ TQHBoxLayout* layout7;
+ TQSpacerItem* spacer3;
private slots:
void slotCheckButtonClicked();
diff --git a/kbruch/src/factorizedwidget.cpp b/kbruch/src/factorizedwidget.cpp
index 6baabc3e..c6501d4e 100644
--- a/kbruch/src/factorizedwidget.cpp
+++ b/kbruch/src/factorizedwidget.cpp
@@ -19,9 +19,9 @@
#include "factorizedwidget.moc"
/* these includes are needed for Qt support */
-#include <qpainter.h>
+#include <tqpainter.h>
-FactorizedWidget::FactorizedWidget(QWidget * parent, const char * name, const uintList para_factors) :
+FactorizedWidget::FactorizedWidget(TQWidget * parent, const char * name, const uintList para_factors) :
FractionBaseWidget(parent, name), m_factors(para_factors)
{
#ifdef DEBUG
@@ -42,7 +42,7 @@ void FactorizedWidget::setFactors(const uintList para_factors)
update();
}
-void FactorizedWidget::paintEvent(QPaintEvent* /* p_paintEvent */)
+void FactorizedWidget::paintEvent(TQPaintEvent* /* p_paintEvent */)
{
// our x position, we paint from left to right;
// we don't want to start directly on the border, so add the margin
@@ -51,24 +51,24 @@ void FactorizedWidget::paintEvent(QPaintEvent* /* p_paintEvent */)
int fontWidth; // to store the width of the last thing painted
// start the painter
- QPainter paint(this);
+ TQPainter paint(this);
// ratios and operation signs are painted with the same font
paint.setFont(m_font);
// set the pen for painting
- QPen pen(Qt::SolidLine);
+ TQPen pen(Qt::SolidLine);
pen.setWidth(0);
paint.setPen(pen);
// get the font height; the font height doesn't change while painting
- QFontMetrics fm(paint.fontMetrics());
+ TQFontMetrics fm(paint.fontMetrics());
// now we can correctly set the height of the widget
setMinimumHeight(fm.lineSpacing());
setMaximumHeight(fm.lineSpacing());
- QString tmpStr;
+ TQString tmpStr;
int fontHeight = fm.lineSpacing(); // get the font height
for (uint tmpInt = 0; tmpInt < m_factors.count(); tmpInt++)
diff --git a/kbruch/src/factorizedwidget.h b/kbruch/src/factorizedwidget.h
index 2626d445..0ed79511 100644
--- a/kbruch/src/factorizedwidget.h
+++ b/kbruch/src/factorizedwidget.h
@@ -24,10 +24,10 @@
#include "fractionbasewidget.h"
-#include <qwidget.h>
+#include <tqwidget.h>
// a list containing uints
-typedef QValueList<uint> uintList;
+typedef TQValueList<uint> uintList;
/*! class to paint the factorization of a number
*
@@ -38,7 +38,7 @@ class FactorizedWidget : public FractionBaseWidget
public:
/** constructor */
- FactorizedWidget(QWidget * parent, const char * name, const uintList para_factors);
+ FactorizedWidget(TQWidget * parent, const char * name, const uintList para_factors);
/** destructor */
~FactorizedWidget();
@@ -52,7 +52,7 @@ private:
uintList m_factors;
/** overrideing the paint event of FractionBaseWidget */
- void paintEvent(QPaintEvent*);
+ void paintEvent(TQPaintEvent*);
};
#endif
diff --git a/kbruch/src/fractionbasewidget.cpp b/kbruch/src/fractionbasewidget.cpp
index 77ff3056..07f60c84 100644
--- a/kbruch/src/fractionbasewidget.cpp
+++ b/kbruch/src/fractionbasewidget.cpp
@@ -22,12 +22,12 @@
#include <kglobalsettings.h>
/* these includes are needed for Qt support */
-#include <qpainter.h>
+#include <tqpainter.h>
#include "settingsclass.h"
-FractionBaseWidget::FractionBaseWidget(QWidget * parent = 0, const char * name = 0) :
- QWidget(parent, name)
+FractionBaseWidget::FractionBaseWidget(TQWidget * parent = 0, const char * name = 0) :
+ TQWidget(parent, name)
{
#ifdef DEBUG
kdDebug() << "constructor FractionBaseWidget" << endl;
@@ -50,14 +50,14 @@ void FractionBaseWidget::updateAndRepaint()
update();
}
-void FractionBaseWidget::paintRatio(QPainter & paint, ratio tmp_ratio, int & x_pos, QFontMetrics & fm, bool show_mixed, bool addMargin)
+void FractionBaseWidget::paintRatio(TQPainter & paint, ratio tmp_ratio, int & x_pos, TQFontMetrics & fm, bool show_mixed, bool addMargin)
{
- QPen pen = paint.pen(); // get the pen
+ TQPen pen = paint.pen(); // get the pen
int fontHeight = fm.lineSpacing(); // get the font height
int int_numerator, int_denominator, int_mixed;
- QString str_numerator, str_denominator;
- QString str_mixed;
+ TQString str_numerator, str_denominator;
+ TQString str_mixed;
int fontWidth; // to store the width of the last thing painted
int tmp_int;
@@ -129,10 +129,10 @@ void FractionBaseWidget::paintRatio(QPainter & paint, ratio tmp_ratio, int & x_p
return;
}
-void FractionBaseWidget::paintMiddle(QPainter & paint, const QString& paint_str, int & x_pos, QFontMetrics & fm, QColor color, bool addMargin)
+void FractionBaseWidget::paintMiddle(TQPainter & paint, const TQString& paint_str, int & x_pos, TQFontMetrics & fm, TQColor color, bool addMargin)
{
// get the pen, font height and font width
- QPen pen = paint.pen();
+ TQPen pen = paint.pen();
int fontHeight = fm.lineSpacing();
int fontWidth = fm.width(paint_str);
diff --git a/kbruch/src/fractionbasewidget.h b/kbruch/src/fractionbasewidget.h
index 4472ade3..21b2fdc8 100644
--- a/kbruch/src/fractionbasewidget.h
+++ b/kbruch/src/fractionbasewidget.h
@@ -27,7 +27,7 @@
#include "ratio.h"
-#include <qwidget.h>
+#include <tqwidget.h>
/*! base class for painting fractions
@@ -39,7 +39,7 @@ class FractionBaseWidget : public QWidget
public:
/** constructor */
- FractionBaseWidget(QWidget * parent, const char * name);
+ FractionBaseWidget(TQWidget * parent, const char * name);
/** destructor */
~FractionBaseWidget();
@@ -50,21 +50,21 @@ public:
protected:
/* store the different colors */
- QColor m_colorNumber;
- QColor m_colorLine;
- QColor m_colorOperation;
+ TQColor m_colorNumber;
+ TQColor m_colorLine;
+ TQColor m_colorOperation;
/* the font to paint with */
- QFont m_font;
+ TQFont m_font;
- /** overrideing the paint event of QWidget */
- virtual void paintEvent(QPaintEvent*) = 0;
+ /** overrideing the paint event of TQWidget */
+ virtual void paintEvent(TQPaintEvent*) = 0;
/** paints a ratio at the given position */
- void paintRatio(QPainter & paint, ratio tmp_ratio, int & x_pos, QFontMetrics & fm, bool show_mixed, bool addMargin = true);
+ void paintRatio(TQPainter & paint, ratio tmp_ratio, int & x_pos, TQFontMetrics & fm, bool show_mixed, bool addMargin = true);
/** paints a string in the vertical middle (aligned to the operation signs) */
- void paintMiddle(QPainter & paint, const QString& paint_str, int & x_pos, QFontMetrics & fm, QColor color, bool addMargin = true);
+ void paintMiddle(TQPainter & paint, const TQString& paint_str, int & x_pos, TQFontMetrics & fm, TQColor color, bool addMargin = true);
private:
/** sets the font and color; values taken from settingsclass */
diff --git a/kbruch/src/mainqtwidget.cpp b/kbruch/src/mainqtwidget.cpp
index 069a4d83..3ac59d46 100644
--- a/kbruch/src/mainqtwidget.cpp
+++ b/kbruch/src/mainqtwidget.cpp
@@ -27,11 +27,11 @@
#include <kconfigdialog.h>
#include <klocale.h>
-#include <qsplitter.h>
-#include <qlabel.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-#include <qwidget.h>
+#include <tqsplitter.h>
+#include <tqlabel.h>
+#include <tqtooltip.h>
+#include <tqwhatsthis.h>
+#include <tqwidget.h>
#include <math.h>
@@ -62,13 +62,13 @@ MainQtWidget::MainQtWidget()
// we split the main view into 2 parts, one for the tasks, one for the
// statistics
- QSplitter* splitter = new QSplitter(QSplitter::Horizontal, this,"QSplitter");
+ TQSplitter* splitter = new TQSplitter(TQSplitter::Horizontal, this,"TQSplitter");
setCentralWidget(splitter);
// the iconlist, where the user can choose the different exercises
m_exercises = new KJanusWidget(splitter, "KJanusWidget", KJanusWidget::IconList);
- QToolTip::add(m_exercises, i18n("Choose another exercise by clicking on an icon."));
- QWhatsThis::add(m_exercises, i18n("Click on the different icons to choose another exercise. The exercises help you to practice different aspects of calculating with fractions."));
+ TQToolTip::add(m_exercises, i18n("Choose another exercise by clicking on an icon."));
+ TQWhatsThis::add(m_exercises, i18n("Click on the different icons to choose another exercise. The exercises help you to practice different aspects of calculating with fractions."));
// create the statistic view
m_statview = new StatisticsView(splitter, "StatisticsView");
@@ -76,40 +76,40 @@ MainQtWidget::MainQtWidget()
// add the pages
//
// we have the exercise to solve fraction tasks
- QVBox * page = m_exercises->addVBoxPage(i18n("Fraction Task"), "", DesktopIcon("kbruch_exercise_common"));
- m_taskview = new TaskView((QWidget *) page, "TaskView", m_addSub, m_mulDiv, m_nrRatios, m_maxMainDenominator);
+ TQVBox * page = m_exercises->addVBoxPage(i18n("Fraction Task"), "", DesktopIcon("kbruch_exercise_common"));
+ m_taskview = new TaskView((TQWidget *) page, "TaskView", m_addSub, m_mulDiv, m_nrRatios, m_maxMainDenominator);
// we have the exercise to compare ratios
page = m_exercises->addVBoxPage(i18n("Comparison"), "", DesktopIcon("kbruch_exercise_compare"));
- m_exerciseCompare = new ExerciseCompare((QWidget *) page, "ExerciseCompare");
+ m_exerciseCompare = new ExerciseCompare((TQWidget *) page, "ExerciseCompare");
// we have the exercise to convert rational numbers into ratios
page = m_exercises->addVBoxPage(i18n("Conversion"), "", DesktopIcon("kbruch_exercise_conversion"));
- m_exerciseConvert = new ExerciseConvert((QWidget *) page, "ExerciseConvert");
+ m_exerciseConvert = new ExerciseConvert((TQWidget *) page, "ExerciseConvert");
// we have the exercise to factorize a given number into prime factors
page = m_exercises->addVBoxPage(i18n("Factorization"), "", DesktopIcon("kbruch_exercise_factorisation"));
- m_exerciseFactorize = new ExerciseFactorize((QWidget *) page, "ExerciseFactorize");
+ m_exerciseFactorize = new ExerciseFactorize((TQWidget *) page, "ExerciseFactorize");
- splitter->setResizeMode(m_statview, QSplitter::FollowSizeHint);
+ splitter->setResizeMode(m_statview, TQSplitter::FollowSizeHint);
// we must change the status of the menubar before another page is shown
- QObject::connect(m_exercises, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShowPage(QWidget *)));
+ TQObject::connect(m_exercises, TQT_SIGNAL(aboutToShowPage(TQWidget *)), this, TQT_SLOT(slotAboutToShowPage(TQWidget *)));
// connect signals of the exercises and StatisticView, so that StatisticView
// gets informed about how the user solved a given task (wrong or correct)
- QObject::connect(m_taskview, SIGNAL(signalTaskSolvedCorrect()), m_statview, SLOT(addCorrect()));
- QObject::connect(m_taskview, SIGNAL(signalTaskSolvedWrong()), m_statview, SLOT(addWrong()));
- QObject::connect(m_exerciseCompare, SIGNAL(signalExerciseSolvedCorrect()), m_statview, SLOT(addCorrect()));
- QObject::connect(m_exerciseCompare, SIGNAL(signalExerciseSolvedWrong()), m_statview, SLOT(addWrong()));
- QObject::connect(m_exerciseConvert, SIGNAL(signalExerciseSolvedCorrect()), m_statview, SLOT(addCorrect()));
- QObject::connect(m_exerciseConvert, SIGNAL(signalExerciseSolvedWrong()), m_statview, SLOT(addWrong()));
- QObject::connect(m_exerciseFactorize, SIGNAL(signalExerciseSolvedCorrect()), m_statview, SLOT(addCorrect()));
- QObject::connect(m_exerciseFactorize, SIGNAL(signalExerciseSolvedWrong()), m_statview, SLOT(addWrong()));
+ TQObject::connect(m_taskview, TQT_SIGNAL(signalTaskSolvedCorrect()), m_statview, TQT_SLOT(addCorrect()));
+ TQObject::connect(m_taskview, TQT_SIGNAL(signalTaskSolvedWrong()), m_statview, TQT_SLOT(addWrong()));
+ TQObject::connect(m_exerciseCompare, TQT_SIGNAL(signalExerciseSolvedCorrect()), m_statview, TQT_SLOT(addCorrect()));
+ TQObject::connect(m_exerciseCompare, TQT_SIGNAL(signalExerciseSolvedWrong()), m_statview, TQT_SLOT(addWrong()));
+ TQObject::connect(m_exerciseConvert, TQT_SIGNAL(signalExerciseSolvedCorrect()), m_statview, TQT_SLOT(addCorrect()));
+ TQObject::connect(m_exerciseConvert, TQT_SIGNAL(signalExerciseSolvedWrong()), m_statview, TQT_SLOT(addWrong()));
+ TQObject::connect(m_exerciseFactorize, TQT_SIGNAL(signalExerciseSolvedCorrect()), m_statview, TQT_SLOT(addCorrect()));
+ TQObject::connect(m_exerciseFactorize, TQT_SIGNAL(signalExerciseSolvedWrong()), m_statview, TQT_SLOT(addWrong()));
#if (KDE_VERSION_MINOR>=3) && (KDE_VERSION_MAJOR>=3)
#else
- resize(QSize(QMAX(toolBar()->sizeHint().width(), sizeHint().width()), sizeHint().height()));
+ resize(TQSize(QMAX(toolBar()->sizeHint().width(), sizeHint().width()), sizeHint().height()));
#endif
// now show the last exercise
m_exercises->showPage(SettingsClass::activeExercise());
@@ -155,49 +155,49 @@ void MainQtWidget::setupActions()
{
// new task action
m_NewTaskAction = new KAction(i18n("&New"), "filenew", KStdAccel::shortcut(KStdAccel::New),
- this, SLOT(NewTask()),
+ this, TQT_SLOT(NewTask()),
actionCollection(), "NewTask");
// quit action
- KStdAction::quit(kapp, SLOT(quit()), actionCollection());
+ KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection());
//
- KStdAction::preferences(this, SLOT( slotPrefs() ), actionCollection());
+ KStdAction::preferences(this, TQT_SLOT( slotPrefs() ), actionCollection());
// a label just describing the Number of terms ComboBox
- m_NrOfTermsLabel = new QLabel(i18n("Terms:"), 0, "kde toolbar widget");
+ m_NrOfTermsLabel = new TQLabel(i18n("Terms:"), 0, "kde toolbar widget");
m_NrOfTermsLabelAction = new KWidgetAction(m_NrOfTermsLabel, i18n("Terms:"), ALT+Key_E,
- this, SLOT(NrOfTermsBoxSlot()),
+ this, TQT_SLOT(NrOfTermsBoxSlot()),
actionCollection(), "NrOfTermsLabelAction");
// the ComboBox holding possible values for term number
- m_NrOfTermsBox = new QComboBox();
+ m_NrOfTermsBox = new TQComboBox();
m_NrOfTermsBox->insertItem("2");
m_NrOfTermsBox->insertItem("3");
m_NrOfTermsBox->insertItem("4");
m_NrOfTermsBox->insertItem("5");
m_NrOfTermsBox->setCurrentItem(m_nrRatios - 2);
- QToolTip::add( m_NrOfTermsBox, i18n( "The number of terms you want" ) );
- QWhatsThis::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, SLOT(NrOfTermsBoxSlot()), actionCollection(), "NrOfTermsBoxAction");
+ 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");
// now connect the ComboBox's signal textChanged() to the slot function
- QObject::connect(m_NrOfTermsBox, SIGNAL(activated(int)), this, SLOT(NrOfTermsBoxSlot()));
+ TQObject::connect(m_NrOfTermsBox, TQT_SIGNAL(activated(int)), this, TQT_SLOT(NrOfTermsBoxSlot()));
// a label just describing the max. main denominator ComboBox
- m_MaxMainDenominatorLabel = new QLabel(i18n("Max. main denominator:"), 0, "kde toolbar widget");
+ 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, SLOT(MaxMainDenominatorBoxSlot()),
+ this, TQT_SLOT(MaxMainDenominatorBoxSlot()),
actionCollection(), "MaxMainDenominatorLabelAction");
// the ComboBox holding possible values for the max. main denominator
- m_MaxMainDenominatorBox = new QComboBox(this);
+ m_MaxMainDenominatorBox = new TQComboBox(this);
m_MaxMainDenominatorBox->insertItem("10");
m_MaxMainDenominatorBox->insertItem("20");
m_MaxMainDenominatorBox->insertItem("30");
m_MaxMainDenominatorBox->insertItem("50");
- QToolTip::add( m_MaxMainDenominatorBox, i18n( "The maximum number you can have as main denominator" ) );
- QWhatsThis::add( m_MaxMainDenominatorBox, i18n( "Choose the number which will be the maximum for the main denominator: 10, 20, 30, 40 or 50." ) );
+ TQToolTip::add( m_MaxMainDenominatorBox, i18n( "The maximum number you can have as main denominator" ) );
+ TQWhatsThis::add( m_MaxMainDenominatorBox, i18n( "Choose the number which will be the maximum for the main denominator: 10, 20, 30, 40 or 50." ) );
switch (m_maxMainDenominator)
{
case 10 : m_MaxMainDenominatorBox->setCurrentItem(0);
@@ -209,20 +209,20 @@ void MainQtWidget::setupActions()
case 50 : m_MaxMainDenominatorBox->setCurrentItem(3);
break;
}
- m_MaxMainDenominatorBoxAction = new KWidgetAction(m_MaxMainDenominatorBox, i18n("Maximal Main Denominator"), ALT+Key_D, this, SLOT(MaxMainDenominatorBoxSlot()), actionCollection(), "MaxMainDenominatorBoxAction");
+ m_MaxMainDenominatorBoxAction = new KWidgetAction(m_MaxMainDenominatorBox, i18n("Maximal Main Denominator"), ALT+Key_D, this, TQT_SLOT(MaxMainDenominatorBoxSlot()), actionCollection(), "MaxMainDenominatorBoxAction");
// now connect the ComboBox's signal textChanged() to the slot function
- QObject::connect(m_MaxMainDenominatorBox, SIGNAL(activated(int)),
- this, SLOT(MaxMainDenominatorBoxSlot()));
+ TQObject::connect(m_MaxMainDenominatorBox, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(MaxMainDenominatorBoxSlot()));
// a label just describing the operation ComboBox
- m_OperationLabel = new QLabel(i18n("Operations:"), 0, "kde toolbar widget");
+ m_OperationLabel = new TQLabel(i18n("Operations:"), 0, "kde toolbar widget");
m_OperationLabelAction = new KWidgetAction(m_OperationLabel, i18n("Operations:"), ALT+Key_O,
- this, SLOT(OperationBoxSlot()),
+ this, TQT_SLOT(OperationBoxSlot()),
actionCollection(), "OperationLabelAction");
// the ComboBox holding possible combinations for operations
- m_OperationBox = new QComboBox(this);
+ m_OperationBox = new TQComboBox(this);
m_OperationBox->insertItem(i18n("Addition/Subtraction"));
m_OperationBox->insertItem(i18n("Multiplication/Division"));
m_OperationBox->insertItem(i18n("All Operations Mixed"));
@@ -234,16 +234,16 @@ void MainQtWidget::setupActions()
} else if (m_addSub == true && m_mulDiv == true) {
m_OperationBox->setCurrentItem(2);
}
- QToolTip::add( m_OperationBox, i18n( "The operations you want" ) );
- QWhatsThis::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, SLOT(OperationBoxSlot()), actionCollection(), "OperationBoxAction");
+ 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");
// now connect the ComboBox's signal textChanged() to the slot function
- QObject::connect(m_OperationBox, SIGNAL(activated(int)), this, SLOT(OperationBoxSlot()));
+ TQObject::connect(m_OperationBox, TQT_SIGNAL(activated(int)), this, TQT_SLOT(OperationBoxSlot()));
#if (KDE_VERSION_MINOR>=3) && (KDE_VERSION_MAJOR>=3)
if (!initialGeometrySet())
- resize( QSize(725, 330).expandedTo(minimumSizeHint()));
+ resize( TQSize(725, 330).expandedTo(minimumSizeHint()));
setupGUI(ToolBar | Keys | StatusBar | Create);
setAutoSaveSettings();
#endif
@@ -312,7 +312,7 @@ void MainQtWidget::NrOfTermsBoxSlot()
#ifdef DEBUG
kdDebug() << "MainQtWidget::NrOfTermsBoxSlot()" << endl;
#endif
- QString curr_nr = m_NrOfTermsBox->currentText();
+ TQString curr_nr = m_NrOfTermsBox->currentText();
m_MaxMainDenominatorBox->clear();
if (m_mulDiv == true)
@@ -371,7 +371,7 @@ void MainQtWidget::MaxMainDenominatorBoxSlot()
// get the max. size from the ComboBox, convert it to a number and store
// it in the private member
- QString curr_md = m_MaxMainDenominatorBox->currentText();
+ TQString curr_md = m_MaxMainDenominatorBox->currentText();
m_maxMainDenominator = curr_md.toUInt();
// set the new task parameters
@@ -428,12 +428,12 @@ void MainQtWidget::slotPrefs()
// User edited the configuration - update your local copies of the
// configuration data
- connect(configDialog, SIGNAL(settingsChanged()), this, SLOT(slotApplySettings()) );
+ connect(configDialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(slotApplySettings()) );
configDialog->show();
/*
SettingsDialog * dlg = new SettingsDialog(this);
- connect(dlg, SIGNAL(configChanged()), this, SLOT(slotApplySettings()));
+ connect(dlg, TQT_SIGNAL(configChanged()), this, TQT_SLOT(slotApplySettings()));
dlg->exec();
@@ -455,7 +455,7 @@ void MainQtWidget::slotApplySettings()
return;
}
-void MainQtWidget::slotAboutToShowPage(QWidget * page)
+void MainQtWidget::slotAboutToShowPage(TQWidget * page)
{
#ifdef DEBUG
kdDebug() << "slotAboutToShowPage MainQtWidget" << endl;
diff --git a/kbruch/src/mainqtwidget.h b/kbruch/src/mainqtwidget.h
index 33c1f2e5..bed32617 100644
--- a/kbruch/src/mainqtwidget.h
+++ b/kbruch/src/mainqtwidget.h
@@ -84,18 +84,18 @@ class MainQtWidget : public KMainWindow
void setupActions();
- QComboBox * m_NrOfTermsBox;
- QLabel * m_NrOfTermsLabel;
+ TQComboBox * m_NrOfTermsBox;
+ TQLabel * m_NrOfTermsLabel;
KWidgetAction * m_NrOfTermsBoxAction;
KWidgetAction * m_NrOfTermsLabelAction;
- QComboBox * m_MaxMainDenominatorBox;
- QLabel * m_MaxMainDenominatorLabel;
+ TQComboBox * m_MaxMainDenominatorBox;
+ TQLabel * m_MaxMainDenominatorLabel;
KWidgetAction * m_MaxMainDenominatorBoxAction;
KWidgetAction * m_MaxMainDenominatorLabelAction;
- QComboBox * m_OperationBox;
- QLabel * m_OperationLabel;
+ TQComboBox * m_OperationBox;
+ TQLabel * m_OperationLabel;
KWidgetAction * m_OperationBoxAction;
KWidgetAction * m_OperationLabelAction;
@@ -133,7 +133,7 @@ class MainQtWidget : public KMainWindow
/**
* called just before another page is shown
*/
- void slotAboutToShowPage(QWidget * page);
+ void slotAboutToShowPage(TQWidget * page);
protected:
/** Function is called when user calls termination.
diff --git a/kbruch/src/primenumber.h b/kbruch/src/primenumber.h
index 8f135b26..f0a27678 100644
--- a/kbruch/src/primenumber.h
+++ b/kbruch/src/primenumber.h
@@ -18,9 +18,9 @@
#ifndef PRIMZAHL_H
#define PRIMZAHL_H
-#include <qvaluevector.h>
+#include <tqvaluevector.h>
-typedef QValueVector<uint> UnsignedIntArray;
+typedef TQValueVector<uint> UnsignedIntArray;
/** Class to handle prime numbers.
* The prime numbers are stored in a static vector, so that different instances
diff --git a/kbruch/src/ratio.cpp b/kbruch/src/ratio.cpp
index 289e79f9..e3a79a36 100644
--- a/kbruch/src/ratio.cpp
+++ b/kbruch/src/ratio.cpp
@@ -57,7 +57,7 @@ ratio::~ratio()
}
/* displays the ratio on stdout; just for debugging */
-QTextStream & ratio::display(QTextStream & str) const
+TQTextStream & ratio::display(TQTextStream & str) const
{
int tmp_width = str.width();
str << qSetW(5) << " ";
@@ -362,7 +362,7 @@ void ratio::change_sign()
/* ------ some prototyps of non class functions ------ */
// it is possible to stram ratio_object
-QTextStream & operator<<(QTextStream & str, const ratio & pratio)
+TQTextStream & operator<<(TQTextStream & str, const ratio & pratio)
{
return pratio.display(str);
}
diff --git a/kbruch/src/ratio.h b/kbruch/src/ratio.h
index 3e3ca44a..c9ee687a 100644
--- a/kbruch/src/ratio.h
+++ b/kbruch/src/ratio.h
@@ -18,7 +18,7 @@
#ifndef RATIO_H
#define RATIO_H
-#include <qtextstream.h>
+#include <tqtextstream.h>
/** Represents a ratio
* This class represents 1 ratio. There are several functions provided to
@@ -38,8 +38,8 @@ public:
/** destructor */
~ratio();
- /** returns the ratio as QTextStream object */
- QTextStream & display(QTextStream & str) const;
+ /** returns the ratio as TQTextStream object */
+ TQTextStream & display(TQTextStream & str) const;
/** returns the numerator */
int numerator() const;
@@ -97,6 +97,6 @@ private:
/* ------ some prototyps of non class functions ------ */
/** it is possible to code: cout << ratio_object << endl; */
-QTextStream & operator<<(QTextStream & str, const ratio & pratio);
+TQTextStream & operator<<(TQTextStream & str, const ratio & pratio);
#endif
diff --git a/kbruch/src/rationalwidget.cpp b/kbruch/src/rationalwidget.cpp
index 7184cafd..f930d882 100644
--- a/kbruch/src/rationalwidget.cpp
+++ b/kbruch/src/rationalwidget.cpp
@@ -19,10 +19,10 @@
#include "rationalwidget.moc"
/* these includes are needed for Qt support */
-#include <qpainter.h>
-#include <qstring.h>
+#include <tqpainter.h>
+#include <tqstring.h>
-RationalWidget::RationalWidget(QWidget * parent, const char * name, const QString pnumber, const uint pperiodStart, const uint pperiodLength):
+RationalWidget::RationalWidget(TQWidget * parent, const char * name, const TQString pnumber, const uint pperiodStart, const uint pperiodLength):
FractionBaseWidget(parent, name), m_number(pnumber),
m_periodStart(pperiodStart), m_periodLength(pperiodLength)
{
@@ -38,7 +38,7 @@ RationalWidget::~RationalWidget()
#endif
}
-void RationalWidget::setRational(const QString pnumber, const uint pperiodStart, const uint pperiodLength)
+void RationalWidget::setRational(const TQString pnumber, const uint pperiodStart, const uint pperiodLength)
{
m_number = pnumber;
m_periodStart = pperiodStart;
@@ -49,7 +49,7 @@ void RationalWidget::setRational(const QString pnumber, const uint pperiodStart,
return;
}
-void RationalWidget::paintEvent(QPaintEvent* /* p_paintEvent */)
+void RationalWidget::paintEvent(TQPaintEvent* /* p_paintEvent */)
{
// our x position, we paint from left to right;
// we don't want to start directly on the border, so add the margin
@@ -58,18 +58,18 @@ void RationalWidget::paintEvent(QPaintEvent* /* p_paintEvent */)
bool tmp_painting = false;
// start the painter
- QPainter paint(this);
+ TQPainter paint(this);
// ratios and operation signs are painted with the same font
paint.setFont(m_font);
// set the pen for painting
- QPen pen(Qt::SolidLine);
+ TQPen pen(Qt::SolidLine);
pen.setWidth(0);
paint.setPen(pen);
// get the font height; the font height doesn't change while painting
- QFontMetrics fm(paint.fontMetrics());
+ TQFontMetrics fm(paint.fontMetrics());
int fontHeight = fm.lineSpacing(); // get the font height
// now we can correctly set the height of the widget
@@ -87,7 +87,7 @@ void RationalWidget::paintEvent(QPaintEvent* /* p_paintEvent */)
}
// paint the current number (or comma)
- paintMiddle(paint, QString(m_number[stringPos]), x_pos, fm, m_colorNumber, false);
+ paintMiddle(paint, TQString(m_number[stringPos]), x_pos, fm, m_colorNumber, false);
// check if the period line ends over the current number; in this case
// draw the period line
diff --git a/kbruch/src/rationalwidget.h b/kbruch/src/rationalwidget.h
index bb668bcd..f75b6ddb 100644
--- a/kbruch/src/rationalwidget.h
+++ b/kbruch/src/rationalwidget.h
@@ -37,18 +37,18 @@ class RationalWidget : public FractionBaseWidget
public:
/** constructor */
- RationalWidget(QWidget * parent, const char * name, const QString pnumber, const uint pperiodStart = 1, const uint pperiodLength = 0);
+ RationalWidget(TQWidget * parent, const char * name, const TQString pnumber, const uint pperiodStart = 1, const uint pperiodLength = 0);
/** destructor */
~RationalWidget();
/** set the task to be displayed */
- void setRational(const QString pnumber, const uint pperiodStart = 1, const uint pperiodLength = 0);
+ void setRational(const TQString pnumber, const uint pperiodStart = 1, const uint pperiodLength = 0);
private:
/** the rational number to be displayed */
- QString m_number;
+ TQString m_number;
/** starting of the period */
uint m_periodStart;
@@ -57,7 +57,7 @@ private:
uint m_periodLength;
/** overrideing the paint event of FractionBaseWidget */
- void paintEvent(QPaintEvent*);
+ void paintEvent(TQPaintEvent*);
};
#endif
diff --git a/kbruch/src/ratiowidget.cpp b/kbruch/src/ratiowidget.cpp
index 43d4d317..17f1cf04 100644
--- a/kbruch/src/ratiowidget.cpp
+++ b/kbruch/src/ratiowidget.cpp
@@ -19,9 +19,9 @@
#include "ratiowidget.moc"
/* these includes are needed for Qt support */
-#include <qpainter.h>
+#include <tqpainter.h>
-RatioWidget::RatioWidget(QWidget * parent = 0, const char * name = 0,
+RatioWidget::RatioWidget(TQWidget * parent = 0, const char * name = 0,
const ratio para_ratio = *new ratio()) :
FractionBaseWidget(parent, name), m_ratio(para_ratio)
{
@@ -43,25 +43,25 @@ void RatioWidget::setRatio(const ratio para_ratio)
update();
}
-void RatioWidget::paintEvent(QPaintEvent* /* p_paintEvent */)
+void RatioWidget::paintEvent(TQPaintEvent* /* p_paintEvent */)
{
// our x position, we paint from left to right;
// we don't want to start directly on the border, so add the margin
int x_pos = _MARGIN_X;
// start the painter
- QPainter paint(this);
+ TQPainter paint(this);
// ratios and operation signs are painted with the same font
paint.setFont(m_font);
// set the pen for painting
- QPen pen(Qt::SolidLine);
+ TQPen pen(Qt::SolidLine);
pen.setWidth(0);
paint.setPen(pen);
// get the font height; the font height doesn't change while painting
- QFontMetrics fm(paint.fontMetrics());
+ TQFontMetrics fm(paint.fontMetrics());
// now we can correctly set the height of the widget
setMinimumHeight(2 * fm.lineSpacing() + 10);
diff --git a/kbruch/src/ratiowidget.h b/kbruch/src/ratiowidget.h
index f2422043..8a64d3d4 100644
--- a/kbruch/src/ratiowidget.h
+++ b/kbruch/src/ratiowidget.h
@@ -25,7 +25,7 @@
#include "fractionbasewidget.h"
#include "ratio.h"
-#include <qwidget.h>
+#include <tqwidget.h>
/*! class to paint the ratio
*
@@ -36,7 +36,7 @@ class RatioWidget : public FractionBaseWidget
public:
/** constructor */
- RatioWidget(QWidget * parent, const char * name, const ratio para_ratio);
+ RatioWidget(TQWidget * parent, const char * name, const ratio para_ratio);
/** destructor */
~RatioWidget();
@@ -50,7 +50,7 @@ private:
ratio m_ratio;
/** overrideing the paint event of FractionBaseWidget */
- void paintEvent(QPaintEvent*);
+ void paintEvent(TQPaintEvent*);
};
#endif
diff --git a/kbruch/src/resultwidget.cpp b/kbruch/src/resultwidget.cpp
index bc9fb285..7f493408 100644
--- a/kbruch/src/resultwidget.cpp
+++ b/kbruch/src/resultwidget.cpp
@@ -19,11 +19,11 @@
#include "resultwidget.moc"
/* these includes are needed for Qt support */
-#include <qpainter.h>
+#include <tqpainter.h>
#include "settingsclass.h"
-ResultWidget::ResultWidget(QWidget * parent = 0, const char * name = 0,
+ResultWidget::ResultWidget(TQWidget * parent = 0, const char * name = 0,
const ratio para_result = *new ratio()) :
FractionBaseWidget(parent, name), m_result(para_result)
{
@@ -45,38 +45,38 @@ void ResultWidget::setResult(const ratio para_result)
update();
}
-void ResultWidget::paintEvent(QPaintEvent* /* p_paintEvent */)
+void ResultWidget::paintEvent(TQPaintEvent* /* p_paintEvent */)
{
// our x position, we paint from left to right;
// we don't want to start directly on the border, so add the margin
int old_x = _MARGIN_X;
// start the painter
- QPainter paint(this);
+ TQPainter paint(this);
// ratios and operation signs are painted with the same font
paint.setFont(m_font);
// set the pen for painting
- QPen pen(Qt::SolidLine);
+ TQPen pen(Qt::SolidLine);
pen.setWidth(0);
paint.setPen(pen);
// get the font height; the font height doesn't change while painting
- QFontMetrics fm(paint.fontMetrics());
+ TQFontMetrics fm(paint.fontMetrics());
// now we can correctly set the height of the widget
setMinimumHeight(2 * fm.lineSpacing() + 10);
setMaximumHeight(2 * fm.lineSpacing() + 10);
// result as normal ratio
- paintMiddle(paint, QString("="), old_x, fm, m_colorOperation);
+ 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()))
{
// result as mixed number
- paintMiddle(paint, QString("="), old_x, fm, m_colorOperation);
+ paintMiddle(paint, TQString("="), old_x, fm, m_colorOperation);
paintRatio(paint, m_result, old_x, fm, true);
}
diff --git a/kbruch/src/resultwidget.h b/kbruch/src/resultwidget.h
index 4570df1d..b42c3776 100644
--- a/kbruch/src/resultwidget.h
+++ b/kbruch/src/resultwidget.h
@@ -25,7 +25,7 @@
#include "fractionbasewidget.h"
#include "ratio.h"
-#include <qwidget.h>
+#include <tqwidget.h>
/*! class to paint the result
*
@@ -36,7 +36,7 @@ class ResultWidget : public FractionBaseWidget
public:
/** constructor */
- ResultWidget(QWidget * parent, const char * name, const ratio para_result);
+ ResultWidget(TQWidget * parent, const char * name, const ratio para_result);
/** destructor */
~ResultWidget();
@@ -50,7 +50,7 @@ private:
ratio m_result;
/** overrideing the paint event of FractionBaseWidget */
- void paintEvent(QPaintEvent*);
+ void paintEvent(TQPaintEvent*);
};
#endif
diff --git a/kbruch/src/statisticsview.cpp b/kbruch/src/statisticsview.cpp
index b19779f6..d6b8ff37 100644
--- a/kbruch/src/statisticsview.cpp
+++ b/kbruch/src/statisticsview.cpp
@@ -19,11 +19,11 @@
#include "statisticsview.moc"
/* the includes are needed for Qt support */
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpushbutton.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpushbutton.h>
+#include <tqtooltip.h>
+#include <tqwhatsthis.h>
#include <klocale.h>
#include <kdebug.h>
@@ -31,8 +31,8 @@
#include "settingsclass.h"
/* constructor */
-StatisticsView::StatisticsView(QWidget * parent, const char * name):
- QWidget(parent, name), m_count(0), m_correct(0)
+StatisticsView::StatisticsView(TQWidget * parent, const char * name):
+ TQWidget(parent, name), m_count(0), m_correct(0)
{
#ifdef DEBUG
kdDebug() << "constructor StatisticsView()" << endl;
@@ -42,93 +42,93 @@ StatisticsView::StatisticsView(QWidget * parent, const char * name):
m_count = SettingsClass::count();
m_correct = SettingsClass::correct();
- QPalette pal;
- QColorGroup cg;
+ TQPalette pal;
+ TQColorGroup cg;
/* set the caption of the window */
// setCaption(i18n("Statistics"));
/* add a layout as a base */
- layout1 = new QVBoxLayout(this);
+ layout1 = new TQVBoxLayout(this);
layout1->setSpacing(6);
layout1->setMargin(6);
/* now add a v-spacer */
- QSpacerItem * v_spacer = new QSpacerItem(1, 1);
+ TQSpacerItem * v_spacer = new TQSpacerItem(1, 1);
layout1->addItem(v_spacer);
/* create a grid to show the labels */
- labelGrid = new QGridLayout(layout1, 3, 2);
+ labelGrid = new TQGridLayout(layout1, 3, 2);
/* add 6 labels to the grid */
- info1Label = new QLabel(this);
+ info1Label = new TQLabel(this);
info1Label->setText(i18n("Tasks so far:"));
labelGrid->addWidget(info1Label, 1, 0);
- result1Label = new QLabel(this);
+ result1Label = new TQLabel(this);
labelGrid->addWidget(result1Label, 1, 1);
- QToolTip::add(result1Label,
+ TQToolTip::add(result1Label,
i18n("This is the current total number of solved tasks."));
- info2Label = new QLabel(this);
+ info2Label = new TQLabel(this);
info2Label->setText(i18n("Correct:"));
labelGrid->addWidget(info2Label, 2, 0);
- result2Label = new QLabel(this);
+ result2Label = new TQLabel(this);
/* set green text color for this label */
pal = result2Label->palette();
cg = pal.active();
- cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0));
+ cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0));
pal.setActive(cg);
cg = pal.inactive();
- cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0));
+ cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0));
pal.setInactive(cg);
result2Label->setPalette(pal);
labelGrid->addWidget(result2Label, 2, 1);
- QToolTip::add(result2Label,
+ TQToolTip::add(result2Label,
i18n("This is the current total number of correctly solved tasks."));
- info3Label = new QLabel(this);
+ info3Label = new TQLabel(this);
info3Label->setText(i18n("Incorrect:"));
labelGrid->addWidget(info3Label, 3, 0);
- result3Label = new QLabel(this);
+ result3Label = new TQLabel(this);
/* set red text color for this label */
pal = result3Label->palette();
cg = pal.active();
- cg.setColor(QColorGroup::Foreground, QColor(red));
+ cg.setColor(TQColorGroup::Foreground, TQColor(red));
pal.setActive(cg);
cg = pal.inactive();
- cg.setColor(QColorGroup::Foreground, QColor(red));
+ cg.setColor(TQColorGroup::Foreground, TQColor(red));
pal.setInactive(cg);
result3Label->setPalette(pal);
labelGrid->addWidget(result3Label, 3, 1);
- QToolTip::add(result3Label,
+ TQToolTip::add(result3Label,
i18n("This is the current total number of unsolved tasks."));
/* now add a v-spacer */
- v_spacer = new QSpacerItem(1, 1);
+ v_spacer = new TQSpacerItem(1, 1);
layout1->addItem(v_spacer);
/* the Reset button */
- buttonLayout = new QHBoxLayout(layout1);
- resetBtn = new QPushButton(i18n("&Reset"), this);
- QObject::connect(resetBtn, SIGNAL(clicked()), this, SLOT(resetStatistics()));
+ buttonLayout = new TQHBoxLayout(layout1);
+ resetBtn = new TQPushButton(i18n("&Reset"), this);
+ TQObject::connect(resetBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(resetStatistics()));
buttonLayout->addWidget(resetBtn);
- QToolTip::add(resetBtn, i18n("Press the button to reset the statistics."));
- QSpacerItem* spacer = new QSpacerItem(0,0);
+ TQToolTip::add(resetBtn, i18n("Press the button to reset the statistics."));
+ TQSpacerItem* spacer = new TQSpacerItem(0,0);
buttonLayout->addItem(spacer);
/* calculate the statistics */
(void) calc();
// add tooltip and qwhatsthis help to the widget
- QToolTip::add(this, i18n("This part of the window shows the statistics."));
- QWhatsThis::add(this, i18n("This part of the window shows the statistics. Each exercise you do is counted. You can reset the statistics by clicking on the button below. Also, if you do not want to see the statistics, use the vertical bar on the left to reduce the size of this window part."));
+ TQToolTip::add(this, i18n("This part of the window shows the statistics."));
+ TQWhatsThis::add(this, i18n("This part of the window shows the statistics. Each exercise you do is counted. You can reset the statistics by clicking on the button below. Also, if you do not want to see the statistics, use the vertical bar on the left to reduce the size of this window part."));
}
/* destructor */
@@ -166,10 +166,10 @@ void StatisticsView::addWrong()
/* recalculates the statistics and changes the corresponding labels */
void StatisticsView::calc()
{
- QString new_text;
- QString number;
+ TQString new_text;
+ TQString number;
- new_text = QString("<b>%1</b>").arg(m_count);
+ new_text = TQString("<b>%1</b>").arg(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 = QString("%1 (%2 %)").arg(m_correct).arg(int(double(m_correct) / m_count * 100));
+ new_text = TQString("%1 (%2 %)").arg(m_correct).arg(int(double(m_correct) / m_count * 100));
result2Label->setText(new_text);
/* set the incorrect label */
- new_text = QString("%1 (%2 %)").arg(m_count - m_correct).arg(int(double(m_count - m_correct) / m_count * 100));
+ new_text = TQString("%1 (%2 %)").arg(m_count - m_correct).arg(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 9de0c24d..6cbdf466 100644
--- a/kbruch/src/statisticsview.h
+++ b/kbruch/src/statisticsview.h
@@ -24,7 +24,7 @@ class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
-#include <qwidget.h>
+#include <tqwidget.h>
/*!
* StatisticsView takes care of the statistics of a test.
@@ -40,7 +40,7 @@ class StatisticsView : public QWidget
public:
/** constructor */
- StatisticsView(QWidget * parent = 0, const char * name = 0);
+ StatisticsView(TQWidget * parent = 0, const char * name = 0);
/** destructor */
~StatisticsView();
@@ -63,16 +63,16 @@ private:
unsigned int m_count;
unsigned int m_correct;
- QPushButton * resetBtn;
- QHBoxLayout * buttonLayout;
- QVBoxLayout * layout1;
- QGridLayout * labelGrid;
- QLabel * result1Label;
- QLabel * result2Label;
- QLabel * result3Label;
- QLabel * info1Label;
- QLabel * info2Label;
- QLabel * info3Label;
+ TQPushButton * resetBtn;
+ TQHBoxLayout * buttonLayout;
+ TQVBoxLayout * layout1;
+ TQGridLayout * labelGrid;
+ TQLabel * result1Label;
+ TQLabel * result2Label;
+ TQLabel * result3Label;
+ TQLabel * info1Label;
+ TQLabel * info2Label;
+ TQLabel * info3Label;
};
#endif
diff --git a/kbruch/src/task.cpp b/kbruch/src/task.cpp
index 4c3748a3..50cd2f28 100644
--- a/kbruch/src/task.cpp
+++ b/kbruch/src/task.cpp
@@ -176,7 +176,7 @@ void task::add_operation(short operation)
}
/** just outputs the whole given task to stdout; for debugging */
-QTextStream & task::display(QTextStream & str)
+TQTextStream & task::display(TQTextStream & str)
{
/* this is our pointer on the ratio_vector, set it to the beginning */
RatioArray::iterator ratio_pointer = ratio_vector.begin();
@@ -706,7 +706,7 @@ void task::make_denominators(int main_denominator, short pmax_md,
/* ------ some prototyps of non class functions ------ */
/** it is possible to code: cout << task_object << endl; */
-QTextStream & operator<<(QTextStream & str, task & ptask)
+TQTextStream & operator<<(TQTextStream & str, task & ptask)
{
return ptask.display(str);
}
diff --git a/kbruch/src/task.h b/kbruch/src/task.h
index 3e4c15b6..57c80b86 100644
--- a/kbruch/src/task.h
+++ b/kbruch/src/task.h
@@ -52,9 +52,9 @@ typedef struct PRIME_FACTOR
Tprime_factor;
/** we use the vector template class to create 3 dynamic types */
-typedef QValueVector<ratio> RatioArray;
-typedef QValueVector<short> ShortArray;
-typedef QValueVector<Tprime_factor> PrimeFactorArray;
+typedef TQValueVector<ratio> RatioArray;
+typedef TQValueVector<short> ShortArray;
+typedef TQValueVector<Tprime_factor> PrimeFactorArray;
/*! class to handle mathematical tasks with ratios
* naming:
@@ -101,7 +101,7 @@ public:
void add_operation(short operation = ADD);
/** display the whole task, mainly for debug */
- QTextStream & display(QTextStream & str);
+ TQTextStream & display(TQTextStream & str);
/** solves the task and returns the result as ratio */
ratio solve();
@@ -162,6 +162,6 @@ private:
/* ------ some prototypes of non class functions ------ */
/** it is possible to code: cout << task_object << endl; */
-QTextStream & operator<<(QTextStream & str, task & ptask);
+TQTextStream & operator<<(TQTextStream & str, task & ptask);
#endif
diff --git a/kbruch/src/taskview.cpp b/kbruch/src/taskview.cpp
index aba064a1..a15520a8 100644
--- a/kbruch/src/taskview.cpp
+++ b/kbruch/src/taskview.cpp
@@ -25,12 +25,12 @@
#include <knumvalidator.h>
/* these includes are needed for Qt support */
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qpushbutton.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
+#include <tqpushbutton.h>
+#include <tqtooltip.h>
+#include <tqwhatsthis.h>
/* standard C++ library includes */
#include <math.h>
@@ -38,7 +38,7 @@
/* ----- public member functions ----- */
/* constructor */
-TaskView::TaskView(QWidget * parent, const char * name, bool padd_sub,
+TaskView::TaskView(TQWidget * parent, 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),
nr_ratios(pnr_ratios), max_md(pmax_md)
@@ -50,66 +50,66 @@ TaskView::TaskView(QWidget * parent, const char * name, bool padd_sub,
curr_nr_ratios = nr_ratios;
/* create a new task */
- QApplication::setOverrideCursor(waitCursor); /* show the sand clock */
+ TQApplication::setOverrideCursor(waitCursor); /* show the sand clock */
current_task.create_task(max_md, nr_ratios, add_sub, mul_div);
- QApplication::restoreOverrideCursor(); /* show the normal cursor */
+ TQApplication::restoreOverrideCursor(); /* show the normal cursor */
// the next thing to do on a button click would be to check the entered
// result
m_currentState = _CHECK_TASK;
- baseWidget = new QWidget(this, "baseWidget");
- baseGrid = new QGridLayout(this, 1, 1, 0, -1, "baseGrid");
+ baseWidget = new TQWidget(this, "baseWidget");
+ baseGrid = new TQGridLayout(this, 1, 1, 0, -1, "baseGrid");
baseGrid->addWidget(baseWidget, 0, 0);
// this is a VBox
- realLayout = new QVBoxLayout(baseWidget, 5, 5, "realLayout");
+ realLayout = new TQVBoxLayout(baseWidget, 5, 5, "realLayout");
// add a spacer at the top of the VBox
- QSpacerItem * v_spacer = new QSpacerItem(1, 1);
+ TQSpacerItem * v_spacer = new TQSpacerItem(1, 1);
realLayout->addItem(v_spacer);
// now a line holding the task, input fields and result
- QHBoxLayout * taskLineHBoxLayout = new QHBoxLayout(5, "taskLineHBoxLayout");
+ TQHBoxLayout * taskLineHBoxLayout = new TQHBoxLayout(5, "taskLineHBoxLayout");
realLayout->addLayout(taskLineHBoxLayout);
// first left is the task widget
m_taskWidget = new TaskWidget(baseWidget, "m_taskWidget", current_task);
// now we have the input fields aligned in a VBox
- QVBoxLayout * inputLayout = new QVBoxLayout(5, "inputLayout");
+ TQVBoxLayout * inputLayout = new TQVBoxLayout(5, "inputLayout");
// to validate, that the input is an int
KIntValidator *valnum = new KIntValidator( this );
/* add input box so the user can enter numerator */
- numer_edit = new QLineEdit(baseWidget, "numer_edit");
+ numer_edit = new TQLineEdit(baseWidget, "numer_edit");
numer_edit->setValidator( valnum ); // use the int validator
- QToolTip::add(numer_edit, i18n("Enter the numerator of your result"));
+ TQToolTip::add(numer_edit, i18n("Enter the numerator of your result"));
inputLayout->addWidget(numer_edit);
/* add a line between the edit boxes */
- edit_line = new QFrame(baseWidget, "edit_line");
- edit_line->setGeometry(QRect(100, 100, 20, 20));
- edit_line->setFrameStyle(QFrame::HLine | QFrame::Sunken);
+ edit_line = new TQFrame(baseWidget, "edit_line");
+ edit_line->setGeometry(TQRect(100, 100, 20, 20));
+ edit_line->setFrameStyle(TQFrame::HLine | TQFrame::Sunken);
inputLayout->addWidget(edit_line);
/* add input box so the user can enter denominator */
- deno_edit = new QLineEdit(baseWidget, "deno_edit");
+ deno_edit = new TQLineEdit(baseWidget, "deno_edit");
deno_edit->setValidator( valnum ); // use the int validator
- QToolTip::add(deno_edit, i18n("Enter the denominator of your result"));
+ TQToolTip::add(deno_edit, i18n("Enter the denominator of your result"));
inputLayout->addWidget(deno_edit);
// next is the result widget
m_resultWidget = new ResultWidget(baseWidget, "m_resultWidget", *new ratio());
// at the right end we have a label just showing CORRECT or WRONG
- result_label = new QLabel(baseWidget, "result_label");
+ result_label = new TQLabel(baseWidget, "result_label");
result_label->setText(i18n("WRONG"));
result_label->hide();
// add another spacer in the middle of the VBox
- v_spacer = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum);
+ v_spacer = new TQSpacerItem(1, 1, TQSizePolicy::Expanding, TQSizePolicy::Minimum);
// --- that is the end of the horizontal line ---
// in RTL desktops, we still need to allign the
@@ -120,7 +120,7 @@ TaskView::TaskView(QWidget * parent, const char * name, bool padd_sub,
//
// if you need help with this feel free to contact me - Diego <elcuco@kde.org> )
// This should fix parts of bug #116831
- if (QApplication::reverseLayout())
+ if (TQApplication::reverseLayout())
{
taskLineHBoxLayout->addItem(v_spacer);
taskLineHBoxLayout->addWidget(result_label);
@@ -138,22 +138,22 @@ TaskView::TaskView(QWidget * parent, const char * name, bool padd_sub,
}
// add another spacer in the middle of the VBox
- v_spacer = new QSpacerItem(1, 1);
+ v_spacer = new TQSpacerItem(1, 1);
realLayout->addItem(v_spacer);
// the lower part of the VBox holds just a right aligned button
- QHBoxLayout * lowerHBox = new QHBoxLayout(1, "lowerHBox");
+ TQHBoxLayout * lowerHBox = new TQHBoxLayout(1, "lowerHBox");
realLayout->addLayout(lowerHBox);
lowerHBox->addStretch(100);
// the right aligned button
- m_checkButton = new QPushButton( baseWidget, "m_checkButton" );
+ m_checkButton = new TQPushButton( baseWidget, "m_checkButton" );
m_checkButton->setText(i18n("&Check Task"));
m_checkButton->setDefault(true); // is the default button of the dialog
- QToolTip::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."));
+ 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);
- QObject::connect(m_checkButton, SIGNAL(clicked()), this, SLOT(slotCheckButtonClicked()));
+ TQObject::connect(m_checkButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotCheckButtonClicked()));
// that the user can start typing without moving the focus
numer_edit->setFocus();
@@ -166,8 +166,8 @@ TaskView::TaskView(QWidget * parent, const char * name, bool padd_sub,
m_resultWidget->hide();
// add tooltip and qwhatsthis help to the widget
- QToolTip::add(this, i18n("In this exercise you have to solve a given task with fractions."));
- QWhatsThis::add(this, i18n("In this exercise you have to solve the generated task. You have to enter numerator and denominator. You can adjust the difficulty of the task with the boxes in the toolbar. Do not forget to reduce the result!"));
+ TQToolTip::add(this, i18n("In this exercise you have to solve a given task with fractions."));
+ TQWhatsThis::add(this, i18n("In this exercise you have to solve the generated task. You have to enter numerator and denominator. You can adjust the difficulty of the task with the boxes in the toolbar. Do not forget to reduce the result!"));
}
/* destructor */
@@ -241,7 +241,7 @@ void TaskView::update()
m_resultWidget->updateAndRepaint();
// update for itself
- ((QWidget *) this)->update();
+ ((TQWidget *) this)->update();
}
@@ -255,12 +255,12 @@ void TaskView::update()
- emits signals if task was solved right or wrong */
void TaskView::showResult()
{
- QString tmp_str; /* to build a string for a label */
- QPalette pal;
- QColorGroup cg;
+ TQString tmp_str; /* to build a string for a label */
+ TQPalette pal;
+ TQColorGroup cg;
// change the tooltip of the check button
- QToolTip::add(m_checkButton, i18n("Click on this button to get to the next task."));
+ TQToolTip::add(m_checkButton, i18n("Click on this button to get to the next task."));
numer_edit->setEnabled(false);
deno_edit->setEnabled(false);
@@ -298,10 +298,10 @@ void TaskView::showResult()
result_label->setText(i18n("CORRECT"));
pal = result_label->palette(); /* set green font color */
cg = pal.active();
- cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0));
+ cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0));
pal.setActive(cg);
cg = pal.inactive();
- cg.setColor(QColorGroup::Foreground, QColor(6, 179, 0));
+ cg.setColor(TQColorGroup::Foreground, TQColor(6, 179, 0));
pal.setInactive(cg);
result_label->setPalette(pal);
result_label->show(); /* show the result at the end of the task */
@@ -313,10 +313,10 @@ void TaskView::showResult()
result_label->setText(i18n("WRONG"));
pal = result_label->palette(); /* set red font color */
cg = pal.active();
- cg.setColor(QColorGroup::Foreground, QColor(red));
+ cg.setColor(TQColorGroup::Foreground, TQColor(red));
pal.setActive(cg);
cg = pal.inactive();
- cg.setColor(QColorGroup::Foreground, QColor(red));
+ cg.setColor(TQColorGroup::Foreground, TQColor(red));
pal.setInactive(cg);
result_label->setPalette(pal);
@@ -344,7 +344,7 @@ void TaskView::showResult()
void TaskView::nextTask()
{
// change the tooltip of the check button
- QToolTip::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."));
+ 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."));
numer_edit->setEnabled(true);
deno_edit->setEnabled(true);
@@ -358,9 +358,9 @@ void TaskView::nextTask()
numer_edit->setFocus();
/* create a new task */
- QApplication::setOverrideCursor(waitCursor); /* show the sand clock */
+ TQApplication::setOverrideCursor(waitCursor); /* show the sand clock */
current_task.create_task(max_md, nr_ratios, add_sub, mul_div);
- QApplication::restoreOverrideCursor(); /* show the normal cursor */
+ TQApplication::restoreOverrideCursor(); /* show the normal cursor */
// update the task widget
m_taskWidget->setTask((const task) (current_task));
diff --git a/kbruch/src/taskview.h b/kbruch/src/taskview.h
index 60c3e75c..f629fac8 100644
--- a/kbruch/src/taskview.h
+++ b/kbruch/src/taskview.h
@@ -30,7 +30,7 @@
#include <kdebug.h>
#endif
-#include <qwidget.h>
+#include <tqwidget.h>
class QVBoxLayout;
@@ -42,7 +42,7 @@ class QPushButton;
class QLineEdit;
class QFrame;
-/*! Constructs a QWidget, which shows the task to the user.
+/*! Constructs a TQWidget, which shows the task to the user.
* The class also provides input fields, so that the user can enter the result.
* It also controls the interaction, so that the entered result gets checked
* and a new task can be generated.
@@ -54,7 +54,7 @@ class TaskView : public ExerciseBase
public:
/** constructor */
- TaskView(QWidget * parent = 0, const char * name = 0,
+ TaskView(TQWidget * parent = 0, const char * name = 0,
bool padd_sub = true, bool pmul_div = false,
unsigned int pnr_ratios = 2, unsigned int pmax_md = 10);
@@ -88,16 +88,16 @@ private:
short m_currentState;
ResultWidget* m_resultWidget;
- QPushButton* m_checkButton;
- QLabel* result_label;
+ TQPushButton* m_checkButton;
+ TQLabel* result_label;
TaskWidget* m_taskWidget;
- QLineEdit* numer_edit;
- QFrame* edit_line;
- QLineEdit* deno_edit;
+ TQLineEdit* numer_edit;
+ TQFrame* edit_line;
+ TQLineEdit* deno_edit;
- QGridLayout* baseGrid;
- QWidget* baseWidget;
- QVBoxLayout* realLayout;
+ TQGridLayout* baseGrid;
+ TQWidget* baseWidget;
+ TQVBoxLayout* realLayout;
task current_task;
ratio result;
diff --git a/kbruch/src/taskwidget.cpp b/kbruch/src/taskwidget.cpp
index 378b7afb..1807283e 100644
--- a/kbruch/src/taskwidget.cpp
+++ b/kbruch/src/taskwidget.cpp
@@ -22,9 +22,9 @@
#include <klocale.h>
/* these includes are needed for Qt support */
-#include <qpainter.h>
+#include <tqpainter.h>
-TaskWidget::TaskWidget(QWidget * parent = 0, const char * name = 0,
+TaskWidget::TaskWidget(TQWidget * parent = 0, const char * name = 0,
const task para_task = *new task()) :
FractionBaseWidget(parent, name), m_task(para_task)
{
@@ -46,31 +46,31 @@ void TaskWidget::setTask(const task para_task)
update();
}
-void TaskWidget::paintEvent(QPaintEvent* /* p_paintEvent */)
+void TaskWidget::paintEvent(TQPaintEvent* /* p_paintEvent */)
{
// our x position, we paint from left to right;
// we don't want to start directly on the border, so add the margin
int old_x = _MARGIN_X;
// strings holding numerator, denominator and the operation sign
- QString str_numerator, str_denominator, str_operation;
+ TQString str_numerator, str_denominator, str_operation;
// operation sign as number
short tmp_operation;
// start the painter
- QPainter paint(this);
+ TQPainter paint(this);
// ratios and operation signs are painted with the same font
paint.setFont(m_font);
// set the pen for painting
- QPen pen(Qt::SolidLine);
+ TQPen pen(Qt::SolidLine);
pen.setWidth(0);
paint.setPen(pen);
// get the font height; the font height doesn't change while painting
- QFontMetrics fm(paint.fontMetrics());
+ TQFontMetrics fm(paint.fontMetrics());
// now we can correctly set the height of the widget
setMinimumHeight(2 * fm.lineSpacing() + 10);
diff --git a/kbruch/src/taskwidget.h b/kbruch/src/taskwidget.h
index e25ef3d3..2d7238ae 100644
--- a/kbruch/src/taskwidget.h
+++ b/kbruch/src/taskwidget.h
@@ -25,7 +25,7 @@
#include "fractionbasewidget.h"
#include "task.h"
-#include <qwidget.h>
+#include <tqwidget.h>
/** important for add_sub and mul_div */
#define YES 1
@@ -46,7 +46,7 @@ class TaskWidget : public FractionBaseWidget
public:
/** constructor */
- TaskWidget(QWidget * parent, const char * name, const task para_task);
+ TaskWidget(TQWidget * parent, const char * name, const task para_task);
/** destructor */
~TaskWidget();
@@ -60,7 +60,7 @@ private:
task m_task;
/** overrideing the paint event of FractionBaseWidget */
- void paintEvent(QPaintEvent*);
+ void paintEvent(TQPaintEvent*);
};
#endif