diff options
Diffstat (limited to 'libkdegames/highscore/kexthighscore_item.cpp')
-rw-r--r-- | libkdegames/highscore/kexthighscore_item.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/libkdegames/highscore/kexthighscore_item.cpp b/libkdegames/highscore/kexthighscore_item.cpp index 48556e02..fa6c7e2c 100644 --- a/libkdegames/highscore/kexthighscore_item.cpp +++ b/libkdegames/highscore/kexthighscore_item.cpp @@ -19,7 +19,7 @@ #include "kexthighscore_item.h" -#include <qlayout.h> +#include <tqlayout.h> #include <kglobal.h> #include <kdialogbase.h> #include <kdebug.h> @@ -33,7 +33,7 @@ namespace KExtHighscore { //----------------------------------------------------------------------------- -Item::Item(const QVariant &def, const QString &label, int alignment) +Item::Item(const TQVariant &def, const TQString &label, int alignment) : _default(def), _label(label), _alignment(alignment), _format(NoFormat), _special(NoSpecial) {} @@ -41,16 +41,16 @@ Item::Item(const QVariant &def, const QString &label, int alignment) Item::~Item() {} -QVariant Item::read(uint, const QVariant &value) const +TQVariant Item::read(uint, const TQVariant &value) const { return value; } void Item::setPrettyFormat(Format format) { - bool buint = ( _default.type()==QVariant::UInt ); - bool bdouble = ( _default.type()==QVariant::Double ); - bool bnum = ( buint || bdouble || _default.type()==QVariant::Int ); + bool buint = ( _default.type()==TQVariant::UInt ); + bool bdouble = ( _default.type()==TQVariant::Double ); + bool bnum = ( buint || bdouble || _default.type()==TQVariant::Int ); switch (format) { case OneDecimal: @@ -61,7 +61,7 @@ void Item::setPrettyFormat(Format format) Q_ASSERT(bnum); break; case DateTime: - Q_ASSERT( _default.type()==QVariant::DateTime ); + Q_ASSERT( _default.type()==TQVariant::DateTime ); break; case NoFormat: break; @@ -72,9 +72,9 @@ void Item::setPrettyFormat(Format format) void Item::setPrettySpecial(Special special) { - bool buint = ( _default.type()==QVariant::UInt ); - bool bnum = ( buint || _default.type()==QVariant::Double - || _default.type()==QVariant::Int ); + bool buint = ( _default.type()==TQVariant::UInt ); + bool bnum = ( buint || _default.type()==TQVariant::Double + || _default.type()==TQVariant::Int ); switch (special) { case ZeroNotDefined: @@ -86,7 +86,7 @@ void Item::setPrettySpecial(Special special) case DefaultNotDefined: break; case Anonymous: - Q_ASSERT( _default.type()==QVariant::String ); + Q_ASSERT( _default.type()==TQVariant::String ); break; case NoSpecial: break; @@ -95,15 +95,15 @@ void Item::setPrettySpecial(Special special) _special = special; } -QString Item::timeFormat(uint n) +TQString Item::timeFormat(uint n) { Q_ASSERT( n<=3600 && n!=0 ); n = 3600 - n; - return QString::number(n / 60).rightJustify(2, '0') + ':' - + QString::number(n % 60).rightJustify(2, '0'); + return TQString::number(n / 60).rightJustify(2, '0') + ':' + + TQString::number(n % 60).rightJustify(2, '0'); } -QString Item::pretty(uint, const QVariant &value) const +TQString Item::pretty(uint, const TQVariant &value) const { switch (_special) { case ZeroNotDefined: @@ -125,9 +125,9 @@ QString Item::pretty(uint, const QVariant &value) const switch (_format) { case OneDecimal: - return QString::number(value.toDouble(), 'f', 1); + return TQString::number(value.toDouble(), 'f', 1); case Percentage: - return QString::number(value.toDouble(), 'f', 1) + "%"; + return TQString::number(value.toDouble(), 'f', 1) + "%"; case MinuteTime: return timeFormat(value.toUInt()); case DateTime: @@ -152,13 +152,13 @@ Score::Score(ScoreType type) Score::~Score() {} -const QVariant &Score::data(const QString &name) const +const TQVariant &Score::data(const TQString &name) const { Q_ASSERT( _data.contains(name) ); return _data[name]; } -void Score::setData(const QString &name, const QVariant &value) +void Score::setData(const TQString &name, const TQVariant &value) { Q_ASSERT( _data.contains(name) ); Q_ASSERT( _data[name].type()==value.type() ); @@ -176,14 +176,14 @@ bool Score::operator <(const Score &score) return internal->manager.isStrictlyLess(*this, score); } -QDataStream &operator <<(QDataStream &s, const Score &score) +TQDataStream &operator <<(TQDataStream &s, const Score &score) { s << (Q_UINT8)score.type(); s << score._data; return s; } -QDataStream &operator >>(QDataStream &s, Score &score) +TQDataStream &operator >>(TQDataStream &s, Score &score) { Q_UINT8 type; s >> type; @@ -204,7 +204,7 @@ void MultiplayerScores::clear() Score score; for (uint i=0; i<_scores.size(); i++) { _nbGames[i] = 0; - QVariant name = _scores[i].data("name"); + TQVariant name = _scores[i].data("name"); _scores[i] = score; _scores[i].setData("name", name); _scores[i]._data["mean score"] = double(0); @@ -219,14 +219,14 @@ void MultiplayerScores::setPlayerCount(uint nb) clear(); } -void MultiplayerScores::setName(uint i, const QString &name) +void MultiplayerScores::setName(uint i, const TQString &name) { _scores[i].setData("name", name); } void MultiplayerScores::addScore(uint i, const Score &score) { - QVariant name = _scores[i].data("name"); + TQVariant name = _scores[i].data("name"); double mean = _scores[i].data("mean score").toDouble(); uint won = _scores[i].data("nb won games").toUInt(); _scores[i] = score; @@ -238,7 +238,7 @@ void MultiplayerScores::addScore(uint i, const Score &score) _scores[i]._data["nb won games"] = won; } -void MultiplayerScores::show(QWidget *parent) +void MultiplayerScores::show(TQWidget *parent) { // check consistency if ( _nbGames.size()<2 ) kdWarning(11002) << "less than 2 players" << endl; @@ -252,11 +252,11 @@ void MultiplayerScores::show(QWidget *parent) } // order the players according to the number of won games - QValueVector<Score> ordered; + TQValueVector<Score> ordered; for (uint i=0; i<_scores.size(); i++) { uint won = _scores[i].data("nb won games").toUInt(); double mean = _scores[i].data("mean score").toDouble(); - QValueVector<Score>::iterator it; + TQValueVector<Score>::iterator it; for(it = ordered.begin(); it!=ordered.end(); ++it) { uint cwon = (*it).data("nb won games").toUInt(); double cmean = (*it).data("mean score").toDouble(); @@ -272,21 +272,21 @@ void MultiplayerScores::show(QWidget *parent) KDialogBase dialog(KDialogBase::Plain, i18n("Multiplayers Scores"), KDialogBase::Close, KDialogBase::Close, parent, "show_multiplayers_score", true, true); - QHBoxLayout *hbox = new QHBoxLayout(dialog.plainPage(), + TQHBoxLayout *hbox = new TQHBoxLayout(dialog.plainPage(), KDialog::marginHint(), KDialog::spacingHint()); - QVBox *vbox = new QVBox(dialog.plainPage()); + TQVBox *vbox = new TQVBox(dialog.plainPage()); hbox->addWidget(vbox); - if ( _nbGames[0]==0 ) (void)new QLabel(i18n("No game played."), vbox); + if ( _nbGames[0]==0 ) (void)new TQLabel(i18n("No game played."), vbox); else { - (void)new QLabel(i18n("Scores for last game:"), vbox); + (void)new TQLabel(i18n("Scores for last game:"), vbox); (void)new LastMultipleScoresList(ordered, vbox); } if ( _nbGames[0]>1 ) { - vbox = new QVBox(dialog.plainPage()); + vbox = new TQVBox(dialog.plainPage()); hbox->addWidget(vbox); - (void)new QLabel(i18n("Scores for the last %1 games:") + (void)new TQLabel(i18n("Scores for the last %1 games:") .arg(_nbGames[0]), vbox); (void)new TotalMultipleScoresList(ordered, vbox); } @@ -295,14 +295,14 @@ void MultiplayerScores::show(QWidget *parent) dialog.exec(); } -QDataStream &operator <<(QDataStream &s, const MultiplayerScores &score) +TQDataStream &operator <<(TQDataStream &s, const MultiplayerScores &score) { s << score._scores; s << score._nbGames; return s; } -QDataStream &operator >>(QDataStream &s, MultiplayerScores &score) +TQDataStream &operator >>(TQDataStream &s, MultiplayerScores &score) { s >> score._scores; s >> score._nbGames; |