summaryrefslogtreecommitdiffstats
path: root/kspaceduel/mainview.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 /kspaceduel/mainview.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 'kspaceduel/mainview.cpp')
-rw-r--r--kspaceduel/mainview.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/kspaceduel/mainview.cpp b/kspaceduel/mainview.cpp
index 5448c1a3..ea17594d 100644
--- a/kspaceduel/mainview.cpp
+++ b/kspaceduel/mainview.cpp
@@ -18,8 +18,8 @@
KToggleAction *MyMainView::pauseAction = 0;
-MyMainView::MyMainView(TQWidget *parent)
- :TQWidget(parent),
+MyMainView::MyMainView(TQWidget *tqparent)
+ :TQWidget(tqparent),
field(DEF_WIDTH,DEF_HEIGHT),
view(&field,this)
{
@@ -27,7 +27,7 @@ MyMainView::MyMainView(TQWidget *parent)
setMinimumSize(600,400);
random.setSeed(0);
TQPixmap backgr(locate("appdata", MV_BACKGROUND));
- field.setBackgroundPixmap(backgr);
+ field.tqsetBackgroundPixmap(backgr);
view.setResizePolicy(TQScrollView::AutoOne);
view.setHScrollBarMode(TQScrollView::AlwaysOff);
@@ -99,7 +99,7 @@ MyMainView::MyMainView(TQWidget *parent)
MyMainView::~MyMainView()
{
- killTimers();
+ TQT_TQOBJECT(this)->killTimers();
writeConfig();
}
@@ -340,7 +340,7 @@ void MyMainView::pause()
pauseAction->setChecked( true );
waitForStart=true;
- killTimers();
+ TQT_TQOBJECT(this)->killTimers();
emit setStatusText(i18n(" paused "), IDS_PAUSE);
}
}
@@ -375,7 +375,7 @@ void MyMainView::stop()
pauseAction->setEnabled( false );
pauseAction->setChecked( false );
- killTimers();
+ TQT_TQOBJECT(this)->killTimers();
waitForStart = true;
}
@@ -444,7 +444,7 @@ void MyMainView::newRound()
timeToNextPowerup=random.getDouble() * config.powerupRefreshTime;
powerups.clear();
- killTimers();
+ TQT_TQOBJECT(this)->killTimers();
mx=width()/2.0;
my=height()/2.0;
ship[0]->move(mx+config.startPosX,my+config.startPosY);
@@ -492,7 +492,7 @@ void MyMainView::newRound()
field.update();
TQString str = i18n("Press %1 to start")
- .arg(KShortcut(GAME_START_SHORTCUT).toString());
+ .tqarg(KShortcut(GAME_START_SHORTCUT).toString());
emit(setStatusText(str,IDS_MAIN));
emit( setStatusText( "", IDS_PAUSE ) );
stop( );
@@ -517,7 +517,7 @@ void MyMainView::timerEvent(TQTimerEvent *event)
if(event->timerId()==timerID)
{
- killTimers();
+ TQT_TQOBJECT(this)->killTimers();
if(gameEnd>0.0)
{
gameEnd-=1.0;
@@ -534,7 +534,7 @@ void MyMainView::timerEvent(TQTimerEvent *event)
textSprite=new TQCanvasText(&field);
textSprite->move(width()/2,height()/2-90);
textSprite->setTextFlags(AlignCenter);
- textSprite->setColor(qRgb(255,160,0));
+ textSprite->setColor(tqRgb(255,160,0));
textSprite->setFont(TQFont(KGlobalSettings::generalFont().family(),14));
textSprite->show( );
if(ship[0]->getHitPoints()==0)
@@ -557,7 +557,7 @@ void MyMainView::timerEvent(TQTimerEvent *event)
emit(wins(0,w));
}
TQString str = i18n("Press %1 for new round")
- .arg(KShortcut(GAME_START_SHORTCUT).toString());
+ .tqarg(KShortcut(GAME_START_SHORTCUT).toString());
emit(setStatusText(str,IDS_MAIN));
stop( );
}
@@ -815,7 +815,7 @@ void MyMainView::collisions()
if((sprite->rtti()!=S_EXPLOSION)
&& !((sprite->rtti()!=S_SUN)&&(ship[pl]->getHitPoints()==0)))
if(ship[pl]->collidesWith(sprite))
- if(!hitlist.contains(sprite))
+ if(!hitlist.tqcontains(sprite))
hitlist.append(sprite);
}
@@ -906,7 +906,7 @@ void MyMainView::collisions()
sprite = (*it);
if(sprite->rtti()==S_BULLET)
if(mine->collidesWith(sprite))
- if(!hitlist.contains(sprite))
+ if(!hitlist.tqcontains(sprite))
hitlist.append(sprite);
}
if(hitlist.count()>0)
@@ -932,13 +932,13 @@ void MyMainView::collisions()
{
case S_BULLET:
if(sun->collidesWith(sprite))
- if(!hitlist.contains(sprite))
+ if(!hitlist.tqcontains(sprite))
hitlist.append(sprite);
break;
case S_MINE:
if(!((MobileSprite*)sprite)->isStopped())
if(sun->collidesWith(sprite))
- if(!hitlist.contains(sprite))
+ if(!hitlist.tqcontains(sprite))
hitlist.append(sprite);
break;
}
@@ -1002,12 +1002,12 @@ void MyMainView::closeSettings(){
}
TQCanvasPixmapArray* MyMainView::loadOldPixmapSequence(const TQString& datapattern,
- const TQString& maskpattern, int framecount)
+ const TQString& tqmaskpattern, int framecount)
{
int image;
TQPtrList<TQPixmap> pixmaplist;
TQPtrList<TQPoint> pointlist;
- TQString dataname, maskname;
+ TQString dataname, tqmaskname;
TQPixmap *pix;
TQBitmap *bitmap;
int hotx=0, hoty=0;
@@ -1015,9 +1015,9 @@ TQCanvasPixmapArray* MyMainView::loadOldPixmapSequence(const TQString& datapatte
for( image=0; image < framecount; image++ )
{
- // #### Why is this a QString??
+ // #### Why is this a TQString??
dataname.sprintf( datapattern.ascii(), image );
- maskname.sprintf( maskpattern.ascii(), image );
+ tqmaskname.sprintf( tqmaskpattern.ascii(), image );
TQFile file(dataname);
if( file.open( IO_ReadOnly ) )
@@ -1039,7 +1039,7 @@ TQCanvasPixmapArray* MyMainView::loadOldPixmapSequence(const TQString& datapatte
}
pix = new TQPixmap( dataname );
- bitmap = new TQBitmap( maskname );
+ bitmap = new TQBitmap( tqmaskname );
pix->setMask( *bitmap );
pixmaplist.append( pix );