diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
commit | 838baf3f99ec5ab81b063eb5449a3381d860f377 (patch) | |
tree | dd31abcfde08ca92e4623b8f50b3d762a87c997a /libksirtet/common/misc_ui.cpp | |
parent | 2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff) | |
download | tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.tar.gz tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.zip |
TQt4 port kdegames
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1236074 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libksirtet/common/misc_ui.cpp')
-rw-r--r-- | libksirtet/common/misc_ui.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/libksirtet/common/misc_ui.cpp b/libksirtet/common/misc_ui.cpp index cf802e25..6e9cffec 100644 --- a/libksirtet/common/misc_ui.cpp +++ b/libksirtet/common/misc_ui.cpp @@ -24,8 +24,8 @@ const uint LED_HEIGHT = 15; const uint LED_SPACING = 5; /*****************************************************************************/ -ShowNextPiece::ShowNextPiece(BaseBoard *board, TQWidget *parent) - : FixedCanvasView(parent, "show_next_piece") +ShowNextPiece::ShowNextPiece(BaseBoard *board, TQWidget *tqparent) + : FixedCanvasView(tqparent, "show_next_piece") { setCanvas(board->next()); setFrameStyle(TQFrame::Panel | TQFrame::Sunken); @@ -33,15 +33,15 @@ ShowNextPiece::ShowNextPiece(BaseBoard *board, TQWidget *parent) } /*****************************************************************************/ -Shadow::Shadow(BaseBoard *board, TQWidget *parent) - : TQWidget(parent, "shadow"), _xOffset(board->frameWidth()), +Shadow::Shadow(BaseBoard *board, TQWidget *tqparent) + : TQWidget(tqparent, "shadow"), _xOffset(board->frameWidth()), _board(board), _show(false) { KZoomMainWindow::addWidget(this); connect(board, TQT_SIGNAL(updatePieceConfigSignal()), TQT_SLOT(update())); } -TQSize Shadow::sizeHint() const +TQSize Shadow::tqsizeHint() const { return TQSize(_xOffset + _board->matrix().width() * BasePrefs::blockSize(), SHADOW_HEIGHT); @@ -78,19 +78,19 @@ void Shadow::paintEvent(TQPaintEvent *) /*****************************************************************************/ -class Led : public QWidget +class Led : public TQWidget { public: - Led(const TQColor &c, TQWidget *parent) - : TQWidget(parent), col(c), _on(FALSE) {} + Led(const TQColor &c, TQWidget *tqparent) + : TQWidget(tqparent), col(c), _on(FALSE) {} TQSizePolicy sizePolicy() const { return TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed); } - TQSize sizeHint() const { return TQSize(LED_WIDTH, LED_HEIGHT); } + TQSize tqsizeHint() const { return TQSize(LED_WIDTH, LED_HEIGHT); } - void on() { if (!_on) { _on = TRUE; repaint(); } } - void off() { if (_on) {_on = FALSE; repaint(); } } - void setColor(const TQColor &c) { if (c!=col) { col = c; repaint(); } } + void on() { if (!_on) { _on = TRUE; tqrepaint(); } } + void off() { if (_on) {_on = FALSE; tqrepaint(); } } + void setColor(const TQColor &c) { if (c!=col) { col = c; tqrepaint(); } } protected: void paintEvent(TQPaintEvent *) { @@ -105,8 +105,8 @@ class Led : public QWidget bool _on; }; -GiftPool::GiftPool(TQWidget *parent) - : TQHBox(parent, "gift_pool"), nb(0), ready(false) +GiftPool::GiftPool(TQWidget *tqparent) + : TQHBox(tqparent, "gift_pool"), nb(0), ready(false) { setSpacing(LED_SPACING); leds.resize(cfactory->cbi.nbGiftLeds); @@ -114,9 +114,9 @@ GiftPool::GiftPool(TQWidget *parent) leds.insert(i, new Led(yellow, this)); } -TQSize GiftPool::sizeHint() const +TQSize GiftPool::tqsizeHint() const { - TQSize s = (leds.size() ? leds[0]->sizeHint() : TQSize()); + TQSize s = (leds.size() ? leds[0]->tqsizeHint() : TQSize()); return TQSize((s.width()+LED_SPACING)*leds.size()-LED_SPACING, s.height()); } @@ -131,9 +131,9 @@ void GiftPool::put(uint n) if ( nb==0 && !ready ) TQTimer::singleShot(cfactory->cbi.giftPoolTimeout, this, TQT_SLOT(timeout())); - uint e = QMIN(nb+n, leds.size()); + uint e = TQMIN(nb+n, leds.size()); for (uint i=nb; i<e; i++) leds[i]->on(); - uint f = QMIN(nb+n-e, leds.size()); + uint f = TQMIN(nb+n-e, leds.size()); for (uint i=0; i<f; i++) leds[i]->setColor(red); nb += n; } @@ -161,7 +161,7 @@ uint GiftPool::take() void GiftPool::reset() { - killTimers(); + TQT_TQOBJECT(this)->killTimers(); ready = false; nb = 0; for (uint i=0; i<leds.size(); i++) { @@ -171,10 +171,10 @@ void GiftPool::reset() } //----------------------------------------------------------------------------- -PlayerProgress::PlayerProgress(BaseBoard *board, TQWidget *parent, +PlayerProgress::PlayerProgress(BaseBoard *board, TQWidget *tqparent, const char *name) - : KGameProgress(0, board->matrix().height(), 0, KGameProgress::Vertical, - parent, name), _board(board) + : KGameProgress(0, board->matrix().height(), 0, Qt::Vertical, + tqparent, name), _board(board) { setBackgroundColor(lightGray); setTextEnabled(false); @@ -182,7 +182,7 @@ PlayerProgress::PlayerProgress(BaseBoard *board, TQWidget *parent, KZoomMainWindow::addWidget(this); } -TQSize PlayerProgress::sizeHint() const +TQSize PlayerProgress::tqsizeHint() const { return TQSize(10, _board->matrix().height() * BasePrefs::blockSize()) + 2 * TQSize(frameWidth(), frameWidth()); |