summaryrefslogtreecommitdiffstats
path: root/kspaceduel/mainview.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
commit576eb4299a00bc053db35414406f46372a0f70f2 (patch)
tree4c030922d533821db464af566188e7d40cc8848c /kspaceduel/mainview.cpp
parent0718336b6017d1a4fc1d626544180a5a2a29ddec (diff)
downloadtdegames-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 'kspaceduel/mainview.cpp')
-rw-r--r--kspaceduel/mainview.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/kspaceduel/mainview.cpp b/kspaceduel/mainview.cpp
index 0d385a49..5448c1a3 100644
--- a/kspaceduel/mainview.cpp
+++ b/kspaceduel/mainview.cpp
@@ -1,9 +1,9 @@
#include "mainview.h"
#include <math.h>
-#include <qbitmap.h>
-#include <qfile.h>
-#include <qvbox.h>
+#include <tqbitmap.h>
+#include <tqfile.h>
+#include <tqvbox.h>
#include <kapplication.h>
#include <kaction.h>
@@ -18,20 +18,20 @@
KToggleAction *MyMainView::pauseAction = 0;
-MyMainView::MyMainView(QWidget *parent)
- :QWidget(parent),
+MyMainView::MyMainView(TQWidget *parent)
+ :TQWidget(parent),
field(DEF_WIDTH,DEF_HEIGHT),
view(&field,this)
{
int i,p;
setMinimumSize(600,400);
random.setSeed(0);
- QPixmap backgr(locate("appdata", MV_BACKGROUND));
+ TQPixmap backgr(locate("appdata", MV_BACKGROUND));
field.setBackgroundPixmap(backgr);
- view.setResizePolicy(QScrollView::AutoOne);
- view.setHScrollBarMode(QScrollView::AlwaysOff);
- view.setVScrollBarMode(QScrollView::AlwaysOff);
+ view.setResizePolicy(TQScrollView::AutoOne);
+ view.setHScrollBarMode(TQScrollView::AlwaysOff);
+ view.setVScrollBarMode(TQScrollView::AlwaysOff);
for(p=0;p<2;p++)
{
@@ -41,9 +41,9 @@ MyMainView::MyMainView(QWidget *parent)
minePut[p]=false;
}
- QString tmp = KGlobal::dirs()->findResourceDir("appdata", (QString)MV_BACKGROUND);
+ TQString tmp = KGlobal::dirs()->findResourceDir("appdata", (TQString)MV_BACKGROUND);
- QCanvasPixmapArray *sunsequence
+ TQCanvasPixmapArray *sunsequence
= loadOldPixmapSequence( tmp + MV_SUN_PPM, tmp + MV_SUN_PBM );
sun=new SunSprite(sunsequence, &field);
sun->move(width()/2-1,height()/2-1);
@@ -82,9 +82,9 @@ MyMainView::MyMainView(QWidget *parent)
{
// ship[i]->setBoundsAction(QwRealMobileSprite::Wrap);
ship[i]->hide();
- bullets[i]=new QPtrList<BulletSprite>;
+ bullets[i]=new TQPtrList<BulletSprite>;
bullets[i]->setAutoDelete(true);
- mines[i]=new QPtrList<MineSprite>;
+ mines[i]=new TQPtrList<MineSprite>;
mines[i]->setAutoDelete(true);
}
@@ -233,7 +233,7 @@ SConfig MyMainView::modifyConfig(SConfig conf)
return newConfig;
}
-void MyMainView::keyPressEvent(QKeyEvent *ev)
+void MyMainView::keyPressEvent(TQKeyEvent *ev)
{
if((gameEnd<=0.0)&&(gameEnd>-2.0))
{
@@ -297,7 +297,7 @@ void MyMainView::keyPressEvent(QKeyEvent *ev)
}
}
-void MyMainView::keyReleaseEvent(QKeyEvent *ev)
+void MyMainView::keyReleaseEvent(TQKeyEvent *ev)
{
KKey key(ev);
bool accept=true;
@@ -387,7 +387,7 @@ void MyMainView::togglePause( )
pause( );
}
-void MyMainView::resizeEvent(QResizeEvent *event)
+void MyMainView::resizeEvent(TQResizeEvent *event)
{
double mx,my;
MineSprite *mine;
@@ -397,7 +397,7 @@ void MyMainView::resizeEvent(QResizeEvent *event)
mx=(event->size().width()-event->oldSize().width())/2.0;
my=(event->size().height()-event->oldSize().height())/2.0;
- QWidget::resizeEvent(event);
+ TQWidget::resizeEvent(event);
view.resize(width(),height());
field.resize(width(),height());
@@ -491,7 +491,7 @@ void MyMainView::newRound()
}
field.update();
- QString str = i18n("Press %1 to start")
+ TQString str = i18n("Press %1 to start")
.arg(KShortcut(GAME_START_SHORTCUT).toString());
emit(setStatusText(str,IDS_MAIN));
emit( setStatusText( "", IDS_PAUSE ) );
@@ -509,7 +509,7 @@ void MyMainView::newGame()
newRound();
}
-void MyMainView::timerEvent(QTimerEvent *event)
+void MyMainView::timerEvent(TQTimerEvent *event)
{
unsigned w;
int i;
@@ -531,11 +531,11 @@ void MyMainView::timerEvent(QTimerEvent *event)
textSprite=0;
}
- textSprite=new QCanvasText(&field);
+ textSprite=new TQCanvasText(&field);
textSprite->move(width()/2,height()/2-90);
textSprite->setTextFlags(AlignCenter);
textSprite->setColor(qRgb(255,160,0));
- textSprite->setFont(QFont(KGlobalSettings::generalFont().family(),14));
+ textSprite->setFont(TQFont(KGlobalSettings::generalFont().family(),14));
textSprite->show( );
if(ship[0]->getHitPoints()==0)
{
@@ -556,7 +556,7 @@ void MyMainView::timerEvent(QTimerEvent *event)
ship[0]->setWins(w);
emit(wins(0,w));
}
- QString str = i18n("Press %1 for new round")
+ TQString str = i18n("Press %1 for new round")
.arg(KShortcut(GAME_START_SHORTCUT).toString());
emit(setStatusText(str,IDS_MAIN));
stop( );
@@ -789,17 +789,17 @@ void MyMainView::calculatePowerups()
void MyMainView::collisions()
{
int pl,hp,op,oldhp[2],ohp;
- QCanvasItemList unexact;
- QCanvasItem *sprite;
+ TQCanvasItemList unexact;
+ TQCanvasItem *sprite;
BulletSprite *bullet;
MineSprite *mine;
ExplosionSprite *expl;
ShipSprite *s;
PowerupSprite *power;
- QCanvasItemList hitlist;
+ TQCanvasItemList hitlist;
double ndx[2],ndy[2];
double en;
- QCanvasItemList::Iterator it;
+ TQCanvasItemList::Iterator it;
for(pl=0;pl<2;pl++)
{
@@ -990,7 +990,7 @@ void MyMainView::gameSetup()
return;
SettingsDialog *settings=new SettingsDialog(&customConfig,this,"settings");
- connect(settings, SIGNAL(settingsUpdated()),this,SLOT(closeSettings()));
+ connect(settings, TQT_SIGNAL(settingsUpdated()),this,TQT_SLOT(closeSettings()));
settings->show();
}
@@ -1001,17 +1001,17 @@ void MyMainView::closeSettings(){
config=modifyConfig(customConfig);
}
-QCanvasPixmapArray* MyMainView::loadOldPixmapSequence(const QString& datapattern,
- const QString& maskpattern, int framecount)
+TQCanvasPixmapArray* MyMainView::loadOldPixmapSequence(const TQString& datapattern,
+ const TQString& maskpattern, int framecount)
{
int image;
- QPtrList<QPixmap> pixmaplist;
- QPtrList<QPoint> pointlist;
- QString dataname, maskname;
- QPixmap *pix;
- QBitmap *bitmap;
+ TQPtrList<TQPixmap> pixmaplist;
+ TQPtrList<TQPoint> pointlist;
+ TQString dataname, maskname;
+ TQPixmap *pix;
+ TQBitmap *bitmap;
int hotx=0, hoty=0;
- QPoint *point;
+ TQPoint *point;
for( image=0; image < framecount; image++ )
{
@@ -1019,7 +1019,7 @@ QCanvasPixmapArray* MyMainView::loadOldPixmapSequence(const QString& datapattern
dataname.sprintf( datapattern.ascii(), image );
maskname.sprintf( maskpattern.ascii(), image );
- QFile file(dataname);
+ TQFile file(dataname);
if( file.open( IO_ReadOnly ) )
{
char line[128];
@@ -1034,18 +1034,18 @@ QCanvasPixmapArray* MyMainView::loadOldPixmapSequence(const QString& datapattern
file.readLine( line, 128 );
}
- point = new QPoint( hotx, hoty );
+ point = new TQPoint( hotx, hoty );
pointlist.append( point );
}
- pix = new QPixmap( dataname );
- bitmap = new QBitmap( maskname );
+ pix = new TQPixmap( dataname );
+ bitmap = new TQBitmap( maskname );
pix->setMask( *bitmap );
pixmaplist.append( pix );
}
- QCanvasPixmapArray* newarray = new QCanvasPixmapArray( pixmaplist, pointlist );
+ TQCanvasPixmapArray* newarray = new TQCanvasPixmapArray( pixmaplist, pointlist );
return newarray;
}