summaryrefslogtreecommitdiffstats
path: root/libkdegames/highscore/kexthighscore_tab.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
commit576eb4299a00bc053db35414406f46372a0f70f2 (patch)
tree4c030922d533821db464af566188e7d40cc8848c /libkdegames/highscore/kexthighscore_tab.cpp
parent0718336b6017d1a4fc1d626544180a5a2a29ddec (diff)
downloadtdegames-576eb4299a00bc053db35414406f46372a0f70f2.tar.gz
tdegames-576eb4299a00bc053db35414406f46372a0f70f2.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdegames/highscore/kexthighscore_tab.cpp')
-rw-r--r--libkdegames/highscore/kexthighscore_tab.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/libkdegames/highscore/kexthighscore_tab.cpp b/libkdegames/highscore/kexthighscore_tab.cpp
index 3e9cbe8a..3b2b5852 100644
--- a/libkdegames/highscore/kexthighscore_tab.cpp
+++ b/libkdegames/highscore/kexthighscore_tab.cpp
@@ -20,11 +20,11 @@
#include "kexthighscore_tab.h"
#include "kexthighscore_tab.moc"
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qvgroupbox.h>
-#include <qgrid.h>
-#include <qheader.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqvgroupbox.h>
+#include <tqgrid.h>
+#include <tqheader.h>
#include <kdialogbase.h>
#include <klistview.h>
@@ -39,14 +39,14 @@ namespace KExtHighscore
{
//-----------------------------------------------------------------------------
-PlayersCombo::PlayersCombo(QWidget *parent, const char *name)
- : QComboBox(parent, name)
+PlayersCombo::PlayersCombo(TQWidget *parent, const char *name)
+ : TQComboBox(parent, name)
{
const PlayerInfos &p = internal->playerInfos();
for (uint i = 0; i<p.nbEntries(); i++)
insertItem(p.prettyName(i));
- insertItem(QString("<") + i18n("all") + '>');
- connect(this, SIGNAL(activated(int)), SLOT(activatedSlot(int)));
+ insertItem(TQString("<") + i18n("all") + '>');
+ connect(this, TQT_SIGNAL(activated(int)), TQT_SLOT(activatedSlot(int)));
}
void PlayersCombo::activatedSlot(int i)
@@ -65,19 +65,19 @@ void PlayersCombo::load()
}
//-----------------------------------------------------------------------------
-AdditionalTab::AdditionalTab(QWidget *parent, const char *name)
- : QWidget(parent, name)
+AdditionalTab::AdditionalTab(TQWidget *parent, const char *name)
+ : TQWidget(parent, name)
{
- QVBoxLayout *top = new QVBoxLayout(this, KDialogBase::marginHint(),
+ TQVBoxLayout *top = new TQVBoxLayout(this, KDialogBase::marginHint(),
KDialogBase::spacingHint());
- QHBoxLayout *hbox = new QHBoxLayout(top);
- QLabel *label = new QLabel(i18n("Select player:"), this);
+ TQHBoxLayout *hbox = new TQHBoxLayout(top);
+ TQLabel *label = new TQLabel(i18n("Select player:"), this);
hbox->addWidget(label);
_combo = new PlayersCombo(this);
- connect(_combo, SIGNAL(playerSelected(uint)),
- SLOT(playerSelected(uint)));
- connect(_combo, SIGNAL(allSelected()), SLOT(allSelected()));
+ connect(_combo, TQT_SIGNAL(playerSelected(uint)),
+ TQT_SLOT(playerSelected(uint)));
+ connect(_combo, TQT_SIGNAL(allSelected()), TQT_SLOT(allSelected()));
hbox->addWidget(_combo);
hbox->addStretch(1);
}
@@ -94,11 +94,11 @@ void AdditionalTab::allSelected()
display(internal->playerInfos().nbEntries());
}
-QString AdditionalTab::percent(uint n, uint total, bool withBraces)
+TQString AdditionalTab::percent(uint n, uint total, bool withBraces)
{
- if ( n==0 || total==0 ) return QString::null;
- QString s = QString("%1%").arg(100.0 * n / total, 0, 'f', 1);
- return (withBraces ? QString("(") + s + ")" : s);
+ if ( n==0 || total==0 ) return TQString::null;
+ TQString s = TQString("%1%").arg(100.0 * n / total, 0, 'f', 1);
+ return (withBraces ? TQString("(") + s + ")" : s);
}
void AdditionalTab::load()
@@ -116,32 +116,32 @@ const char *StatisticsTab::TREND_LABELS[Nb_Trends] = {
I18N_NOOP("Current:"), I18N_NOOP("Max won:"), I18N_NOOP("Max lost:")
};
-StatisticsTab::StatisticsTab(QWidget *parent)
+StatisticsTab::StatisticsTab(TQWidget *parent)
: AdditionalTab(parent, "statistics_tab")
{
// construct GUI
- QVBoxLayout *top = static_cast<QVBoxLayout *>(layout());
+ TQVBoxLayout *top = static_cast<TQVBoxLayout *>(layout());
- QHBoxLayout *hbox = new QHBoxLayout(top);
- QVBoxLayout *vbox = new QVBoxLayout(hbox);
- QVGroupBox *group = new QVGroupBox(i18n("Game Counts"), this);
+ TQHBoxLayout *hbox = new TQHBoxLayout(top);
+ TQVBoxLayout *vbox = new TQVBoxLayout(hbox);
+ TQVGroupBox *group = new TQVGroupBox(i18n("Game Counts"), this);
vbox->addWidget(group);
- QGrid *grid = new QGrid(3, group);
+ TQGrid *grid = new TQGrid(3, group);
grid->setSpacing(KDialogBase::spacingHint());
for (uint k=0; k<Nb_Counts; k++) {
if ( Count(k)==Draw && !internal->showDrawGames ) continue;
- (void)new QLabel(i18n(COUNT_LABELS[k]), grid);
- _nbs[k] = new QLabel(grid);
- _percents[k] = new QLabel(grid);
+ (void)new TQLabel(i18n(COUNT_LABELS[k]), grid);
+ _nbs[k] = new TQLabel(grid);
+ _percents[k] = new TQLabel(grid);
}
- group = new QVGroupBox(i18n("Trends"), this);
+ group = new TQVGroupBox(i18n("Trends"), this);
vbox->addWidget(group);
- grid = new QGrid(2, group);
+ grid = new TQGrid(2, group);
grid->setSpacing(KDialogBase::spacingHint());
for (uint k=0; k<Nb_Trends; k++) {
- (void)new QLabel(i18n(TREND_LABELS[k]), grid);
- _trends[k] = new QLabel(grid);
+ (void)new TQLabel(i18n(TREND_LABELS[k]), grid);
+ _trends[k] = new TQLabel(grid);
}
hbox->addStretch(1);
@@ -182,9 +182,9 @@ void StatisticsTab::load()
init();
}
-QString StatisticsTab::percent(const Data &d, Count count) const
+TQString StatisticsTab::percent(const Data &d, Count count) const
{
- if ( count==Total ) return QString::null;
+ if ( count==Total ) return TQString::null;
return AdditionalTab::percent(d.count[count], d.count[Total], true);
}
@@ -193,26 +193,26 @@ void StatisticsTab::display(uint i)
const Data &d = _data[i];
for (uint k=0; k<Nb_Counts; k++) {
if ( Count(k) && !internal->showDrawGames ) continue;
- _nbs[k]->setText(QString::number(d.count[k]));
+ _nbs[k]->setText(TQString::number(d.count[k]));
_percents[k]->setText(percent(d, Count(k)));
}
for (uint k=0; k<Nb_Trends; k++) {
- QString s;
+ TQString s;
if ( d.trend[k]>0 ) s = '+';
int prec = (i==internal->playerInfos().nbEntries() ? 1 : 0);
- _trends[k]->setText(s + QString::number(d.trend[k], 'f', prec));
+ _trends[k]->setText(s + TQString::number(d.trend[k], 'f', prec));
}
}
//-----------------------------------------------------------------------------
-HistogramTab::HistogramTab(QWidget *parent)
+HistogramTab::HistogramTab(TQWidget *parent)
: AdditionalTab(parent, "histogram_tab")
{
// construct GUI
- QVBoxLayout *top = static_cast<QVBoxLayout *>(layout());
+ TQVBoxLayout *top = static_cast<TQVBoxLayout *>(layout());
_list = new KListView(this);
- _list->setSelectionMode(QListView::NoSelection);
+ _list->setSelectionMode(TQListView::NoSelection);
_list->setItemMargin(3);
_list->setAllColumnsShowFocus(true);
_list->setSorting(-1);
@@ -225,14 +225,14 @@ HistogramTab::HistogramTab(QWidget *parent)
_list->addColumn(i18n("Count"));
_list->addColumn(i18n("Percent"));
for (uint i=0; i<4; i++) _list->setColumnAlignment(i, AlignRight);
- _list->addColumn(QString::null);
+ _list->addColumn(TQString::null);
const Item *sitem = internal->scoreInfos().item("score")->item();
const PlayerInfos &pi = internal->playerInfos();
- const QMemArray<uint> &sh = pi.histogram();
+ const TQMemArray<uint> &sh = pi.histogram();
for (uint k=1; k<pi.histoSize(); k++) {
- QString s1 = sitem->pretty(0, sh[k-1]);
- QString s2;
+ TQString s1 = sitem->pretty(0, sh[k-1]);
+ TQString s2;
if ( k==sh.size() ) s2 = "...";
else if ( sh[k]!=sh[k-1]+1 ) s2 = sitem->pretty(0, sh[k]);
(void)new KListViewItem(_list, s1, s2);
@@ -264,14 +264,14 @@ void HistogramTab::load()
void HistogramTab::display(uint i)
{
const PlayerInfos &pi = internal->playerInfos();
- QListViewItem *item = _list->firstChild();
+ TQListViewItem *item = _list->firstChild();
uint s = pi.histoSize() - 1;
for (int k=s-1; k>=0; k--) {
uint nb = _counts[i*s + k];
- item->setText(2, QString::number(nb));
+ item->setText(2, TQString::number(nb));
item->setText(3, percent(nb, _data[i]));
uint width = (_data[i]==0 ? 0 : qRound(150.0 * nb / _data[i]));
- QPixmap pixmap(width, 10);
+ TQPixmap pixmap(width, 10);
pixmap.fill(blue);
item->setPixmap(4, pixmap);
item = item->nextSibling();