summaryrefslogtreecommitdiffstats
path: root/konquest
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
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')
-rw-r--r--konquest/Konquest.cc2
-rw-r--r--konquest/fleetdlg.cc24
-rw-r--r--konquest/fleetdlg.h12
-rw-r--r--konquest/gameboard.cc102
-rw-r--r--konquest/gameboard.h24
-rw-r--r--konquest/gamecore.cc40
-rw-r--r--konquest/gamecore.h54
-rw-r--r--konquest/gameenddlg.cc26
-rw-r--r--konquest/gameenddlg.h6
-rw-r--r--konquest/int_validator.cc20
-rw-r--r--konquest/int_validator.h8
-rw-r--r--konquest/mainwin.cc16
-rw-r--r--konquest/map_widget.cc84
-rw-r--r--konquest/map_widget.h24
-rw-r--r--konquest/minimap.cc16
-rw-r--r--konquest/minimap.h16
-rw-r--r--konquest/newgamedlg.cc84
-rw-r--r--konquest/newgamedlg.h2
-rw-r--r--konquest/planet_info.cc36
-rw-r--r--konquest/planet_info.h26
-rw-r--r--konquest/scoredlg.cc26
-rw-r--r--konquest/scoredlg.h10
22 files changed, 329 insertions, 329 deletions
diff --git a/konquest/Konquest.cc b/konquest/Konquest.cc
index 90a6b6c6..da6275c4 100644
--- a/konquest/Konquest.cc
+++ b/konquest/Konquest.cc
@@ -19,7 +19,7 @@ main(int argc, char **argv)
KCmdLineArgs::init( argc, argv, &aboutData );
KApplication a;
- QApplication::setGlobalMouseTracking( true );
+ TQApplication::setGlobalMouseTracking( true );
KGlobal::locale()->insertCatalogue("libkdegames");
if (a.isRestored())
diff --git a/konquest/fleetdlg.cc b/konquest/fleetdlg.cc
index 0117f74d..1c7e3fdf 100644
--- a/konquest/fleetdlg.cc
+++ b/konquest/fleetdlg.cc
@@ -1,4 +1,4 @@
-#include <qlayout.h>
+#include <tqlayout.h>
#include <kapplication.h>
#include <klocale.h>
#include <math.h>
@@ -8,11 +8,11 @@
#include "fleetdlg.h"
-FleetDlgListViewItem::FleetDlgListViewItem(QListView *parent, QString s1, QString s2, QString s3, QString s4, QString s5) : QListViewItem(parent, s1, s2, s3, s4, s5)
+FleetDlgListViewItem::FleetDlgListViewItem(TQListView *parent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5) : TQListViewItem(parent, s1, s2, s3, s4, s5)
{
}
-int FleetDlgListViewItem::compare(QListViewItem *i, int col, bool) const
+int FleetDlgListViewItem::compare(TQListViewItem *i, int col, bool) const
{
if (col == 1)
{
@@ -35,8 +35,8 @@ int FleetDlgListViewItem::compare(QListViewItem *i, int col, bool) const
}
-FleetDlg::FleetDlg( QWidget *parent, AttackFleetList *fleets )
- : QDialog(parent, "FleetDlg", true ), fleetList(fleets)
+FleetDlg::FleetDlg( TQWidget *parent, AttackFleetList *fleets )
+ : TQDialog(parent, "FleetDlg", true ), fleetList(fleets)
{
setCaption( kapp->makeStdCaption(i18n("Fleet Overview")) );
@@ -52,8 +52,8 @@ FleetDlg::FleetDlg( QWidget *parent, AttackFleetList *fleets )
okButton->setMinimumSize( okButton->sizeHint() );
okButton->setDefault(true);
- QVBoxLayout *layout1 = new QVBoxLayout( this );
- QHBoxLayout *layout2 = new QHBoxLayout;
+ TQVBoxLayout *layout1 = new TQVBoxLayout( this );
+ TQHBoxLayout *layout2 = new QHBoxLayout;
layout1->addWidget( fleetTable, 1 );
layout1->addLayout( layout2 );
@@ -62,7 +62,7 @@ FleetDlg::FleetDlg( QWidget *parent, AttackFleetList *fleets )
layout2->addWidget( okButton );
layout2->addStretch( 2 );
- connect( okButton, SIGNAL(clicked()), this, SLOT(accept()) );
+ connect( okButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()) );
init();
@@ -79,10 +79,10 @@ FleetDlg::init()
while( (curFleet = nextFleet())) {
fleetNumber++;
new FleetDlgListViewItem(fleetTable,
- QString("%1").arg(fleetNumber),
+ TQString("%1").arg(fleetNumber),
curFleet->destination->getName(),
- QString("%1").arg(curFleet->getShipCount()),
- QString("%1").arg(KGlobal::locale()->formatNumber(curFleet->killPercentage, 3)),
- QString("%1").arg((int)ceil(curFleet->arrivalTurn)));
+ TQString("%1").arg(curFleet->getShipCount()),
+ TQString("%1").arg(KGlobal::locale()->formatNumber(curFleet->killPercentage, 3)),
+ TQString("%1").arg((int)ceil(curFleet->arrivalTurn)));
}
}
diff --git a/konquest/fleetdlg.h b/konquest/fleetdlg.h
index abab1957..7937f69e 100644
--- a/konquest/fleetdlg.h
+++ b/konquest/fleetdlg.h
@@ -3,27 +3,27 @@
#include <klistview.h>
-#include <qdialog.h>
+#include <tqdialog.h>
#include "gamecore.h"
class FleetDlgListViewItem : public QListViewItem
{
public:
- FleetDlgListViewItem(QListView *parent, QString s1, QString s2, QString s3, QString s4, QString s5);
- int compare(QListViewItem *i, int col, bool) const;
+ FleetDlgListViewItem(TQListView *parent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5);
+ int compare(TQListViewItem *i, int col, bool) const;
};
-class FleetDlg : public QDialog {
+class FleetDlg : public TQDialog {
public:
- FleetDlg( QWidget *parent, AttackFleetList *fleets );
+ FleetDlg( TQWidget *parent, AttackFleetList *fleets );
private:
void init();
AttackFleetList *fleetList;
- QListView *fleetTable;
+ TQListView *fleetTable;
};
#endif
diff --git a/konquest/gameboard.cc b/konquest/gameboard.cc
index 75e440d7..47f77faa 100644
--- a/konquest/gameboard.cc
+++ b/konquest/gameboard.cc
@@ -1,14 +1,14 @@
-#include <qlayout.h>
-#include <qcolor.h>
-#include <qlabel.h>
-#include <qslider.h>
-#include <qevent.h>
-#include <qkeycode.h>
-#include <qlistbox.h>
-#include <qpushbutton.h>
-#include <qlineedit.h>
-#include <qvalidator.h>
-#include <qtextedit.h>
+#include <tqlayout.h>
+#include <tqcolor.h>
+#include <tqlabel.h>
+#include <tqslider.h>
+#include <tqevent.h>
+#include <tqkeycode.h>
+#include <tqlistbox.h>
+#include <tqpushbutton.h>
+#include <tqlineedit.h>
+#include <tqvalidator.h>
+#include <tqtextedit.h>
#include <kapplication.h>
#include <klocale.h>
@@ -33,11 +33,11 @@
/*********************************************************************
Game Board
*********************************************************************/
-GameBoard::GameBoard( QWidget *parent )
- : QWidget( parent ), gameInProgress( false ), gameState( NONE )
+GameBoard::GameBoard( TQWidget *parent )
+ : TQWidget( parent ), gameInProgress( false ), gameState( NONE )
{
- QColorGroup cg( white, black, green.light(), green.dark(), green, green.dark(75), green.dark() );
- QPalette palette( cg, cg, cg );
+ TQColorGroup cg( white, black, green.light(), green.dark(), green, green.dark(75), green.dark() );
+ TQPalette palette( cg, cg, cg );
neutralPlayer = Player::createNeutralPlayer();
map = new Map;
@@ -49,34 +49,34 @@ GameBoard::GameBoard( QWidget *parent )
// Create the widgets in the main window
//********************************************************************
mapWidget = new ConquestMap( map, this );
- msgWidget = new QTextEdit( this );
+ msgWidget = new TQTextEdit( this );
msgWidget->setTextFormat(LogText);
msgWidget->setMinimumHeight(100);
- msgWidget->setHScrollBarMode(QScrollView::AlwaysOff);
- msgWidget->setPaper(QBrush(Qt::black));
+ msgWidget->setHScrollBarMode(TQScrollView::AlwaysOff);
+ msgWidget->setPaper(TQBrush(Qt::black));
planetInfo = new PlanetInfo( this, palette );
- gameMessage = new QLabel( this );
+ gameMessage = new TQLabel( this );
gameMessage->setPalette( palette );
- turnCounter = new QLabel( this );
+ turnCounter = new TQLabel( this );
turnCounter->setPalette( palette );
turnCounter->setText( "Turn" );
turnCounter->setMaximumHeight( turnCounter->sizeHint().height() );
- endTurn = new QPushButton( i18n("End Turn"), this );
+ endTurn = new TQPushButton( i18n("End Turn"), this );
endTurn->setFixedSize( endTurn->sizeHint() );
endTurn->setPalette( palette );
- shipCountEdit = new QLineEdit( this );
+ shipCountEdit = new TQLineEdit( this );
IntValidator *v = new IntValidator( 1, 32767, this );
shipCountEdit->setValidator( v );
shipCountEdit->setMinimumSize( 40, 0 );
shipCountEdit->setMaximumSize( 32767, 40 );
shipCountEdit->setEnabled(false);
shipCountEdit->setPalette( palette );
- shipCountEdit->setEchoMode( QLineEdit::Password );
+ shipCountEdit->setEchoMode( TQLineEdit::Password );
- splashScreen = new QLabel( this );
- splashScreen->setPixmap(QPixmap(IMAGE_SPLASH));
+ splashScreen = new TQLabel( this );
+ splashScreen->setPixmap(TQPixmap(IMAGE_SPLASH));
splashScreen->setGeometry( 0, 0, 600, 550 );
setMinimumSize( 600, 600 );
@@ -88,10 +88,10 @@ GameBoard::GameBoard( QWidget *parent )
//********************************************************************
// Layout the main window
//********************************************************************
- QHBoxLayout *layout1 = new QHBoxLayout( this );
- QVBoxLayout *layout2 = new QVBoxLayout;
- QHBoxLayout *layout3 = new QHBoxLayout;
- QVBoxLayout *layout4 = new QVBoxLayout;
+ TQHBoxLayout *layout1 = new TQHBoxLayout( this );
+ TQVBoxLayout *layout2 = new QVBoxLayout;
+ TQHBoxLayout *layout3 = new QHBoxLayout;
+ TQVBoxLayout *layout4 = new QVBoxLayout;
layout1->addLayout( layout2 );
layout2->addLayout( layout3 );
@@ -119,10 +119,10 @@ GameBoard::GameBoard( QWidget *parent )
//**********************************************************************
// Set up signal/slot connections
//**********************************************************************
- connect( mapWidget, SIGNAL( planetSelected(Planet *) ), this, SLOT(planetSelected(Planet *)) );
- connect( shipCountEdit, SIGNAL(returnPressed()), this, SLOT(newShipCount()) );
- connect( endTurn, SIGNAL( clicked() ), this, SLOT( nextPlayer() ) );
- connect( mapWidget, SIGNAL( planetHighlighted(Planet *)), planetInfo, SLOT(showPlanet(Planet *)) );
+ connect( mapWidget, TQT_SIGNAL( planetSelected(Planet *) ), this, TQT_SLOT(planetSelected(Planet *)) );
+ connect( shipCountEdit, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(newShipCount()) );
+ connect( endTurn, TQT_SIGNAL( clicked() ), this, TQT_SLOT( nextPlayer() ) );
+ connect( mapWidget, TQT_SIGNAL( planetHighlighted(Planet *)), planetInfo, TQT_SLOT(showPlanet(Planet *)) );
changeGameBoard( false );
}
@@ -137,9 +137,9 @@ GameBoard::~GameBoard()
}
#if 0
-QSize GameBoard::sizeHint() const
+TQSize GameBoard::sizeHint() const
{
- return QSize( 600, 550 );
+ return TQSize( 600, 550 );
}
#endif
@@ -147,7 +147,7 @@ QSize GameBoard::sizeHint() const
// Keyboard Event handlers
//************************************************************************
void
-GameBoard::keyPressEvent( QKeyEvent *e )
+GameBoard::keyPressEvent( TQKeyEvent *e )
{
// Check for the escape key
if( e->key() == Key_Escape ) {
@@ -173,7 +173,7 @@ GameBoard::keyPressEvent( QKeyEvent *e )
}
PlanetListIterator planetSearch( planets );
- QString planetName;
+ TQString planetName;
planetName += toupper( e->ascii() );
@@ -312,7 +312,7 @@ GameBoard::turn()
CoreLogic cl;
double dist = cl.distance( sourcePlanet, destPlanet );
- QString msg;
+ TQString msg;
msg = i18n("The distance from Planet %1 to Planet %2 is %3 light years.\n"
"A ship leaving this turn will arrive on turn %4")
.arg(sourcePlanet->getName())
@@ -430,7 +430,7 @@ GameBoard::turn()
break;
}
- QString turnStr;
+ TQString turnStr;
turnStr = i18n("Turn #: %1 of %2").arg(turnNumber).arg(lastTurn);
turnCounter->setText( turnStr );
@@ -553,13 +553,13 @@ GameBoard::findWinner()
}
void
-GameBoard::gameMsg(const QString &msg, Player *player, Planet *planet, Player *planetPlayer)
+GameBoard::gameMsg(const TQString &msg, Player *player, Planet *planet, Player *planetPlayer)
{
bool isHumanInvolved = false;
- QString color = "white";
- QString colorMsg = msg;
- QString plainMsg = msg;
+ TQString color = "white";
+ TQString colorMsg = msg;
+ TQString plainMsg = msg;
if (player)
{
@@ -576,8 +576,8 @@ GameBoard::gameMsg(const QString &msg, Player *player, Planet *planet, Player *p
if (!planetPlayer->isAiPlayer() && !planetPlayer->isNeutral())
isHumanInvolved = true;
- QString color = planetPlayer->getColor().name();
- colorMsg = colorMsg.arg(QString("<font color=\"%1\">%2</font>").arg(color, planet->getName()));
+ TQString color = planetPlayer->getColor().name();
+ colorMsg = colorMsg.arg(TQString("<font color=\"%1\">%2</font>").arg(color, planet->getName()));
plainMsg = plainMsg.arg(planet->getName());
}
msgWidget->append(("<qt><font color=\"white\">Turn %1:</font> <font color=\""+color+"\">").arg(turnNumber)+colorMsg+"</font></qt>");
@@ -627,7 +627,7 @@ GameBoard::scanForSurvivors()
while( (plr = nextActivePlayer()) ) {
if( !plr->isInPlay() ) {
// Player has bitten the dust
- QString msg;
+ TQString msg;
msg = i18n("The once mighty empire of %1 has fallen in ruins.");
gameMsg(msg, plr);
}
@@ -637,7 +637,7 @@ GameBoard::scanForSurvivors()
while( (plr = nextInactivePlayer()) ) {
if( plr->isInPlay() ) {
// Player has bitten the dust
- QString msg;
+ TQString msg;
msg = i18n("The fallen empire of %1 has staggered back to life.");
gameMsg(msg, plr);
}
@@ -658,7 +658,7 @@ GameBoard::doFleetArrival( AttackFleet *arrivingFleet )
if (!arrivingFleet->owner->isAiPlayer()) {
arrivingFleet->destination->getFleet().absorb(arrivingFleet);
- QString msg;
+ TQString msg;
msg = i18n("Reinforcements (%1 ships) have arrived for planet %2.")
.arg(arrivingFleet->getShipCount());
gameMsg(msg, 0, arrivingFleet->destination);
@@ -702,7 +702,7 @@ GameBoard::doFleetArrival( AttackFleet *arrivingFleet )
if( planetHolds ) {
prizePlanet.getPlayer()->statEnemyFleetsDestroyed(1);
- QString msg;
+ TQString msg;
msg = i18n("Planet %2 has held against an attack from %1.");
gameMsg(msg, attacker.owner, &prizePlanet);
} else {
@@ -711,7 +711,7 @@ GameBoard::doFleetArrival( AttackFleet *arrivingFleet )
arrivingFleet->destination->conquer( arrivingFleet );
- QString msg;
+ TQString msg;
msg = i18n("Planet %2 has fallen to %1.");
gameMsg(msg, attacker.owner, &prizePlanet, defender);
}
@@ -865,7 +865,7 @@ GameBoard::planetSelected( Planet *planet )
void
GameBoard::newShipCount()
{
- QString temp( shipCountEdit->text() );
+ TQString temp( shipCountEdit->text() );
bool ok;
switch( gameState ) {
diff --git a/konquest/gameboard.h b/konquest/gameboard.h
index 5e3cddfa..4b30b0b1 100644
--- a/konquest/gameboard.h
+++ b/konquest/gameboard.h
@@ -1,7 +1,7 @@
#ifndef _GAMEBOARD_H_
#define _GAMEBOARD_H_
-#include <qwidget.h>
+#include <tqwidget.h>
#include "planet_info.h"
#include "map_widget.h"
@@ -26,12 +26,12 @@ class GameBoard : public QWidget
Q_OBJECT
public:
- GameBoard( QWidget *parent );
+ GameBoard( TQWidget *parent );
virtual ~GameBoard();
bool isGameInProgress(void) const { return gameInProgress; }
-// virtual QSize sizeHint() const;
+// virtual TQSize sizeHint() const;
protected slots:
void startNewGame();
@@ -54,7 +54,7 @@ signals:
// Event Handlers
//***************************************************************
protected:
- virtual void keyPressEvent( QKeyEvent * );
+ virtual void keyPressEvent( TQKeyEvent * );
private:
void turn();
@@ -66,13 +66,13 @@ private:
void doFleetArrival( AttackFleet *arrivingFleet );
void scanForSurvivors();
- void gameMsg(const QString &msg, Player *player = 0, Planet *planet = 0, Player *planetPlayer = 0);
+ void gameMsg(const TQString &msg, Player *player = 0, Planet *planet = 0, Player *planetPlayer = 0);
void changeGameBoard( bool inPlay );
void cleanupGame();
Player *findWinner();
- QString playerString(Player *player = 0);
+ TQString playerString(Player *player = 0);
//***************************************************************
// Game State information
@@ -86,12 +86,12 @@ private:
//***************************************************************
ConquestMap *mapWidget;
PlanetInfo *planetInfo;
- QLabel *gameMessage;
- QLabel *turnCounter;
- QPushButton *endTurn;
- QLineEdit *shipCountEdit;
- QLabel *splashScreen;
- QTextEdit *msgWidget;
+ TQLabel *gameMessage;
+ TQLabel *turnCounter;
+ TQPushButton *endTurn;
+ TQLineEdit *shipCountEdit;
+ TQLabel *splashScreen;
+ TQTextEdit *msgWidget;
//***************************************************************
diff --git a/konquest/gamecore.cc b/konquest/gamecore.cc
index 843c1a92..3706cf68 100644
--- a/konquest/gamecore.cc
+++ b/konquest/gamecore.cc
@@ -68,7 +68,7 @@ CoreLogic::roll()
Map::Map()
- : QObject( 0, 0 ), freezeUpdates( false ),
+ : TQObject( 0, 0 ), freezeUpdates( false ),
rows( BOARD_ROWS ), columns( BOARD_COLS ),
hasSelectedSector( false )
{
@@ -78,7 +78,7 @@ Map::Map()
for( int y = 0; y < columns; y++ )
{
grid[x][y] = Sector( this, x, y );
- connect( &grid[x][y], SIGNAL( update() ), this, SLOT( childSectorUpdate() ));
+ connect( &grid[x][y], TQT_SIGNAL( update() ), this, TQT_SLOT( childSectorUpdate() ));
}
}
}
@@ -94,13 +94,13 @@ Map::populateMap( PlayerList &players, Player *neutral,
Freeze();
int index = 0;
- QString names( "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*(),.<>;:[]{}/?-+\\|" );
+ TQString names( "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*(),.<>;:[]{}/?-+\\|" );
// Create a planet for each player
Player *plr;
for( plr = players.first(); plr != 0; plr = players.next() )
{
- QString newName( names.mid( index++, 1 ) );
+ TQString newName( names.mid( index++, 1 ) );
Sector &sect = findRandomFreeSector();
Planet *plrPlanet = Planet::createPlayerPlanet( sect, plr, newName );
@@ -109,7 +109,7 @@ Map::populateMap( PlayerList &players, Player *neutral,
for( int x = 0; x < numNeutralPlanets; x++ )
{
- QString newName( names.mid( index++, 1 ) );
+ TQString newName( names.mid( index++, 1 ) );
Sector &sect = findRandomFreeSector();
Planet *neutralPlanet = Planet::createNeutralPlanet( sect, neutral, newName );
@@ -242,16 +242,16 @@ const int Map::getColumns() const
//---------------------------------------------------------------------------
Sector::Sector()
-: QObject(0,0), planet( NULL ), parentMap(NULL ), x(0), y(0)
+: TQObject(0,0), planet( NULL ), parentMap(NULL ), x(0), y(0)
{}
Sector::Sector( Map *newParentMap, int xPos, int yPos )
-: QObject(0,0), planet(NULL), parentMap( newParentMap ), x(xPos), y(yPos)
+: TQObject(0,0), planet(NULL), parentMap( newParentMap ), x(xPos), y(yPos)
{
}
Sector::Sector( const Sector & other )
-: QObject(0,0), planet(other.planet), parentMap(other.parentMap), x(other.x), y(other.y)
+: TQObject(0,0), planet(other.planet), parentMap(other.parentMap), x(other.x), y(other.y)
{
}
@@ -265,7 +265,7 @@ void Sector::setPlanet( Planet *newPlanet )
{
planet = newPlanet;
- connect( planet, SIGNAL( update() ), this, SLOT( childPlanetUpdate() ) );
+ connect( planet, TQT_SIGNAL( update() ), this, TQT_SLOT( childPlanetUpdate() ) );
emit update();
}
@@ -320,9 +320,9 @@ int Sector::getColumn()
// class Planet
//---------------------------------------------------------------------------
-Planet::Planet( QString planetName, Sector &newParentSector, Player *initialOwner,
+Planet::Planet( TQString planetName, Sector &newParentSector, Player *initialOwner,
int newProd, double newKillP, double newMorale )
- : QObject(0,0), name(planetName), owner(initialOwner), parentSector(newParentSector),
+ : TQObject(0,0), name(planetName), owner(initialOwner), parentSector(newParentSector),
homeFleet( this, newProd ), killPercentage(newKillP), morale( newMorale ), productionRate(newProd)
@@ -333,7 +333,7 @@ Planet::Planet( QString planetName, Sector &newParentSector, Player *initialOwne
Planet::~Planet() {}
Planet *
-Planet::createPlayerPlanet( Sector &parentSector, Player *initialOwner, QString planetName )
+Planet::createPlayerPlanet( Sector &parentSector, Player *initialOwner, TQString planetName )
{
CoreLogic clogic;
@@ -344,7 +344,7 @@ Planet::createPlayerPlanet( Sector &parentSector, Player *initialOwner, QString
}
Planet *
-Planet::createNeutralPlanet( Sector &parentSector, Player *initialOwner, QString planetName )
+Planet::createNeutralPlanet( Sector &parentSector, Player *initialOwner, TQString planetName )
{
CoreLogic clogic;
double morale = clogic.generateMorale();
@@ -414,7 +414,7 @@ Planet::getPlayer() const
return owner;
}
-const QString &
+const TQString &
Planet::getName() const
{
return name;
@@ -454,7 +454,7 @@ Planet::turn()
//---------------------------------------------------------------------------
// class Player
//---------------------------------------------------------------------------
-Player::Player( QString newName, QColor newColor, int newPlrNum, bool isAi ) : name( newName ), color( newColor ),
+Player::Player( TQString newName, TQColor newColor, int newPlrNum, bool isAi ) : name( newName ), color( newColor ),
playerNum( newPlrNum ), inPlay( true ), aiPlayer( isAi ), shipsBuilt(0), planetsConquered(0), fleetsLaunched(0),
enemyFleetsDestroyed(0), enemyShipsDestroyed(0)
{
@@ -473,7 +473,7 @@ Player::operator==( const Player &otherPlayer ) const
return false;
}
-QString &
+TQString &
Player::getName()
{
return name;
@@ -482,20 +482,20 @@ Player::getName()
QString
Player::getColoredName()
{
- return QString("<font color=\"%1\">%2</font>").arg(color.name(), name);
+ return TQString("<font color=\"%1\">%2</font>").arg(color.name(), name);
}
-Player *Player::createPlayer( QString newName, QColor color, int playerNum, bool isAi )
+Player *Player::createPlayer( TQString newName, TQColor color, int playerNum, bool isAi )
{
return new Player( newName, color, playerNum, isAi );
}
Player *Player::createNeutralPlayer()
{
- return new Player( QString::null, gray, NEUTRAL_PLAYER_NUMBER, false );
+ return new Player( TQString::null, gray, NEUTRAL_PLAYER_NUMBER, false );
}
-QColor &Player::getColor()
+TQColor &Player::getColor()
{
return color;
}
diff --git a/konquest/gamecore.h b/konquest/gamecore.h
index c8c7c39a..03683a08 100644
--- a/konquest/gamecore.h
+++ b/konquest/gamecore.h
@@ -3,10 +3,10 @@
#include <krandomsequence.h>
-#include <qobject.h>
-#include <qstring.h>
-#include <qcolor.h>
-#include <qptrlist.h>
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqcolor.h>
+#include <tqptrlist.h>
// Board Size Constants
#define BOARD_ROWS 16
@@ -111,20 +111,20 @@ class Player : public QObject
{
public:
- Player( QString newName, QColor color, int number, bool isAi );
+ Player( TQString newName, TQColor color, int number, bool isAi );
virtual ~Player();
enum { NEUTRAL_PLAYER_NUMBER = -1 };
public:
- QString &getName();
- QString getColoredName();
- QColor &getColor();
+ TQString &getName();
+ TQString getColoredName();
+ TQColor &getColor();
bool isNeutral();
- QPtrList<AttackFleet> &getAttackList();
+ TQPtrList<AttackFleet> &getAttackList();
// factory functions
- static Player *createPlayer( QString newName, QColor newColor, int playerNum, bool isAi );
+ static Player *createPlayer( TQString newName, TQColor newColor, int playerNum, bool isAi );
static Player *createNeutralPlayer();
bool NewAttack( Planet *sourcePlanet, Planet *destPlanet, int shipCount, int departureTurn );
@@ -135,13 +135,13 @@ public:
void setInPlay( bool );
private:
- QString name;
- QColor color;
+ TQString name;
+ TQColor color;
int playerNum;
bool inPlay;
bool aiPlayer;
- QPtrList<AttackFleet> attackList;
+ TQPtrList<AttackFleet> attackList;
// statistics counters
int shipsBuilt;
@@ -177,7 +177,7 @@ class Planet : public QObject
private:
- Planet( QString planetName, Sector &newParentSector,
+ Planet( TQString planetName, Sector &newParentSector,
Player *initialOwner, int newProd,
double newKillP, double newMorale );
@@ -185,13 +185,13 @@ public:
virtual ~Planet();
static Planet *createPlayerPlanet( Sector &parentSector,
- Player *initialOwner, QString planetName );
+ Player *initialOwner, TQString planetName );
static Planet *createNeutralPlanet( Sector &parentSector,
- Player *initialOwner, QString planetName );
+ Player *initialOwner, TQString planetName );
Sector &getSector() const;
Player *getPlayer() const;
- const QString &getName() const;
+ const TQString &getName() const;
DefenseFleet &getFleet();
double getKillPercentage();
@@ -211,7 +211,7 @@ signals:
void selected();
private:
- QString name;
+ TQString name;
Player *owner;
Sector &parentSector;
DefenseFleet homeFleet;
@@ -279,8 +279,8 @@ public:
const int getRows() const;
const int getColumns() const;
- void populateMap( QPtrList<Player> &players, Player *neutral,
- int numNeutralPlanets, QPtrList<Planet> &thePlanets );
+ void populateMap( TQPtrList<Player> &players, Player *neutral,
+ int numNeutralPlanets, TQPtrList<Planet> &thePlanets );
void clearMap();
bool selectedSector( int &x, int &y ) const;
@@ -318,13 +318,13 @@ protected:
//---------------------------------------------------------------------------------
// Typedefs
//---------------------------------------------------------------------------------
-typedef QPoint Coordinate; // Gotta start using this instead of int x,y crap
-typedef QPtrList<AttackFleet> AttackFleetList;
-typedef QPtrListIterator<AttackFleet> AttackFleetListIterator;
-typedef QPtrList<Player> PlayerList;
-typedef QPtrList<Planet> PlanetList;
-typedef QPtrListIterator<Player> PlayerListIterator;
-typedef QPtrListIterator<Planet> PlanetListIterator;
+typedef TQPoint Coordinate; // Gotta start using this instead of int x,y crap
+typedef TQPtrList<AttackFleet> AttackFleetList;
+typedef TQPtrListIterator<AttackFleet> AttackFleetListIterator;
+typedef TQPtrList<Player> PlayerList;
+typedef TQPtrList<Planet> PlanetList;
+typedef TQPtrListIterator<Player> PlayerListIterator;
+typedef TQPtrListIterator<Planet> PlanetListIterator;
#endif // _GAMECORE_H_
diff --git a/konquest/gameenddlg.cc b/konquest/gameenddlg.cc
index 080a8477..2295acd9 100644
--- a/konquest/gameenddlg.cc
+++ b/konquest/gameenddlg.cc
@@ -1,7 +1,7 @@
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qslider.h>
-#include <qvbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqslider.h>
+#include <tqvbox.h>
#include <kapplication.h>
#include <kconfig.h>
@@ -11,23 +11,23 @@
#include "gameenddlg.h"
#include "gameenddlg.moc"
-GameEndDlg::GameEndDlg( QWidget *parent )
+GameEndDlg::GameEndDlg( TQWidget *parent )
: KDialogBase( i18n("Out of Turns"),
KDialogBase::Yes|KDialogBase::No, KDialogBase::Yes, KDialogBase::No,
parent, "end_game_dialog", true, true )
{
- QVBox *page = makeVBoxMainWidget();
+ TQVBox *page = makeVBoxMainWidget();
// Create controls
- QLabel *label1 = new QLabel( i18n("This is the last turn.\nDo you wish to add extra turns?")+"\n\n", page );
+ TQLabel *label1 = new TQLabel( i18n("This is the last turn.\nDo you wish to add extra turns?")+"\n\n", page );
label1->setAlignment( AlignCenter );
- turnCountLbl = new QLabel( page );
- turnCount = new QSlider( 1, 40, 1, 5, Qt::Horizontal, page );
+ turnCountLbl = new TQLabel( page );
+ turnCount = new TQSlider( 1, 40, 1, 5, Qt::Horizontal, page );
- KGuiItem addTurns(i18n("&Add Turns"), QString::null, QString::null,
+ KGuiItem addTurns(i18n("&Add Turns"), TQString::null, TQString::null,
i18n("Add the specified number of turns to the game and continue playing."));
- KGuiItem gameOver(i18n("&Game Over"), QString::null, QString::null,
+ KGuiItem gameOver(i18n("&Game Over"), TQString::null, TQString::null,
i18n("Terminate the current game."));
setButtonGuiItem(KDialogBase::Yes, addTurns);
@@ -35,7 +35,7 @@ GameEndDlg::GameEndDlg( QWidget *parent )
init();
- connect( turnCount, SIGNAL(valueChanged( int )), this, SLOT(turnCountChange( int )) );
+ connect( turnCount, TQT_SIGNAL(valueChanged( int )), this, TQT_SLOT(turnCountChange( int )) );
}
GameEndDlg::~GameEndDlg()
@@ -71,6 +71,6 @@ GameEndDlg::extraTurns()
void
GameEndDlg::turnCountChange( int newTurnCount )
{
- QString newLbl = i18n("Extra turns: %1").arg( newTurnCount );
+ TQString newLbl = i18n("Extra turns: %1").arg( newTurnCount );
turnCountLbl->setText( newLbl);
}
diff --git a/konquest/gameenddlg.h b/konquest/gameenddlg.h
index d1c982e3..975bc830 100644
--- a/konquest/gameenddlg.h
+++ b/konquest/gameenddlg.h
@@ -11,7 +11,7 @@ class GameEndDlg : public KDialogBase
Q_OBJECT
public:
- GameEndDlg( QWidget *parent );
+ GameEndDlg( TQWidget *parent );
virtual ~GameEndDlg();
int extraTurns();
@@ -24,8 +24,8 @@ private slots:
void slotYes();
private:
- QSlider *turnCount;
- QLabel *turnCountLbl;
+ TQSlider *turnCount;
+ TQLabel *turnCountLbl;
};
#endif // _GAMEENDDLG_H_
diff --git a/konquest/int_validator.cc b/konquest/int_validator.cc
index 85fd1779..12f707c6 100644
--- a/konquest/int_validator.cc
+++ b/konquest/int_validator.cc
@@ -3,8 +3,8 @@
#include "int_validator.h"
#include "int_validator.moc"
-IntValidator::IntValidator( QWidget *parent, const char *name ) :
- QValidator( parent, name )
+IntValidator::IntValidator( TQWidget *parent, const char *name ) :
+ TQValidator( parent, name )
{
#ifdef INT_MIN
v_bottom = INT_MIN;
@@ -14,8 +14,8 @@ IntValidator::IntValidator( QWidget *parent, const char *name ) :
v_top = INT_MIN;
}
-IntValidator::IntValidator( int bottom, int top, QWidget *parent, const char *name ) :
-QValidator( parent, name )
+IntValidator::IntValidator( int bottom, int top, TQWidget *parent, const char *name ) :
+TQValidator( parent, name )
{
v_bottom = bottom;
v_top = top;
@@ -23,23 +23,23 @@ QValidator( parent, name )
IntValidator::~IntValidator() {}
-QValidator::State
-IntValidator::validate( QString &input, int & ) const
+TQValidator::State
+IntValidator::validate( TQString &input, int & ) const
{
if( input.isEmpty() ) {
- return QValidator::Valid;
+ return TQValidator::Valid;
} else {
bool ok;
int value = input.toInt( &ok );
if( !ok )
- return QValidator::Invalid;
+ return TQValidator::Invalid;
if( value < v_bottom || value > v_top )
- return QValidator::Valid;
+ return TQValidator::Valid;
- return QValidator::Acceptable;
+ return TQValidator::Acceptable;
}
}
diff --git a/konquest/int_validator.h b/konquest/int_validator.h
index e5973fee..6cb67bcb 100644
--- a/konquest/int_validator.h
+++ b/konquest/int_validator.h
@@ -1,7 +1,7 @@
#ifndef _INT_VALIDATOR_H_
#define _INT_VALIDATOR_H_
-#include <qvalidator.h>
+#include <tqvalidator.h>
class IntValidator : public QValidator
@@ -9,12 +9,12 @@ class IntValidator : public QValidator
Q_OBJECT
public:
- IntValidator( QWidget *parent, const char *name = 0 );
- IntValidator( int bottom, int top, QWidget *parent, const char *name = 0 );
+ IntValidator( TQWidget *parent, const char *name = 0 );
+ IntValidator( int bottom, int top, TQWidget *parent, const char *name = 0 );
virtual ~IntValidator();
- virtual QValidator::State validate( QString &, int & ) const;
+ virtual TQValidator::State validate( TQString &, int & ) const;
virtual void setRange( int bottom, int top );
diff --git a/konquest/mainwin.cc b/konquest/mainwin.cc
index 496d3ac0..866cd936 100644
--- a/konquest/mainwin.cc
+++ b/konquest/mainwin.cc
@@ -1,6 +1,6 @@
#include <config.h>
-#include <qpushbutton.h>
+#include <tqpushbutton.h>
#include <kapplication.h>
#include <klocale.h>
@@ -37,18 +37,18 @@ MainWindow::~MainWindow()
void
MainWindow::setupKAction()
{
- KStdGameAction::gameNew( gameBoard, SLOT( startNewGame() ), actionCollection() );
- KStdGameAction::quit( this, SLOT( close() ), actionCollection() );
- endAction = KStdGameAction::end( gameBoard, SLOT( shutdownGame() ), actionCollection() );
+ KStdGameAction::gameNew( gameBoard, TQT_SLOT( startNewGame() ), actionCollection() );
+ KStdGameAction::quit( this, TQT_SLOT( close() ), actionCollection() );
+ endAction = KStdGameAction::end( gameBoard, TQT_SLOT( shutdownGame() ), actionCollection() );
endAction->setEnabled(false);
//AB: there is no icon for disabled - KToolBar::insertButton shows the
//different state - KAction not :-(
- measureAction = new KAction( i18n("&Measure Distance"), "ruler", 0, gameBoard, SLOT( measureDistance() ), actionCollection(), "game_measure" );
+ measureAction = new KAction( i18n("&Measure Distance"), "ruler", 0, gameBoard, TQT_SLOT( measureDistance() ), actionCollection(), "game_measure" );
measureAction->setEnabled(false);
- standingAction = new KAction( i18n("&Show Standings"), "help", 0, gameBoard, SLOT( showScores() ), actionCollection(), "game_scores" );
+ standingAction = new KAction( i18n("&Show Standings"), "help", 0, gameBoard, TQT_SLOT( showScores() ), actionCollection(), "game_scores" );
standingAction->setEnabled(false);
- fleetAction = new KAction( i18n("&Fleet Overview"), "launch", 0, gameBoard, SLOT( showFleets() ), actionCollection(), "game_fleets" );
+ fleetAction = new KAction( i18n("&Fleet Overview"), "launch", 0, gameBoard, TQT_SLOT( showFleets() ), actionCollection(), "game_fleets" );
fleetAction->setEnabled(false);
toolBar()->setBarPos( KToolBar::Left );
toolBar()->setMovingEnabled( false );
@@ -60,7 +60,7 @@ MainWindow::setupGameBoard()
gameBoard = new GameBoard( this );
setCentralWidget(gameBoard);
- connect( gameBoard, SIGNAL( newGameState( GameState )), this, SLOT( gameStateChange( GameState ) ) );
+ connect( gameBoard, TQT_SIGNAL( newGameState( GameState )), this, TQT_SLOT( gameStateChange( GameState ) ) );
}
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 );
}
diff --git a/konquest/map_widget.h b/konquest/map_widget.h
index 052d6e9d..ed8d98f3 100644
--- a/konquest/map_widget.h
+++ b/konquest/map_widget.h
@@ -2,13 +2,13 @@
#define _MAP_WIDGET_H
-#include <qwidget.h>
-#include <qframe.h>
-#include <qpixmap.h>
+#include <tqwidget.h>
+#include <tqframe.h>
+#include <tqpixmap.h>
-#include <qgridview.h>
+#include <tqgridview.h>
-#include <qtimer.h>
+#include <tqtimer.h>
#include "gamecore.h"
#include "images.h"
@@ -19,7 +19,7 @@ class ConquestMap : public QGridView
// Constructors
public:
- ConquestMap( Map *newMap, QWidget *parent = 0 );
+ ConquestMap( Map *newMap, TQWidget *parent = 0 );
virtual ~ConquestMap();
// Interface
@@ -27,9 +27,9 @@ public:
void unselectPlanet();
protected:
- virtual void contentsMousePressEvent( QMouseEvent *e );
- virtual void contentsMouseMoveEvent( QMouseEvent *e );
- virtual void paintCell( QPainter *p, int row, int col );
+ virtual void contentsMousePressEvent( TQMouseEvent *e );
+ virtual void contentsMouseMoveEvent( TQMouseEvent *e );
+ virtual void paintCell( TQPainter *p, int row, int col );
private slots:
void mapUpdate();
@@ -46,11 +46,11 @@ private:
const int BOARD_HEIGHT;
const int BOARD_WIDTH;
- void drawSector( QPainter *, Sector &, bool borderStrobe = true, bool highlight = false );
+ void drawSector( TQPainter *, Sector &, bool borderStrobe = true, bool highlight = false );
Map *map;
- QColor gridColor;
- QFont labelFont;
+ TQColor gridColor;
+ TQFont labelFont;
int hiLiteRow, hiLiteCol;
};
diff --git a/konquest/minimap.cc b/konquest/minimap.cc
index eee1237b..a287ab79 100644
--- a/konquest/minimap.cc
+++ b/konquest/minimap.cc
@@ -1,5 +1,5 @@
-#include <qpixmap.h>
-#include <qpainter.h>
+#include <tqpixmap.h>
+#include <tqpainter.h>
#include <kapplication.h>
#include <kiconloader.h>
@@ -7,8 +7,8 @@
#include "minimap.h"
#include "minimap.moc"
-MiniMap::MiniMap( QWidget *parent, const char *name )
- : QGridView( parent, name ),
+MiniMap::MiniMap( TQWidget *parent, const char *name )
+ : TQGridView( parent, name ),
SECTOR_HEIGHT( 12 ), SECTOR_WIDTH( 12 ),
BOARD_HEIGHT( 10 * SECTOR_HEIGHT ),
BOARD_WIDTH( 10 * SECTOR_WIDTH ),
@@ -39,7 +39,7 @@ MiniMap::setMap(Map *newMap)
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() ) );
}
MiniMap::~MiniMap()
@@ -48,7 +48,7 @@ MiniMap::~MiniMap()
void
-MiniMap::paintCell( QPainter *p, int row, int col )
+MiniMap::paintCell( TQPainter *p, int row, int col )
{
drawSector( p, map->getSector( row, col ) );
}
@@ -61,9 +61,9 @@ MiniMap::mapUpdate()
void
-MiniMap::drawSector( QPainter *p, Sector &sector )
+MiniMap::drawSector( TQPainter *p, Sector &sector )
{
- QRect r( 0, 0, SECTOR_WIDTH, SECTOR_HEIGHT );
+ TQRect r( 0, 0, SECTOR_WIDTH, SECTOR_HEIGHT );
p->setPen( black );
p->setBrush( black );
diff --git a/konquest/minimap.h b/konquest/minimap.h
index 9d205abb..886e247c 100644
--- a/konquest/minimap.h
+++ b/konquest/minimap.h
@@ -1,11 +1,11 @@
#ifndef _MINIMAP_H
#define _MINIMAP_H
-#include <qwidget.h>
-#include <qframe.h>
-#include <qpixmap.h>
-#include <qgridview.h>
-#include <qtimer.h>
+#include <tqwidget.h>
+#include <tqframe.h>
+#include <tqpixmap.h>
+#include <tqgridview.h>
+#include <tqtimer.h>
#include "gamecore.h"
#include "images.h"
@@ -17,13 +17,13 @@ class MiniMap : public QGridView
// Constructors
public:
- MiniMap( QWidget *parent = 0, const char* name = 0 );
+ MiniMap( TQWidget *parent = 0, const char* name = 0 );
virtual ~MiniMap();
void setMap( Map *newMap );
protected:
- void paintCell( QPainter *p, int row, int col );
+ void paintCell( TQPainter *p, int row, int col );
private slots:
void mapUpdate();
@@ -35,7 +35,7 @@ private:
int BOARD_HEIGHT;
int BOARD_WIDTH;
- void drawSector( QPainter *, Sector & );
+ void drawSector( TQPainter *, Sector & );
Map *map;
};
diff --git a/konquest/newgamedlg.cc b/konquest/newgamedlg.cc
index c1beae4f..232e6415 100644
--- a/konquest/newgamedlg.cc
+++ b/konquest/newgamedlg.cc
@@ -1,13 +1,13 @@
-#include <qheader.h>
-#include <qlayout.h>
-#include <qcolor.h>
-#include <qlabel.h>
-#include <qslider.h>
-#include <qevent.h>
-#include <qkeycode.h>
-#include <qlistview.h>
-#include <qpushbutton.h>
-#include <qlineedit.h>
+#include <tqheader.h>
+#include <tqlayout.h>
+#include <tqcolor.h>
+#include <tqlabel.h>
+#include <tqslider.h>
+#include <tqevent.h>
+#include <tqkeycode.h>
+#include <tqlistview.h>
+#include <tqpushbutton.h>
+#include <tqlineedit.h>
#include <kapplication.h>
#include <kconfig.h>
@@ -25,7 +25,7 @@
New Game Dialog Members
************************************************************************/
-NewGameDlg::NewGameDlg( QWidget *parent, Map *pmap, PlayerList *players,
+NewGameDlg::NewGameDlg( TQWidget *parent, Map *pmap, PlayerList *players,
Player *neutralPlayer, PlanetList *planets )
: KDialogBase( parent, "new_game_dialog", true, i18n("Start New Game"),
KDialogBase::Ok|KDialogBase::Default|KDialogBase::Cancel, KDialogBase::NoDefault, true ),
@@ -37,19 +37,19 @@ NewGameDlg::NewGameDlg( QWidget *parent, Map *pmap, PlayerList *players,
w->listPlayers->header()->hide();
// w->listPlayers->setMinimumSize( 100, 150 );
w->listPlayers->setSortColumn(-1);
- w->listPlayers->setHScrollBarMode(QScrollView::AlwaysOff);
+ w->listPlayers->setHScrollBarMode(TQScrollView::AlwaysOff);
w->sliderPlayers->setMinimumWidth(270);
w->sliderPlanets->setMinimumWidth(270);
w->newPlayer->setMaxLength( 8 );
- connect(w->sliderPlayers, SIGNAL(valueChanged(int)), this, SLOT(slotPlayerCount(int)));
- connect(w->sliderPlanets, SIGNAL(valueChanged(int)), this, SLOT(slotNewMap()));
- connect(w->sliderTurns, SIGNAL(valueChanged(int)), this, SLOT(slotTurns()));
- connect(w->rejectMap, SIGNAL(clicked()), this, SLOT(slotNewMap()));
- connect(w->newPlayer, SIGNAL(textChanged(const QString &)), this, SLOT(slotNewPlayer()));
- connect(w->newPlayer, SIGNAL(returnPressed()), this, SLOT(slotAddPlayer()));
- connect(w->addPlayer, SIGNAL(clicked()), this, SLOT(slotAddPlayer()));
+ connect(w->sliderPlayers, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotPlayerCount(int)));
+ connect(w->sliderPlanets, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotNewMap()));
+ connect(w->sliderTurns, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(slotTurns()));
+ connect(w->rejectMap, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotNewMap()));
+ connect(w->newPlayer, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(slotNewPlayer()));
+ connect(w->newPlayer, TQT_SIGNAL(returnPressed()), this, TQT_SLOT(slotAddPlayer()));
+ connect(w->addPlayer, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotAddPlayer()));
init();
@@ -93,12 +93,12 @@ NewGameDlg::init()
// Restore player names
int plrNum = 0;
- for( QListViewItem *item = w->listPlayers->firstChild();
+ for( TQListViewItem *item = w->listPlayers->firstChild();
item; item = item->nextSibling(), plrNum++ )
{
- QString key = QString("Player_%1").arg(plrNum);
+ TQString key = TQString("Player_%1").arg(plrNum);
- QString playerName = config->readEntry(key);
+ TQString playerName = config->readEntry(key);
if (playerName.isEmpty())
continue;
@@ -120,11 +120,11 @@ NewGameDlg::slotNewPlayer()
void
NewGameDlg::slotAddPlayer()
{
- QString playerName = w->newPlayer->text();
+ TQString playerName = w->newPlayer->text();
if (playerName.isEmpty())
return;
- QListViewItem *item;
+ TQListViewItem *item;
do
{
item = w->listPlayers->firstChild();
@@ -151,7 +151,7 @@ NewGameDlg::slotAddPlayer()
item->setText(1, i18n("Human Player"));
item->setText(0, playerName);
- w->newPlayer->setText(QString::null);
+ w->newPlayer->setText(TQString::null);
updateMiniMap();
updateLabels();
@@ -160,14 +160,14 @@ NewGameDlg::slotAddPlayer()
void
NewGameDlg::setPlayerCount(int playerCount)
{
- QColor PlayerColors[MAX_PLAYERS] = { QColor( 130, 130, 255 ), yellow, red, green,
- white, cyan, magenta, QColor( 235, 153, 46 ),
- QColor( 106, 157, 104 ), QColor( 131, 153, 128) };
+ TQColor PlayerColors[MAX_PLAYERS] = { TQColor( 130, 130, 255 ), yellow, red, green,
+ white, cyan, magenta, TQColor( 235, 153, 46 ),
+ TQColor( 106, 157, 104 ), TQColor( 131, 153, 128) };
int i = 0;
- QListViewItem *lastItem = 0;
- QListViewItem *item = 0;
- QListViewItem *nextItem = w->listPlayers->firstChild();
+ TQListViewItem *lastItem = 0;
+ TQListViewItem *item = 0;
+ TQListViewItem *nextItem = w->listPlayers->firstChild();
while( (item = nextItem) )
{
nextItem = item->nextSibling();
@@ -184,11 +184,11 @@ NewGameDlg::setPlayerCount(int playerCount)
while(w->listPlayers->childCount() < playerCount)
{
- QString playerName = i18n("Generated AI player name", "Comp%1").arg(i+1);
- QPixmap pm(16,16);
- QColor color(PlayerColors[i]);
+ TQString playerName = i18n("Generated AI player name", "Comp%1").arg(i+1);
+ TQPixmap pm(16,16);
+ TQColor color(PlayerColors[i]);
pm.fill(color);
- QListViewItem *item = new QListViewItem(w->listPlayers, lastItem, playerName, i18n("Computer Player"), "A", color.name());
+ TQListViewItem *item = new TQListViewItem(w->listPlayers, lastItem, playerName, i18n("Computer Player"), "A", color.name());
item->setPixmap(0, pm);
lastItem = item;
i++;
@@ -238,7 +238,7 @@ void
NewGameDlg::slotOk()
{
bool hasHumans = false;
- for( QListViewItem *item = w->listPlayers->firstChild();
+ for( TQListViewItem *item = w->listPlayers->firstChild();
item; item = item->nextSibling() )
{
bool ai = (item->text(2) == "A");
@@ -266,11 +266,11 @@ NewGameDlg::save()
config->writeEntry("NrOfTurns", w->sliderTurns->value());
int plrNum = 0;
- for( QListViewItem *item = w->listPlayers->firstChild();
+ for( TQListViewItem *item = w->listPlayers->firstChild();
item; item = item->nextSibling() )
{
- QString key = QString("Player_%1").arg(plrNum);
- QString playerName = item->text(0);
+ TQString key = TQString("Player_%1").arg(plrNum);
+ TQString playerName = item->text(0);
bool ai = (item->text(2) == "A");
if (ai)
{
@@ -307,12 +307,12 @@ NewGameDlg::updateMiniMap()
// Make player list
// Does the name already exist in the list
int plrNum = 0;
- for( QListViewItem *item = w->listPlayers->firstChild();
+ for( TQListViewItem *item = w->listPlayers->firstChild();
item; item = item->nextSibling() )
{
- QString playerName = item->text(0);
+ TQString playerName = item->text(0);
bool ai = (item->text(2) == "A");
- QColor color(item->text(3));
+ TQColor color(item->text(3));
plrList->append( Player::createPlayer( playerName, color, plrNum, ai ));
plrNum++;
}
diff --git a/konquest/newgamedlg.h b/konquest/newgamedlg.h
index ed2d48d6..6a8c81d4 100644
--- a/konquest/newgamedlg.h
+++ b/konquest/newgamedlg.h
@@ -17,7 +17,7 @@ class NewGameDlg : public KDialogBase
Q_OBJECT
public:
- NewGameDlg( QWidget *parent, Map *map, PlayerList *playerList,
+ NewGameDlg( TQWidget *parent, Map *map, PlayerList *playerList,
Player *neutralPlayer, PlanetList *planetList );
int turns( void );
diff --git a/konquest/planet_info.cc b/konquest/planet_info.cc
index 4c1d4be1..1d178493 100644
--- a/konquest/planet_info.cc
+++ b/konquest/planet_info.cc
@@ -1,7 +1,7 @@
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qpalette.h>
-#include <qcolor.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqpalette.h>
+#include <tqcolor.h>
#include <kapplication.h>
#include <klocale.h>
@@ -9,25 +9,25 @@
#include <kglobal.h>
#include "planet_info.moc"
-PlanetInfo::PlanetInfo( QWidget *parent, QPalette palette )
- : QFrame( parent )
+PlanetInfo::PlanetInfo( TQWidget *parent, TQPalette palette )
+ : TQFrame( parent )
{
setPalette( palette );
- name = new QLabel( this );
+ name = new TQLabel( this );
name->setMinimumWidth( 100 );
- owner = new QLabel( this );
+ owner = new TQLabel( this );
owner->setMinimumWidth( 100 );
- ships = new QLabel( this );
+ ships = new TQLabel( this );
ships->setMinimumWidth( 100 );
- production = new QLabel( this );
+ production = new TQLabel( this );
production->setMinimumWidth( 100 );
- kill_percent = new QLabel( this );
+ kill_percent = new TQLabel( this );
kill_percent->setMinimumWidth( 100 );
clearDisplay();
- QVBoxLayout *layout1 = new QVBoxLayout( this );
+ TQVBoxLayout *layout1 = new TQVBoxLayout( this );
layout1->addWidget( name );
layout1->addWidget( owner );
@@ -47,7 +47,7 @@ PlanetInfo::~PlanetInfo()
emptyPlanetInfoList();
}
-QSize PlanetInfo::sizeHint() const
+TQSize PlanetInfo::sizeHint() const
{
int height;
@@ -57,7 +57,7 @@ QSize PlanetInfo::sizeHint() const
production->sizeHint().height()+
kill_percent->sizeHint().height();
- return QSize( 100, height );
+ return TQSize( 100, height );
}
void PlanetInfo::setPlanetList( PlanetList &newPlanets )
@@ -90,7 +90,7 @@ void PlanetInfo::rescanPlanets()
void PlanetInfo::clearDisplay()
{
- QString temp;
+ TQString temp;
temp = "<qt>" + i18n("Planet name: ");
name->setText( temp );
@@ -124,14 +124,14 @@ void PlanetInfo::showPlanet( Planet *planet )
if( planet->getPlayer()->isNeutral() ) {
clearDisplay();
- QString temp;
+ TQString temp;
temp = "<qt>" + i18n("Planet name: %1").arg(planet->getName());
name->setText( temp );
return;
}
- QString nameToShow = planet->getName();
+ TQString nameToShow = planet->getName();
PlanetInfoListIterator itr( planet_stats );
planet_info_buffer *p;
@@ -139,7 +139,7 @@ void PlanetInfo::showPlanet( Planet *planet )
while( (p = itr()) ) {
if( p->planet == planet ) {
- QString temp;
+ TQString temp;
temp = "<qt>" + i18n("Planet name: %1").arg(p->planet->getName());
name->setText( temp );
diff --git a/konquest/planet_info.h b/konquest/planet_info.h
index 4080f6b9..3408a499 100644
--- a/konquest/planet_info.h
+++ b/konquest/planet_info.h
@@ -1,10 +1,10 @@
#ifndef _PLANET_INFO_H_
#define _PLANET_INFO_H_
-#include <qframe.h>
-#include <qstring.h>
-#include <qptrlist.h>
-#include <qpalette.h>
+#include <tqframe.h>
+#include <tqstring.h>
+#include <tqptrlist.h>
+#include <tqpalette.h>
#include "gamecore.h"
@@ -17,20 +17,20 @@ struct planet_info_buffer {
float killRate;
};
-typedef QPtrList<planet_info_buffer> PlanetInfoList;
-typedef QPtrListIterator<planet_info_buffer> PlanetInfoListIterator;
+typedef TQPtrList<planet_info_buffer> PlanetInfoList;
+typedef TQPtrListIterator<planet_info_buffer> PlanetInfoListIterator;
class PlanetInfo : public QFrame
{
Q_OBJECT
public:
- PlanetInfo( QWidget *parent, QPalette palette );
+ PlanetInfo( TQWidget *parent, TQPalette palette );
virtual ~PlanetInfo();
void setPlanetList( PlanetList &newPlanets );
void rescanPlanets();
- QSize sizeHint() const;
+ TQSize sizeHint() const;
public slots:
void showPlanet( Planet * );
@@ -42,11 +42,11 @@ private:
PlanetList *planets;
PlanetInfoList planet_stats;
- QLabel *name;
- QLabel *owner;
- QLabel *ships;
- QLabel *production;
- QLabel *kill_percent;
+ TQLabel *name;
+ TQLabel *owner;
+ TQLabel *ships;
+ TQLabel *production;
+ TQLabel *kill_percent;
};
#endif // _PLANET_INFO_H_
diff --git a/konquest/scoredlg.cc b/konquest/scoredlg.cc
index 685ba9c5..7b7eac25 100644
--- a/konquest/scoredlg.cc
+++ b/konquest/scoredlg.cc
@@ -1,4 +1,4 @@
-#include <qlayout.h>
+#include <tqlayout.h>
#include <kapplication.h>
#include <klocale.h>
#include <kpushbutton.h>
@@ -6,11 +6,11 @@
#include "scoredlg.h"
-ScoreDlgListViewItem::ScoreDlgListViewItem(QListView *parent, QString s1, QString s2, QString s3, QString s4, QString s5, QString s6) : QListViewItem(parent, s1, s2, s3, s4, s5, s6)
+ScoreDlgListViewItem::ScoreDlgListViewItem(TQListView *parent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5, TQString s6) : TQListViewItem(parent, s1, s2, s3, s4, s5, s6)
{
}
-int ScoreDlgListViewItem::compare(QListViewItem *i, int col, bool) const
+int ScoreDlgListViewItem::compare(TQListViewItem *i, int col, bool) const
{
if (col == 0)
{
@@ -27,8 +27,8 @@ int ScoreDlgListViewItem::compare(QListViewItem *i, int col, bool) const
}
-ScoreDlg::ScoreDlg( QWidget *parent, const QString& title, PlayerList *players )
- : QDialog(parent, "ScoreDlg", true ), plrList(players)
+ScoreDlg::ScoreDlg( TQWidget *parent, const TQString& title, PlayerList *players )
+ : TQDialog(parent, "ScoreDlg", true ), plrList(players)
{
setCaption( kapp->makeStdCaption(title) );
@@ -45,8 +45,8 @@ ScoreDlg::ScoreDlg( QWidget *parent, const QString& title, PlayerList *players )
okButton->setMinimumSize( okButton->sizeHint() );
okButton->setDefault(true);
- QVBoxLayout *layout1 = new QVBoxLayout( this );
- QHBoxLayout *layout2 = new QHBoxLayout;
+ TQVBoxLayout *layout1 = new TQVBoxLayout( this );
+ TQHBoxLayout *layout2 = new QHBoxLayout;
layout1->addWidget( scoreTable, 1 );
layout1->addLayout( layout2 );
@@ -55,7 +55,7 @@ ScoreDlg::ScoreDlg( QWidget *parent, const QString& title, PlayerList *players )
layout2->addWidget( okButton );
layout2->addStretch( 2 );
- connect( okButton, SIGNAL(clicked()), this, SLOT(accept()) );
+ connect( okButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()) );
init();
@@ -71,10 +71,10 @@ ScoreDlg::init()
for( ;(curPlayer = itr()); )
new ScoreDlgListViewItem(scoreTable,
curPlayer->getName(),
- QString("%1").arg(curPlayer->getShipsBuilt()),
- QString("%1").arg(curPlayer->getPlanetsConquered()),
- QString("%1").arg(curPlayer->getFleetsLaunched()),
- QString("%1").arg(curPlayer->getEnemyFleetsDestroyed()),
- QString("%1").arg(curPlayer->getEnemyShipsDestroyed()));
+ TQString("%1").arg(curPlayer->getShipsBuilt()),
+ TQString("%1").arg(curPlayer->getPlanetsConquered()),
+ TQString("%1").arg(curPlayer->getFleetsLaunched()),
+ TQString("%1").arg(curPlayer->getEnemyFleetsDestroyed()),
+ TQString("%1").arg(curPlayer->getEnemyShipsDestroyed()));
}
diff --git a/konquest/scoredlg.h b/konquest/scoredlg.h
index 570a3b36..55eaa926 100644
--- a/konquest/scoredlg.h
+++ b/konquest/scoredlg.h
@@ -3,28 +3,28 @@
#include <klistview.h>
-#include <qdialog.h>
+#include <tqdialog.h>
#include "gamecore.h"
class ScoreDlgListViewItem : public QListViewItem
{
public:
- ScoreDlgListViewItem(QListView *parent, QString s1, QString s2, QString s3, QString s4, QString s5, QString s6);
- int compare(QListViewItem *i, int col, bool) const;
+ ScoreDlgListViewItem(TQListView *parent, TQString s1, TQString s2, TQString s3, TQString s4, TQString s5, TQString s6);
+ int compare(TQListViewItem *i, int col, bool) const;
};
class ScoreDlg : public QDialog
{
public:
- ScoreDlg( QWidget *parent, const QString& title, PlayerList *players );
+ ScoreDlg( TQWidget *parent, const TQString& title, PlayerList *players );
private:
void init();
PlayerList *plrList;
- QListView *scoreTable;
+ TQListView *scoreTable;
};