summaryrefslogtreecommitdiffstats
path: root/kasteroids/toplevel.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
commit838baf3f99ec5ab81b063eb5449a3381d860f377 (patch)
treedd31abcfde08ca92e4623b8f50b3d762a87c997a /kasteroids/toplevel.cpp
parent2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff)
downloadtdegames-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 'kasteroids/toplevel.cpp')
-rw-r--r--kasteroids/toplevel.cpp76
1 files changed, 38 insertions, 38 deletions
diff --git a/kasteroids/toplevel.cpp b/kasteroids/toplevel.cpp
index d9a22a2b..ffc6b8e2 100644
--- a/kasteroids/toplevel.cpp
+++ b/kasteroids/toplevel.cpp
@@ -29,7 +29,7 @@
#include "toplevel.moc"
-#if defined Q_WS_X11 && ! defined K_WS_QTONLY
+#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY
#include <X11/Xlib.h>
#endif
#include <fixx11h.h>
@@ -102,7 +102,7 @@ KAstTopLevel::KAstTopLevel()
label = new TQLabel( i18n("Score"), mainWin );
label->setFont( labelFont );
label->setPalette( pal );
- label->setFixedWidth( label->sizeHint().width() );
+ label->setFixedWidth( label->tqsizeHint().width() );
hb->addWidget( label );
scoreLCD = new TQLCDNumber( 6, mainWin );
@@ -116,7 +116,7 @@ KAstTopLevel::KAstTopLevel()
label = new TQLabel( i18n("Level"), mainWin );
label->setFont( labelFont );
label->setPalette( pal );
- label->setFixedWidth( label->sizeHint().width() );
+ label->setFixedWidth( label->tqsizeHint().width() );
hb->addWidget( label );
levelLCD = new TQLCDNumber( 2, mainWin );
@@ -129,7 +129,7 @@ KAstTopLevel::KAstTopLevel()
label = new TQLabel( i18n("Ships"), mainWin );
label->setFont( labelFont );
- label->setFixedWidth( label->sizeHint().width() );
+ label->setFixedWidth( label->tqsizeHint().width() );
label->setPalette( pal );
hb->addWidget( label );
@@ -151,7 +151,7 @@ KAstTopLevel::KAstTopLevel()
vb->addWidget( view, 10 );
-// -- bottom layout:
+// -- bottom tqlayout:
TQFrame *sep2 = new TQFrame( mainWin );
sep2->setMaximumHeight( 1 );
sep2->setFrameStyle( TQFrame::HLine | TQFrame::Raised );
@@ -168,7 +168,7 @@ KAstTopLevel::KAstTopLevel()
/*
label = new TQLabel( i18n( "T" ), mainWin );
label->setFont( smallFont );
- label->setFixedWidth( label->sizeHint().width() );
+ label->setFixedWidth( label->tqsizeHint().width() );
label->setPalette( pal );
hbd->addWidget( label );
@@ -184,7 +184,7 @@ KAstTopLevel::KAstTopLevel()
TQPixmap pm( sprites_prefix + "powerups/brake.png" );
label = new TQLabel( mainWin );
label->setPixmap( pm );
- label->setFixedWidth( label->sizeHint().width() );
+ label->setFixedWidth( label->tqsizeHint().width() );
label->setPalette( pal );
hbd->addWidget( label );
@@ -200,7 +200,7 @@ KAstTopLevel::KAstTopLevel()
pm.load( sprites_prefix + "powerups/shield.png" );
label = new TQLabel( mainWin );
label->setPixmap( pm );
- label->setFixedWidth( label->sizeHint().width() );
+ label->setFixedWidth( label->tqsizeHint().width() );
label->setPalette( pal );
hbd->addWidget( label );
@@ -216,7 +216,7 @@ KAstTopLevel::KAstTopLevel()
pm.load( sprites_prefix + "powerups/shoot.png" );
label = new TQLabel( mainWin );
label->setPixmap( pm );
- label->setFixedWidth( label->sizeHint().width() );
+ label->setFixedWidth( label->tqsizeHint().width() );
label->setPalette( pal );
hbd->addWidget( label );
@@ -231,7 +231,7 @@ KAstTopLevel::KAstTopLevel()
label = new TQLabel( i18n( "Fuel" ), mainWin );
label->setFont( smallFont );
- label->setFixedWidth( label->sizeHint().width() + 10 );
+ label->setFixedWidth( label->tqsizeHint().width() + 10 );
label->setPalette( pal );
hbd->addWidget( label );
@@ -252,7 +252,7 @@ KAstTopLevel::KAstTopLevel()
setupGUI( KMainWindow::Save | Create );
- setFocusPolicy( StrongFocus );
+ setFocusPolicy( TQ_StrongFocus );
setFocus();
#ifdef KA_ENABLE_SOUND
@@ -267,7 +267,7 @@ KAstTopLevel::KAstTopLevel()
KAstTopLevel::~KAstTopLevel()
{
-#if defined Q_WS_X11 && ! defined K_WS_QTONLY
+#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY
XAutoRepeatOn( qt_xdisplay() );
#endif
soundDict.setAutoDelete(true);
@@ -280,24 +280,24 @@ KAstTopLevel::~KAstTopLevel()
void KAstTopLevel::initKAction()
{
// game
- KStdGameAction::gameNew( this, TQT_SLOT( slotNewGame() ), actionCollection() );
- KStdGameAction::highscores( this, TQT_SLOT( slotShowHighscores() ), actionCollection() );
- KStdGameAction::pause( this, TQT_SLOT( slotPause() ), actionCollection() );
- KStdGameAction::quit(this, TQT_SLOT( close() ), actionCollection());
+ KStdGameAction::gameNew( TQT_TQOBJECT(this), TQT_SLOT( slotNewGame() ), actionCollection() );
+ KStdGameAction::highscores( TQT_TQOBJECT(this), TQT_SLOT( slotShowHighscores() ), actionCollection() );
+ KStdGameAction::pause( TQT_TQOBJECT(this), TQT_SLOT( slotPause() ), actionCollection() );
+ KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT( close() ), actionCollection());
// settings
- KStdAction::keyBindings(this, TQT_SLOT( slotKeyConfig() ), actionCollection());
- KStdAction::preferences(this, TQT_SLOT( slotPref() ), actionCollection());
+ KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT( slotKeyConfig() ), actionCollection());
+ KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT( slotPref() ), actionCollection());
// keyboard-only actions
- keycodes.insert(Thrust, new KAction(i18n("Thrust"), Qt::Key_Up, 0, 0, actionCollection(), "Thrust"));
- keycodes.insert(RotateLeft, new KAction(i18n("Rotate Left"), Qt::Key_Left, 0, 0, actionCollection(), "RotateLeft"));
- keycodes.insert(RotateRight, new KAction(i18n("Rotate Right"), Qt::Key_Right, 0, 0, actionCollection(), "RotateRight"));
- keycodes.insert(Shoot, new KAction(i18n("Shoot"), Qt::Key_Space, 0, 0, actionCollection(), "Shoot"));
-// keycodes.insert(Teleport, new KAction(i18n("Teleport"), Qt::Key_Z, 0, 0, actionCollection(), "Teleport"));
- keycodes.insert(Brake, new KAction(i18n("Brake"), Qt::Key_X, 0, 0, actionCollection(), "Brake"));
- keycodes.insert(Shield, new KAction(i18n("Shield"), Qt::Key_S, 0, 0, actionCollection(), "Shield"));
- launchAction = new KAction(i18n("Launch"), Qt::Key_L, this, TQT_SLOT(slotLaunch()), actionCollection(), "Launch");
+ keycodes.insert(Thrust, new KAction(i18n("Thrust"), TQt::Key_Up, 0, 0, actionCollection(), "Thrust"));
+ keycodes.insert(RotateLeft, new KAction(i18n("Rotate Left"), TQt::Key_Left, 0, 0, actionCollection(), "RotateLeft"));
+ keycodes.insert(RotateRight, new KAction(i18n("Rotate Right"), TQt::Key_Right, 0, 0, actionCollection(), "RotateRight"));
+ keycodes.insert(Shoot, new KAction(i18n("Shoot"), TQt::Key_Space, 0, 0, actionCollection(), "Shoot"));
+// keycodes.insert(Teleport, new KAction(i18n("Teleport"), TQt::Key_Z, 0, 0, actionCollection(), "Teleport"));
+ keycodes.insert(Brake, new KAction(i18n("Brake"), TQt::Key_X, 0, 0, actionCollection(), "Brake"));
+ keycodes.insert(Shield, new KAction(i18n("Shield"), TQt::Key_S, 0, 0, actionCollection(), "Shield"));
+ launchAction = new KAction(i18n("Launch"), TQt::Key_L, TQT_TQOBJECT(this), TQT_SLOT(slotLaunch()), actionCollection(), "Launch");
}
@@ -336,7 +336,7 @@ return; // remove this and the above when the sound below is working correctly
bool KAstTopLevel::eventFilter( TQObject* /* object */, TQEvent *event )
{
- TQKeyEvent *e = static_cast<TQKeyEvent*>(event);
+ TQKeyEvent *e = TQT_TQKEYEVENT(event);
if (event->type() == TQEvent::AccelOverride)
{
if (processKeyPress(e)) return true;
@@ -457,7 +457,7 @@ bool KAstTopLevel::processKeyRelease( TQKeyEvent *event )
void KAstTopLevel::focusInEvent( TQFocusEvent *e )
{
view->pause( false );
-#if defined Q_WS_X11 && ! defined K_WS_QTONLY
+#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY
XAutoRepeatOff( qt_xdisplay() );
#endif
KMainWindow::focusInEvent(e);
@@ -466,7 +466,7 @@ void KAstTopLevel::focusInEvent( TQFocusEvent *e )
void KAstTopLevel::focusOutEvent( TQFocusEvent *e )
{
view->pause( true );
-#if defined Q_WS_X11 && ! defined K_WS_QTONLY
+#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY
XAutoRepeatOn( qt_xdisplay() );
#endif
KMainWindow::focusOutEvent(e);
@@ -484,7 +484,7 @@ void KAstTopLevel::slotNewGame()
view->setRockSpeed( levels[0].rockSpeed );
view->addRocks( levels[0].nrocks );
view->showText( i18n( "Press %1 to launch." )
- .arg(launchAction->shortcut().seq(0).toString()),
+ .tqarg(launchAction->shortcut().seq(0).toString()),
yellow );
waitShip = true;
gameOver = false;
@@ -492,7 +492,7 @@ void KAstTopLevel::slotNewGame()
bool KAstTopLevel::queryExit()
{
-#if defined Q_WS_X11 && ! defined K_WS_QTONLY
+#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY
XAutoRepeatOn( qt_xdisplay() );
#endif
return true;
@@ -509,7 +509,7 @@ void KAstTopLevel::slotShipKilled()
{
waitShip = true;
view->showText( i18n( "Ship Destroyed. Press %1 to launch.")
- .arg(launchAction->shortcut().seq(0).toString()),
+ .tqarg(launchAction->shortcut().seq(0).toString()),
yellow );
}
else
@@ -529,7 +529,7 @@ void KAstTopLevel::slotShipKilled()
}
else
{
- TQTimer::singleShot(1000, this, TQT_SLOT(slotGameOver()));
+ TQTimer::singleShot(1000, TQT_TQOBJECT(this), TQT_SLOT(slotGameOver()));
}
}
}
@@ -577,7 +577,7 @@ void KAstTopLevel::slotKeyConfig()
{
KKeyDialog::configure( actionCollection(), this );
if ( waitShip ) view->showText( i18n( "Press %1 to launch." )
- .arg(launchAction->shortcut().seq(0).toString()),
+ .tqarg(launchAction->shortcut().seq(0).toString()),
yellow, false );
}
@@ -613,7 +613,7 @@ void KAstTopLevel::slotPref()
/* Done */
dialog->addPage(w, i18n("General"), "package_settings");
- connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(loadSettings()));
+ connect(dialog, TQT_SIGNAL(settingsChanged()), TQT_TQOBJECT(this), TQT_SLOT(loadSettings()));
dialog->show();
}
@@ -637,9 +637,9 @@ void KAstTopLevel::doStats()
" Hit:\t%2\n"
" Missed:\t%3\n"
"Hit ratio:\t%4 %\t\t")
- .arg(view->shots()).arg(view->hits())
- .arg(view->shots() - view->hits())
- .arg(r);
+ .tqarg(view->shots()).tqarg(view->hits())
+ .tqarg(view->shots() - view->hits())
+ .tqarg(r);
view->showText( s, green, FALSE );
}