summaryrefslogtreecommitdiffstats
path: root/konquest/map_widget.cc
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 /konquest/map_widget.cc
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 'konquest/map_widget.cc')
-rw-r--r--konquest/map_widget.cc84
1 files changed, 42 insertions, 42 deletions
diff --git a/konquest/map_widget.cc b/konquest/map_widget.cc
index 9bb1a632..a8aa33de 100644
--- a/konquest/map_widget.cc
+++ b/konquest/map_widget.cc
@@ -1,6 +1,6 @@
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <qcolor.h>
+#include <tqpixmap.h>
+#include <tqpainter.h>
+#include <tqcolor.h>
#include <kapplication.h>
#include <kiconloader.h>
@@ -9,8 +9,8 @@
#include <kglobal.h>
#include "map_widget.moc"
-ConquestMap::ConquestMap( Map *newMap, QWidget *parent )
- : QGridView( parent ),
+ConquestMap::ConquestMap( Map *newMap, TQWidget *parent )
+ : TQGridView( parent ),
SECTOR_HEIGHT( 28 ), SECTOR_WIDTH( 28 ),
BOARD_HEIGHT( newMap->getRows() * SECTOR_HEIGHT ),
BOARD_WIDTH( newMap->getColumns() * SECTOR_WIDTH ),
@@ -32,10 +32,10 @@ ConquestMap::ConquestMap( Map *newMap, QWidget *parent )
setMinimumSize( BOARD_HEIGHT, BOARD_WIDTH );
setMaximumSize( BOARD_HEIGHT, BOARD_WIDTH );
- connect( map, SIGNAL( update() ), this, SLOT( mapUpdate() ) );
+ connect( map, TQT_SIGNAL( update() ), this, TQT_SLOT( mapUpdate() ) );
- QTimer *timer = new QTimer( this );
- connect( timer, SIGNAL(timeout()), this, SLOT(squareBlink()) );
+ TQTimer *timer = new TQTimer( this );
+ connect( timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(squareBlink()) );
timer->start( 500, false );
viewport()->setMouseTracking( true );
@@ -52,7 +52,7 @@ ConquestMap::~ConquestMap()
void
-ConquestMap::contentsMousePressEvent( QMouseEvent *e )
+ConquestMap::contentsMousePressEvent( TQMouseEvent *e )
{
int row, col;
@@ -66,7 +66,7 @@ ConquestMap::contentsMousePressEvent( QMouseEvent *e )
}
void
-ConquestMap::contentsMouseMoveEvent( QMouseEvent *e )
+ConquestMap::contentsMouseMoveEvent( TQMouseEvent *e )
{
// highlight the square under the mouse
int row, col;
@@ -82,7 +82,7 @@ ConquestMap::contentsMouseMoveEvent( QMouseEvent *e )
if( (hiLiteRow != -1) && (hiLiteCol != -1) ) {
- QPainter p( viewport() );
+ TQPainter p( viewport() );
p.translate( hiLiteCol * cellWidth(), hiLiteRow * cellHeight() );
@@ -94,7 +94,7 @@ ConquestMap::contentsMouseMoveEvent( QMouseEvent *e )
}
if( map->getSector( row, col ).hasPlanet() ) {
- QPainter p( viewport() );
+ TQPainter p( viewport() );
p.translate( col * cellWidth(),row * cellHeight() );
@@ -116,7 +116,7 @@ ConquestMap::unselectPlanet()
void
-ConquestMap::paintCell( QPainter *p, int row, int col )
+ConquestMap::paintCell( TQPainter *p, int row, int col )
{
drawSector( p, map->getSector( row, col ) );
}
@@ -128,7 +128,7 @@ ConquestMap::squareBlink()
int row, col;
if( map->selectedSector( row, col ) ) {
- QPainter p( this, true );
+ TQPainter p( this, true );
p.translate( col * cellWidth(), row * cellHeight() );
@@ -154,13 +154,13 @@ ConquestMap::mapUpdate()
void
-ConquestMap::drawSector( QPainter *p, Sector &sector, bool borderStrobe, bool highlight )
+ConquestMap::drawSector( TQPainter *p, Sector &sector, bool borderStrobe, bool highlight )
{
- QColor labelColor( white );
- QPoint labelCorner;
+ TQColor labelColor( white );
+ TQPoint labelCorner;
if( sector.hasPlanet() ) {
- QPixmap pm;
+ TQPixmap pm;
// simple (pathetic) way to "randomize"
// the planet graphic
@@ -168,49 +168,49 @@ ConquestMap::drawSector( QPainter *p, Sector &sector, bool borderStrobe, bool hi
// name more visible (hard coded pixel offsets)
switch( ((sector.getRow()+sector.getColumn()) % 9) + 1 ) {
case 1 :
- pm = QPixmap( IMAGE_PLANET_1 );
- labelCorner = QPoint( 18, 14 );
+ pm = TQPixmap( IMAGE_PLANET_1 );
+ labelCorner = TQPoint( 18, 14 );
break;
case 2 :
- pm = QPixmap( IMAGE_PLANET_2 );
- labelCorner = QPoint( 2, 14 );
+ pm = TQPixmap( IMAGE_PLANET_2 );
+ labelCorner = TQPoint( 2, 14 );
break;
case 3 :
- pm = QPixmap( IMAGE_PLANET_3 );
- labelCorner = QPoint( 2, 26 );
+ pm = TQPixmap( IMAGE_PLANET_3 );
+ labelCorner = TQPoint( 2, 26 );
break;
case 4 :
- pm = QPixmap( IMAGE_PLANET_4 );
- labelCorner = QPoint( 18, 26 );
+ pm = TQPixmap( IMAGE_PLANET_4 );
+ labelCorner = TQPoint( 18, 26 );
break;
case 5 :
- pm = QPixmap( IMAGE_PLANET_5 );
- labelCorner = QPoint( 18, 26 );
+ pm = TQPixmap( IMAGE_PLANET_5 );
+ labelCorner = TQPoint( 18, 26 );
break;
case 6 :
- pm = QPixmap( IMAGE_PLANET_6 );
- labelCorner = QPoint( 18, 26 );
+ pm = TQPixmap( IMAGE_PLANET_6 );
+ labelCorner = TQPoint( 18, 26 );
break;
case 7 :
- pm = QPixmap( IMAGE_PLANET_7 );
- labelCorner = QPoint( 18, 26 );
+ pm = TQPixmap( IMAGE_PLANET_7 );
+ labelCorner = TQPoint( 18, 26 );
break;
case 8 :
- pm = QPixmap( IMAGE_PLANET_8 );
- labelCorner = QPoint( 18, 26 );
+ pm = TQPixmap( IMAGE_PLANET_8 );
+ labelCorner = TQPoint( 18, 26 );
break;
case 9 :
- pm = QPixmap( IMAGE_PLANET_9 );
- labelCorner = QPoint( 18, 26 );
+ pm = TQPixmap( IMAGE_PLANET_9 );
+ labelCorner = TQPoint( 18, 26 );
break;
}
- QPoint pos;
+ TQPoint pos;
pos.setX( ( SECTOR_HEIGHT / 2 ) - ( pm.height() / 2 ) );
pos.setY( ( SECTOR_WIDTH / 2 ) - ( pm.width() / 2 ) );
- p->drawPixmap( pos, pm, QRect(0, 0, pm.height(), pm.width() ) );
+ p->drawPixmap( pos, pm, TQRect(0, 0, pm.height(), pm.width() ) );
p->setFont( labelFont );
p->setPen( labelColor );
@@ -218,20 +218,20 @@ ConquestMap::drawSector( QPainter *p, Sector &sector, bool borderStrobe, bool hi
p->drawText( labelCorner, sector.getPlanet()->getName() );
if( borderStrobe ) {
- QPen gridPen( sector.getPlanet()->getPlayer()->getColor() );
+ TQPen gridPen( sector.getPlanet()->getPlayer()->getColor() );
p->setPen( gridPen );
} else if( highlight ) {
- QPen gridPen( white );
+ TQPen gridPen( white );
p->setPen( gridPen );
} else {
- QPen gridPen( gridColor );
+ TQPen gridPen( gridColor );
p->setPen( gridPen );
}
} else {
p->eraseRect( 0, 0, SECTOR_WIDTH, SECTOR_HEIGHT );
- QPen gridPen( gridColor );
+ TQPen gridPen( gridColor );
p->setPen( gridPen );
}