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 /klines/klines.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 'klines/klines.cpp')
-rw-r--r-- | klines/klines.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/klines/klines.cpp b/klines/klines.cpp index 50d96163..848f6ffa 100644 --- a/klines/klines.cpp +++ b/klines/klines.cpp @@ -64,10 +64,10 @@ KLines::KLines() setCentralWidget( mwidget ); lsb = mwidget->GetLsb(); - connect(lsb, TQT_SIGNAL(endTurn()), this, TQT_SLOT(makeTurn())); - connect(lsb, TQT_SIGNAL(eraseLine(int)), this, TQT_SLOT(addScore(int))); - connect(lsb, TQT_SIGNAL(endGame()), this, TQT_SLOT(endGame())); - connect(lsb, TQT_SIGNAL(userTurn()), this, TQT_SLOT(userTurn())); + connect(lsb, TQT_SIGNAL(endTurn()), TQT_TQOBJECT(this), TQT_SLOT(makeTurn())); + connect(lsb, TQT_SIGNAL(eraseLine(int)), TQT_TQOBJECT(this), TQT_SLOT(addScore(int))); + connect(lsb, TQT_SIGNAL(endGame()), TQT_TQOBJECT(this), TQT_SLOT(endGame())); + connect(lsb, TQT_SIGNAL(userTurn()), TQT_TQOBJECT(this), TQT_SLOT(userTurn())); lPrompt = mwidget->GetPrompt(); @@ -82,9 +82,9 @@ KLines::KLines() initKAction(); - connect(&demoTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotDemo())); + connect(&demoTimer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(slotDemo())); - setFocusPolicy(StrongFocus); + setFocusPolicy(TQ_StrongFocus); setFocus(); startGame(); @@ -104,18 +104,18 @@ KLines::~KLines() */ void KLines::initKAction() { - KStdGameAction::gameNew(this, TQT_SLOT(startGame()), actionCollection()); - act_demo = KStdGameAction::demo(this, TQT_SLOT(startDemo()), actionCollection()); + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(startGame()), actionCollection()); + act_demo = KStdGameAction::demo(TQT_TQOBJECT(this), TQT_SLOT(startDemo()), actionCollection()); act_demo->setText(i18n("Start &Tutorial")); - KStdGameAction::highscores(this, TQT_SLOT(viewHighScore()), actionCollection()); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); - endTurnAction = KStdGameAction::endTurn(this, TQT_SLOT(makeTurn()), actionCollection()); + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(viewHighScore()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + endTurnAction = KStdGameAction::endTurn(TQT_TQOBJECT(this), TQT_SLOT(makeTurn()), actionCollection()); showNextAction = new KToggleAction(i18n("&Show Next"), KShortcut(CTRL+Key_P), - this, TQT_SLOT(switchPrompt()), actionCollection(), "options_show_next"); + TQT_TQOBJECT(this), TQT_SLOT(switchPrompt()), actionCollection(), "options_show_next"); showNextAction->setCheckedState(i18n("Hide Next")); showNumberedAction = new KToggleAction(i18n("&Use Numbered Balls"), KShortcut(), - this, TQT_SLOT(switchNumbered()), actionCollection(), "options_show_numbered"); - undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); + TQT_TQOBJECT(this), TQT_SLOT(switchNumbered()), actionCollection(), "options_show_numbered"); + undoAction = KStdGameAction::undo(TQT_TQOBJECT(this), TQT_SLOT(undo()), actionCollection()); levelAction = KStdGameAction::chooseGameType(0, 0, actionCollection()); TQStringList items; @@ -128,11 +128,11 @@ void KLines::initKAction() showNumberedAction->setChecked(Prefs::numberedBalls()); lPrompt->setPrompt(Prefs::showNext()); - (void)new KAction(i18n("Move Left"), Key_Left, lsb, TQT_SLOT(moveLeft()), actionCollection(), "left"); - (void)new KAction(i18n("Move Right"), Key_Right, lsb, TQT_SLOT(moveRight()), actionCollection(), "right"); - (void)new KAction(i18n("Move Up"), Key_Up, lsb, TQT_SLOT(moveUp()), actionCollection(), "up"); - (void)new KAction(i18n("Move Down"), Key_Down, lsb, TQT_SLOT(moveDown()), actionCollection(), "down"); - (void)new KAction(i18n("Move Ball"), Key_Space, lsb, TQT_SLOT(placePlayerBall()), actionCollection(), "place_ball"); + (void)new KAction(i18n("Move Left"), Key_Left, TQT_TQOBJECT(lsb), TQT_SLOT(moveLeft()), actionCollection(), "left"); + (void)new KAction(i18n("Move Right"), Key_Right, TQT_TQOBJECT(lsb), TQT_SLOT(moveRight()), actionCollection(), "right"); + (void)new KAction(i18n("Move Up"), Key_Up, TQT_TQOBJECT(lsb), TQT_SLOT(moveUp()), actionCollection(), "up"); + (void)new KAction(i18n("Move Down"), Key_Down, TQT_TQOBJECT(lsb), TQT_SLOT(moveDown()), actionCollection(), "down"); + (void)new KAction(i18n("Move Ball"), Key_Space, TQT_TQOBJECT(lsb), TQT_SLOT(placePlayerBall()), actionCollection(), "place_ball"); setupGUI( KMainWindow::Save | Keys | StatusBar | Create ); } @@ -164,7 +164,7 @@ void KLines::startGame() void KLines::setLevel(int level) { levelStr = i18n(LEVEL[level+2]); - statusBar()->changeItem(i18n(" Level: %1").arg(levelStr), 0); + statusBar()->changeItem(i18n(" Level: %1").tqarg(levelStr), 0); } void KLines::startDemo() @@ -183,7 +183,7 @@ void KLines::startDemo() bFirst = true; levelStr = i18n("Tutorial"); - statusBar()->changeItem(i18n(" Level: %1").arg(levelStr), 0); + statusBar()->changeItem(i18n(" Level: %1").tqarg(levelStr), 0); lsb->startDemoMode(); lsb->setGameOver(false); @@ -202,7 +202,7 @@ void KLines::stopDemo() bDemo = false; lsb->hideDemoText(); demoTimer.stop(); - statusBar()->changeItem(i18n(" Level: %1").arg(i18n("Tutorial - Stopped")), 0); + statusBar()->changeItem(i18n(" Level: %1").tqarg(i18n("Tutorial - Stopped")), 0); act_demo->setText(i18n("Start &Tutorial")); } @@ -380,7 +380,7 @@ void KLines::slotDemo() if (!msg.isEmpty()) { lsb->showDemoText(msg); - demoTimer.start(3500 + msg.contains("\n")*1500, true); + demoTimer.start(3500 + msg.tqcontains("\n")*1500, true); return; } if (newBalls) @@ -419,7 +419,7 @@ void KLines::focusOutEvent(TQFocusEvent *ev) { lsb->hideDemoText(); demoTimer.stop(); - statusBar()->changeItem(i18n(" Level: %1").arg(i18n("Tutorial - Paused")), 0); + statusBar()->changeItem(i18n(" Level: %1").tqarg(i18n("Tutorial - Paused")), 0); } KMainWindow::focusOutEvent(ev); } @@ -428,7 +428,7 @@ void KLines::focusInEvent(TQFocusEvent *ev) { if (bDemo) { - statusBar()->changeItem(i18n(" Level: %1").arg(levelStr), 0); + statusBar()->changeItem(i18n(" Level: %1").tqarg(levelStr), 0); slotDemo(); } KMainWindow::focusInEvent(ev); @@ -528,7 +528,7 @@ void KLines::addScore(int ballsErased) void KLines::updateStat() { - statusBar()->changeItem(i18n(" Score: %1").arg(score), 1); + statusBar()->changeItem(i18n(" Score: %1").tqarg(score), 1); } void KLines::viewHighScore() @@ -540,7 +540,7 @@ void KLines::viewHighScore() void KLines::endGame() { lsb->setGameOver(true); - lsb->repaint(false); + lsb->tqrepaint(false); if (bDemo) return; @@ -575,7 +575,7 @@ void KLines::switchUndo(bool bu) void KLines::keyPressEvent(TQKeyEvent *e) { - if (lsb->gameOver() && (e->key() == Qt::Key_Space)) + if (lsb->gameOver() && (e->key() == TQt::Key_Space)) { e->accept(); startGame(); |