summaryrefslogtreecommitdiffstats
path: root/kbruch/src/statisticsview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kbruch/src/statisticsview.cpp')
-rw-r--r--kbruch/src/statisticsview.cpp76
1 files changed, 38 insertions, 38 deletions
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);
}
}