summaryrefslogtreecommitdiffstats
path: root/ktron
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 /ktron
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 'ktron')
-rw-r--r--ktron/ai.ui22
-rw-r--r--ktron/appearance.ui40
-rw-r--r--ktron/general.ui46
-rw-r--r--ktron/ktron.cpp24
-rw-r--r--ktron/ktron.h5
-rw-r--r--ktron/tron.cpp24
-rw-r--r--ktron/tron.h5
7 files changed, 84 insertions, 82 deletions
diff --git a/ktron/ai.ui b/ktron/ai.ui
index 3abcef57..63284c9a 100644
--- a/ktron/ai.ui
+++ b/ktron/ai.ui
@@ -1,10 +1,10 @@
<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
<class>Ai</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>Ai</cstring>
</property>
- <property name="geometry">
+ <property name="tqgeometry">
<rect>
<x>0</x>
<y>0</y>
@@ -22,7 +22,7 @@
<property name="spacing">
<number>0</number>
</property>
- <widget class="QFrame">
+ <widget class="TQFrame">
<property name="name">
<cstring>frame9</cstring>
</property>
@@ -39,7 +39,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QGroupBox" row="0" column="0" rowspan="1" colspan="3">
+ <widget class="TQGroupBox" row="0" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>groupBox3</cstring>
</property>
@@ -50,7 +50,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>kcfg_Computerplayer1</cstring>
</property>
@@ -58,7 +58,7 @@
<string>Player &amp;1</string>
</property>
</widget>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>kcfg_Computerplayer2</cstring>
</property>
@@ -78,14 +78,14 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>101</width>
<height>20</height>
</size>
</property>
</spacer>
- <widget class="QLabel" row="1" column="0">
+ <widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>textLabel15</cstring>
</property>
@@ -93,7 +93,7 @@
<string>Intelligence:</string>
</property>
</widget>
- <widget class="QComboBox" row="1" column="1">
+ <widget class="TQComboBox" row="1" column="1">
<item>
<property name="text">
<string>Beginner</string>
@@ -126,7 +126,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>20</width>
<height>60</height>
@@ -137,5 +137,5 @@
</widget>
</vbox>
</widget>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
</UI>
diff --git a/ktron/appearance.ui b/ktron/appearance.ui
index af50183f..9c2ef5a6 100644
--- a/ktron/appearance.ui
+++ b/ktron/appearance.ui
@@ -1,10 +1,10 @@
<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
<class>Appearance</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>Appearance</cstring>
</property>
- <property name="geometry">
+ <property name="tqgeometry">
<rect>
<x>0</x>
<y>0</y>
@@ -22,7 +22,7 @@
<property name="spacing">
<number>0</number>
</property>
- <widget class="QFrame">
+ <widget class="TQFrame">
<property name="name">
<cstring>frame4</cstring>
</property>
@@ -39,7 +39,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>textLabel16</cstring>
</property>
@@ -47,7 +47,7 @@
<string>Line style:</string>
</property>
</widget>
- <widget class="QComboBox" row="0" column="2">
+ <widget class="TQComboBox" row="0" column="2">
<item>
<property name="text">
<string>3D Line</string>
@@ -72,7 +72,7 @@
<cstring>kcfg_Style</cstring>
</property>
</widget>
- <widget class="QGroupBox" row="1" column="0" rowspan="1" colspan="3">
+ <widget class="TQGroupBox" row="1" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>groupBox4</cstring>
</property>
@@ -83,40 +83,40 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel" row="1" column="2">
+ <widget class="TQLabel" row="1" column="2">
<property name="name">
<cstring>textLabel13</cstring>
</property>
<property name="text">
<string>Large</string>
</property>
- <property name="alignment">
+ <property name="tqalignment">
<set>AlignVCenter|AlignRight</set>
</property>
</widget>
- <widget class="QLabel" row="1" column="0">
+ <widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>textLabel11</cstring>
</property>
<property name="text">
<string>Small</string>
</property>
- <property name="alignment">
+ <property name="tqalignment">
<set>AlignVCenter|AlignLeft</set>
</property>
</widget>
- <widget class="QLabel" row="1" column="1">
+ <widget class="TQLabel" row="1" column="1">
<property name="name">
<cstring>textLabel12</cstring>
</property>
<property name="text">
<string>Medium</string>
</property>
- <property name="alignment">
+ <property name="tqalignment">
<set>AlignCenter</set>
</property>
</widget>
- <widget class="QSlider" row="0" column="0" rowspan="1" colspan="3">
+ <widget class="TQSlider" row="0" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>kcfg_RectSize</cstring>
</property>
@@ -147,7 +147,7 @@
</widget>
</grid>
</widget>
- <widget class="QButtonGroup" row="2" column="0" rowspan="1" colspan="3">
+ <widget class="TQButtonGroup" row="2" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>kcfg_BackgroundImageChoice</cstring>
</property>
@@ -158,7 +158,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QRadioButton" row="0" column="0">
+ <widget class="TQRadioButton" row="0" column="0">
<property name="name">
<cstring>BackgroundColorChoice</cstring>
</property>
@@ -177,7 +177,7 @@
<bool>false</bool>
</property>
</widget>
- <widget class="QRadioButton" row="1" column="0">
+ <widget class="TQRadioButton" row="1" column="0">
<property name="name">
<cstring>BackgroundImageChoice</cstring>
</property>
@@ -205,7 +205,7 @@
</widget>
</grid>
</widget>
- <widget class="QLabel" row="3" column="0">
+ <widget class="TQLabel" row="3" column="0">
<property name="name">
<cstring>textLabel7</cstring>
</property>
@@ -228,7 +228,7 @@
</color>
</property>
</widget>
- <widget class="QLabel" row="4" column="0">
+ <widget class="TQLabel" row="4" column="0">
<property name="name">
<cstring>textLabel8</cstring>
</property>
@@ -261,7 +261,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>20</width>
<height>16</height>
@@ -292,7 +292,7 @@
<tabstop>kcfg_Color_Player1</tabstop>
<tabstop>kcfg_Color_Player2</tabstop>
</tabstops>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>kurlrequester.h</includehint>
<includehint>klineedit.h</includehint>
diff --git a/ktron/general.ui b/ktron/general.ui
index ca492b9e..22827e7b 100644
--- a/ktron/general.ui
+++ b/ktron/general.ui
@@ -1,10 +1,10 @@
<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
<class>General</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>General</cstring>
</property>
- <property name="geometry">
+ <property name="tqgeometry">
<rect>
<x>0</x>
<y>0</y>
@@ -22,7 +22,7 @@
<property name="spacing">
<number>0</number>
</property>
- <widget class="QFrame">
+ <widget class="TQFrame">
<property name="name">
<cstring>frame4</cstring>
</property>
@@ -39,7 +39,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QGroupBox">
+ <widget class="TQGroupBox">
<property name="name">
<cstring>groupBox1</cstring>
</property>
@@ -50,7 +50,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>kcfg_ChangeWinnerColor</cstring>
</property>
@@ -58,7 +58,7 @@
<string>&amp;Show winner by changing color</string>
</property>
</widget>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>kcfg_AcceleratorBlocked</cstring>
</property>
@@ -66,7 +66,7 @@
<string>&amp;Disable acceleration</string>
</property>
</widget>
- <widget class="QCheckBox">
+ <widget class="TQCheckBox">
<property name="name">
<cstring>kcfg_OppositeDirCrashes</cstring>
</property>
@@ -76,7 +76,7 @@
</widget>
</vbox>
</widget>
- <widget class="QGroupBox">
+ <widget class="TQGroupBox">
<property name="name">
<cstring>groupBox2</cstring>
</property>
@@ -87,17 +87,17 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLineEdit" row="0" column="1">
+ <widget class="TQLineEdit" row="0" column="1">
<property name="name">
<cstring>kcfg_NamePlayer1</cstring>
</property>
</widget>
- <widget class="QLineEdit" row="1" column="1">
+ <widget class="TQLineEdit" row="1" column="1">
<property name="name">
<cstring>kcfg_NamePlayer2</cstring>
</property>
</widget>
- <widget class="QLabel" row="0" column="0">
+ <widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>textLabel1</cstring>
</property>
@@ -105,7 +105,7 @@
<string>Player 1:</string>
</property>
</widget>
- <widget class="QLabel" row="1" column="0">
+ <widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>textLabel2</cstring>
</property>
@@ -115,7 +115,7 @@
</widget>
</grid>
</widget>
- <widget class="QGroupBox">
+ <widget class="TQGroupBox">
<property name="name">
<cstring>groupBox3</cstring>
</property>
@@ -126,7 +126,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QSlider">
+ <widget class="TQSlider">
<property name="name">
<cstring>kcfg_Velocity</cstring>
</property>
@@ -152,15 +152,15 @@
<number>1</number>
</property>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout1</cstring>
+ <cstring>tqlayout1</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>textLabel4</cstring>
</property>
@@ -168,25 +168,25 @@
<string>Slow</string>
</property>
</widget>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>textLabel5</cstring>
</property>
<property name="text">
<string>Default</string>
</property>
- <property name="alignment">
+ <property name="tqalignment">
<set>AlignCenter</set>
</property>
</widget>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>textLabel6</cstring>
</property>
<property name="text">
<string>Fast</string>
</property>
- <property name="alignment">
+ <property name="tqalignment">
<set>AlignVCenter|AlignRight</set>
</property>
</widget>
@@ -204,7 +204,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>20</width>
<height>21</height>
@@ -215,5 +215,5 @@
</widget>
</vbox>
</widget>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
</UI>
diff --git a/ktron/ktron.cpp b/ktron/ktron.cpp
index c9a5ea77..16628fd9 100644
--- a/ktron/ktron.cpp
+++ b/ktron/ktron.cpp
@@ -42,11 +42,11 @@
/**
* Constuctor
*/
-KTron::KTron(TQWidget *parent, const char *name) : KMainWindow(parent, name) {
+KTron::KTron(TQWidget *tqparent, const char *name) : KMainWindow(tqparent, name) {
playerPoints[0]=playerPoints[1]=0;
tron=new Tron(this, "Tron");
- connect(tron,TQT_SIGNAL(gameEnds(Player)),TQT_SLOT(changeStatus(Player)));
+ connect(tron,TQT_SIGNAL(gameEnds(Player)),TQT_SLOT(changetqStatus(Player)));
setCentralWidget(tron);
tron->setMinimumSize(200,180);
@@ -81,10 +81,10 @@ KTron::KTron(TQWidget *parent, const char *name) : KMainWindow(parent, name) {
tron->setActionCollection(actionCollection());
- KStdGameAction::pause(tron, TQT_SLOT(togglePause()), actionCollection());
- KStdGameAction::gameNew( tron, TQT_SLOT( newGame() ), actionCollection() );
- KStdGameAction::quit(this, TQT_SLOT( close() ), actionCollection());
- KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection());
+ KStdGameAction::pause(TQT_TQOBJECT(tron), TQT_SLOT(togglePause()), actionCollection());
+ KStdGameAction::gameNew( TQT_TQOBJECT(tron), TQT_SLOT( newGame() ), actionCollection() );
+ KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT( close() ), actionCollection());
+ KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(showSettings()), actionCollection());
setupGUI( KMainWindow::Keys | StatusBar | Save | Create);
loadSettings();
@@ -108,17 +108,17 @@ void KTron::updateStatusbar(){
TQString name;
if(tron->isComputer(Both))
- name=i18n("Computer(%1)").arg(i+1);
+ name=i18n("Computer(%1)").tqarg(i+1);
else if(tron->isComputer(player))
name=i18n("Computer");
else
name=playerName[i];
- TQString string = TQString("%1: %2").arg(name).arg(playerPoints[i]);
+ TQString string = TQString("%1: %2").tqarg(name).tqarg(playerPoints[i]);
statusBar()->changeItem(string,ID_STATUS_BASE+i+1);
}
}
-void KTron::changeStatus(Player player) {
+void KTron::changetqStatus(Player player) {
// if player=Nobody, then new game
if(player==Nobody){
playerPoints[0]=playerPoints[1]=0;
@@ -158,12 +158,12 @@ void KTron::showWinner(Player winner){
if(!tron->isComputer(winner))
winnerName = playerName[winner];
- TQString message=i18n("%1 has won!").arg(winnerName);
+ TQString message=i18n("%1 has won!").tqarg(winnerName);
statusBar()->message(message,MESSAGE_TIME);
message = i18n("%1 has won versus %2 with %3 : %4 points!");
- message=message.arg(winnerName).arg(loserName);
- message=message.arg(playerPoints[winner]).arg(playerPoints[loser]);
+ message=message.tqarg(winnerName).tqarg(loserName);
+ message=message.tqarg(playerPoints[winner]).tqarg(playerPoints[loser]);
KMessageBox::information(this, message, i18n("Winner"));
tron->newGame();
diff --git a/ktron/ktron.h b/ktron/ktron.h
index c61bf42b..e4b9b218 100644
--- a/ktron/ktron.h
+++ b/ktron/ktron.h
@@ -39,9 +39,10 @@ class Tron;
class KTron : public KMainWindow {
Q_OBJECT
+ TQ_OBJECT
public:
- KTron(TQWidget *parent=0, const char *name=0);
+ KTron(TQWidget *tqparent=0, const char *name=0);
private:
KAccel *accel;
@@ -57,7 +58,7 @@ protected:
private slots:
void loadSettings();
/** updates players points in statusbar and checks if someone has won */
- void changeStatus(Player);
+ void changetqStatus(Player);
void showWinner(Player winner);
void showSettings();
diff --git a/ktron/tron.cpp b/ktron/tron.cpp
index 1c7bf72c..92a5d296 100644
--- a/ktron/tron.cpp
+++ b/ktron/tron.cpp
@@ -41,8 +41,8 @@
* init-functions
**/
-Tron::Tron(TQWidget *parent,const char *name)
- : TQWidget(parent,name)
+Tron::Tron(TQWidget *tqparent,const char *name)
+ : TQWidget(tqparent,name)
{
pixmap=0;
playfield=0;
@@ -51,7 +51,7 @@ Tron::Tron(TQWidget *parent,const char *name)
random.setSeed(0);
- setFocusPolicy(TQWidget::StrongFocus);
+ setFocusPolicy(TQ_StrongFocus);
setBackgroundMode(NoBackground);
gameBlocked=false;
@@ -81,7 +81,7 @@ void Tron::loadSettings(){
// Style
if(pixmap){
updatePixmap();
- repaint();
+ tqrepaint();
}
// Backgroundimage
@@ -96,7 +96,7 @@ void Tron::loadSettings(){
setBackgroundPix(pix);
} else {
TQString msg=i18n("Wasn't able to load wallpaper\n%1");
- msg=msg.arg(tmpFile);
+ msg=msg.tqarg(tmpFile);
KMessageBox::sorry(this, msg);
}
KIO::NetAccess::removeTempFile(tmpFile);
@@ -268,7 +268,7 @@ void Tron::showWinner(Player player)
updatePixmap();
}
- repaint();
+ tqrepaint();
emit gameEnds(player);
@@ -302,7 +302,7 @@ void Tron::updatePixmap()
TQPainter p;
p.begin(pixmap);
- // alle Pixel prüfen und evt. zeichnen
+ // alle Pixel pr�fen und evt. zeichnen
for(i=0;i<fieldWidth;i++)
for(j=0;j<fieldHeight;j++)
{
@@ -313,8 +313,8 @@ void Tron::updatePixmap()
}
// draw frame
- TQColor light=parentWidget()->colorGroup().midlight();
- TQColor dark=parentWidget()->colorGroup().mid();
+ TQColor light=tqparentWidget()->tqcolorGroup().midlight();
+ TQColor dark=tqparentWidget()->tqcolorGroup().mid();
p.setPen(NoPen);
p.setBrush(light);
@@ -810,18 +810,18 @@ void Tron::showBeginHint()
if(players[0].score==0 && players[1].score==0)
{
beginHint=true;
- repaint();
+ tqrepaint();
}
}
}
-// doMove() is called from QTimer
+// doMove() is called from TQTimer
void Tron::doMove()
{
int i;
for(i=0;i<2;i++)
{
- // Überprüfen, ob Acceleratortaste gedrückt wurde...
+ // �berpr�fen, ob Acceleratortaste gedr�ckt wurde...
if(players[i].accelerated)
{
updateDirections(i);
diff --git a/ktron/tron.h b/ktron/tron.h
index 188604d8..16e8722b 100644
--- a/ktron/tron.h
+++ b/ktron/tron.h
@@ -43,12 +43,13 @@ enum {BACKGROUND=0, PLAYER1=1,PLAYER2=2,TOP=4,BOTTOM=8,LEFT=16,RIGHT=32};
/**
* @short The playingfield
*/
-class Tron : public QWidget
+class Tron : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- Tron(TQWidget *parent=0, const char *name=0);
+ Tron(TQWidget *tqparent=0, const char *name=0);
~Tron();
void setActionCollection(KActionCollection*);
void updatePixmap();