diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:44:41 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:44:41 +0000 |
commit | a374efce3a207b39514be3c52264091400ce297e (patch) | |
tree | 77bdf654b55826d4f59b53a5621310206bcaead1 /kbruch/src/statisticsview.cpp | |
parent | f81a494f3957d5cf38c787973415597941934727 (diff) | |
download | tdeedu-a374efce3a207b39514be3c52264091400ce297e.tar.gz tdeedu-a374efce3a207b39514be3c52264091400ce297e.zip |
TQt4 port kdeedu
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1236073 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbruch/src/statisticsview.cpp')
-rw-r--r-- | kbruch/src/statisticsview.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/kbruch/src/statisticsview.cpp b/kbruch/src/statisticsview.cpp index d6b8ff37..b3fee887 100644 --- a/kbruch/src/statisticsview.cpp +++ b/kbruch/src/statisticsview.cpp @@ -18,7 +18,7 @@ #include "statisticsview.h" #include "statisticsview.moc" -/* the includes are needed for Qt support */ +/* the includes are needed for TQt support */ #include <tqlabel.h> #include <tqlayout.h> #include <tqpushbutton.h> @@ -31,8 +31,8 @@ #include "settingsclass.h" /* constructor */ -StatisticsView::StatisticsView(TQWidget * parent, const char * name): - TQWidget(parent, name), m_count(0), m_correct(0) +StatisticsView::StatisticsView(TQWidget * tqparent, const char * name): + TQWidget(tqparent, name), m_count(0), m_correct(0) { #ifdef DEBUG kdDebug() << "constructor StatisticsView()" << endl; @@ -48,17 +48,17 @@ StatisticsView::StatisticsView(TQWidget * parent, const char * name): /* set the caption of the window */ // setCaption(i18n("Statistics")); - /* add a layout as a base */ - layout1 = new TQVBoxLayout(this); - layout1->setSpacing(6); - layout1->setMargin(6); + /* add a tqlayout as a base */ + tqlayout1 = new TQVBoxLayout(this); + tqlayout1->setSpacing(6); + tqlayout1->setMargin(6); /* now add a v-spacer */ TQSpacerItem * v_spacer = new TQSpacerItem(1, 1); - layout1->addItem(v_spacer); + tqlayout1->addItem(v_spacer); /* create a grid to show the labels */ - labelGrid = new TQGridLayout(layout1, 3, 2); + labelGrid = new TQGridLayout(tqlayout1, 3, 2); /* add 6 labels to the grid */ info1Label = new TQLabel(this); @@ -112,10 +112,10 @@ StatisticsView::StatisticsView(TQWidget * parent, const char * name): /* now add a v-spacer */ v_spacer = new TQSpacerItem(1, 1); - layout1->addItem(v_spacer); + tqlayout1->addItem(v_spacer); /* the Reset button */ - buttonLayout = new TQHBoxLayout(layout1); + buttonLayout = new TQHBoxLayout(tqlayout1); resetBtn = new TQPushButton(i18n("&Reset"), this); TQObject::connect(resetBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(resetStatistics())); buttonLayout->addWidget(resetBtn); @@ -142,7 +142,7 @@ StatisticsView::~StatisticsView() SettingsClass::setCorrect(m_correct); SettingsClass::writeConfig(); - /* no need to delete any child widgets, Qt does it by itself */ + /* no need to delete any child widgets, TQt does it by itself */ } /* called, if a task solved correctly */ @@ -150,14 +150,14 @@ void StatisticsView::addCorrect() { ++m_count; ++m_correct; - (void) calc(); /* repaint the statistics */ + (void) calc(); /* tqrepaint the statistics */ } /* called, if a task was solved wrong */ void StatisticsView::addWrong() { ++m_count; - (void) calc(); /* repaint the statistics */ + (void) calc(); /* tqrepaint the statistics */ } @@ -169,7 +169,7 @@ void StatisticsView::calc() TQString new_text; TQString number; - new_text = TQString("<b>%1</b>").arg(m_count); + new_text = TQString("<b>%1</b>").tqarg(m_count); result1Label->setText(new_text); /* we have to be careful with division by 0 */ @@ -179,11 +179,11 @@ void StatisticsView::calc() result3Label->setText("- (- %)"); } else { /* set the correct label */ - new_text = TQString("%1 (%2 %)").arg(m_correct).arg(int(double(m_correct) / m_count * 100)); + new_text = TQString("%1 (%2 %)").tqarg(m_correct).tqarg(int(double(m_correct) / m_count * 100)); result2Label->setText(new_text); /* set the incorrect label */ - new_text = TQString("%1 (%2 %)").arg(m_count - m_correct).arg(int(double(m_count - m_correct) / m_count * 100)); + new_text = TQString("%1 (%2 %)").tqarg(m_count - m_correct).tqarg(int(double(m_count - m_correct) / m_count * 100)); result3Label->setText(new_text); } } |