diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
commit | 576eb4299a00bc053db35414406f46372a0f70f2 (patch) | |
tree | 4c030922d533821db464af566188e7d40cc8848c /libksirtet/base/field.cpp | |
parent | 0718336b6017d1a4fc1d626544180a5a2a29ddec (diff) | |
download | tdegames-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 'libksirtet/base/field.cpp')
-rw-r--r-- | libksirtet/base/field.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/libksirtet/base/field.cpp b/libksirtet/base/field.cpp index 53f6220a..fae20266 100644 --- a/libksirtet/base/field.cpp +++ b/libksirtet/base/field.cpp @@ -1,9 +1,9 @@ #include "field.h" -#include <qwhatsthis.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qpushbutton.h> +#include <tqwhatsthis.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqpushbutton.h> #include <klocale.h> #include <kcanvasrootpixmap.h> @@ -19,12 +19,12 @@ const char *BaseField::BUTTON_TEXTS[NB_BUTTON_TYPE] = { I18N_NOOP("Start"), I18N_NOOP("Resume"), I18N_NOOP("Proceed") }; -BaseField::BaseField(QWidget *w) +BaseField::BaseField(TQWidget *w) : _widget(w), _boardLayout(0), _label(0), _button(0) { - top = new QGridLayout(w, 3, 5, 10); + top = new TQGridLayout(w, 3, 5, 10); - lcds = new QGridLayout(7, 1, 5); + lcds = new TQGridLayout(7, 1, 5); top->addLayout(lcds, 1, 0); lcds->setRowStretch(1, 0); @@ -35,15 +35,15 @@ BaseField::BaseField(QWidget *w) } void BaseField::init(bool AI, bool multiplayer, bool server, bool first, - const QString &name) + const TQString &name) { _flags.AI = AI; _flags.multiplayer = multiplayer; _flags.server = server; _flags.first = first; - QString text = (AI ? i18n("%1\n(AI player)").arg(name) + TQString text = (AI ? i18n("%1\n(AI player)").arg(name) : (multiplayer ? i18n("%1\n(Human player)").arg(name) - : QString::null)); + : TQString::null)); if ( first && !server ) text += i18n("\nWaiting for server"); setMessage(text, (first && server ? StartButton : NoButton)); showScore->resetColor(); @@ -61,7 +61,7 @@ bool BaseField::isArcade() const return board->isArcade(); } -void BaseField::setMessage(const QString &label, ButtonType type) +void BaseField::setMessage(const TQString &label, ButtonType type) { delete _label; _label = 0; @@ -75,24 +75,24 @@ void BaseField::setMessage(const QString &label, ButtonType type) return; } - _boardLayout = new QVBoxLayout(board); + _boardLayout = new TQVBoxLayout(board); _boardLayout->addStretch(3); if ( !label.isEmpty() ) { - QString str = (isArcade() ? i18n("Arcade game") + '\n' - : QString::null) + label; - _label = new QLabel(str, board); + TQString str = (isArcade() ? i18n("Arcade game") + '\n' + : TQString::null) + label; + _label = new TQLabel(str, board); _label->setAlignment(Qt::AlignCenter); - _label->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + _label->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); _boardLayout->addWidget(_label, 0, Qt::AlignCenter); _label->show(); } _boardLayout->addStretch(1); if ( type!=NoButton ) { - _button = new QPushButton(i18n(BUTTON_TEXTS[type]), board); + _button = new TQPushButton(i18n(BUTTON_TEXTS[type]), board); _button->setFocus(); - const char *slot = (type==ResumeButton ? SLOT(pause()) - : SLOT(start())); - _button->connect(_button, SIGNAL(clicked()), + const char *slot = (type==ResumeButton ? TQT_SLOT(pause()) + : TQT_SLOT(start())); + _button->connect(_button, TQT_SIGNAL(clicked()), _widget->parent(), slot); _boardLayout->addWidget(_button, 0, Qt::AlignCenter); _button->show(); @@ -123,7 +123,7 @@ void BaseField::stop(bool gameover) { board->stop(); ButtonType button = StartButton; - QString msg = (gameover ? i18n("Game over") : QString::null); + TQString msg = (gameover ? i18n("Game over") : TQString::null); if ( board->isArcade() && board->arcadeStageDone() ) { if ( board->arcadeStage()==bfactory->bbi.nbArcadeStages ) msg = i18n("The End"); @@ -135,7 +135,7 @@ void BaseField::stop(bool gameover) setMessage(msg, button); } -void BaseField::gameOver(const KExtHighscore::Score &score, QWidget *parent) +void BaseField::gameOver(const KExtHighscore::Score &score, TQWidget *parent) { KNotifyClient::event(parent->winId(), "game over", i18n("Game Over")); KExtHighscore::submitScore(score, parent); @@ -146,7 +146,7 @@ void BaseField::scoreUpdated() showScore->display( (int)board->score() ); if (_flags.multiplayer) return; - QColor color; + TQColor color; if ( _firstScore<currentScore() ) color = Qt::red; else if ( _lastScore<currentScore() ) color = Qt::blue; showScore->setColor(color); @@ -154,7 +154,7 @@ void BaseField::scoreUpdated() void BaseField::settingsChanged() { - QColor color = BasePrefs::fadeColor(); + TQColor color = BasePrefs::fadeColor(); double s = BasePrefs::fadeIntensity(); _boardRootPixmap->setFadeEffect(s, color); board->canvas()->setBackgroundColor(color); |