diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
commit | 838baf3f99ec5ab81b063eb5449a3381d860f377 (patch) | |
tree | dd31abcfde08ca92e4623b8f50b3d762a87c997a /kjumpingcube | |
parent | 2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff) | |
download | tdegames-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 'kjumpingcube')
-rw-r--r-- | kjumpingcube/kcubeboxwidget.cpp | 26 | ||||
-rw-r--r-- | kjumpingcube/kcubeboxwidget.h | 11 | ||||
-rw-r--r-- | kjumpingcube/kcubewidget.cpp | 10 | ||||
-rw-r--r-- | kjumpingcube/kcubewidget.h | 3 | ||||
-rw-r--r-- | kjumpingcube/kjumpingcube.cpp | 38 | ||||
-rw-r--r-- | kjumpingcube/kjumpingcube.h | 1 | ||||
-rw-r--r-- | kjumpingcube/settings.ui | 46 |
7 files changed, 69 insertions, 66 deletions
diff --git a/kjumpingcube/kcubeboxwidget.cpp b/kjumpingcube/kcubeboxwidget.cpp index bca13210..57aecd15 100644 --- a/kjumpingcube/kcubeboxwidget.cpp +++ b/kjumpingcube/kcubeboxwidget.cpp @@ -30,8 +30,8 @@ #include "prefs.h" -KCubeBoxWidget::KCubeBoxWidget(const int d,TQWidget *parent,const char *name) - : TQWidget(parent,name), +KCubeBoxWidget::KCubeBoxWidget(const int d,TQWidget *tqparent,const char *name) + : TQWidget(tqparent,name), CubeBoxBase<KCubeWidget>(d) { init(); @@ -39,8 +39,8 @@ KCubeBoxWidget::KCubeBoxWidget(const int d,TQWidget *parent,const char *name) -KCubeBoxWidget::KCubeBoxWidget(CubeBox& box,TQWidget *parent,const char *name) - :TQWidget(parent,name), +KCubeBoxWidget::KCubeBoxWidget(CubeBox& box,TQWidget *tqparent,const char *name) + :TQWidget(tqparent,name), CubeBoxBase<KCubeWidget>(box.dim()) { init(); @@ -57,8 +57,8 @@ KCubeBoxWidget::KCubeBoxWidget(CubeBox& box,TQWidget *parent,const char *name) -KCubeBoxWidget::KCubeBoxWidget(const KCubeBoxWidget& box,TQWidget *parent,const char *name) - :TQWidget(parent,name), +KCubeBoxWidget::KCubeBoxWidget(const KCubeBoxWidget& box,TQWidget *tqparent,const char *name) + :TQWidget(tqparent,name), CubeBoxBase<KCubeWidget>(box.dim()) { init(); @@ -453,13 +453,13 @@ void KCubeBoxWidget::initCubes() int i,j; // create Layout - layout=new TQGridLayout(this,s,s); + tqlayout=new TQGridLayout(this,s,s); for(i=0;i<s;i++) { - layout->setRowStretch(i,1); - layout->setColStretch(i,1); + tqlayout->setRowStretch(i,1); + tqlayout->setColStretch(i,1); } @@ -474,7 +474,7 @@ void KCubeBoxWidget::initCubes() { cubes[i][j]=new KCubeWidget(this); cubes[i][j]->setCoordinates(i,j); - layout->addWidget(cubes[i][j],i,j); + tqlayout->addWidget(cubes[i][j],i,j); cubes[i][j]->show(); connect(cubes[i][j],TQT_SIGNAL(clicked(int,int,bool)),TQT_SLOT(stopHint())); connect(cubes[i][j],TQT_SIGNAL(clicked(int,int,bool)),TQT_SLOT(checkClick(int,int,bool))); @@ -504,15 +504,15 @@ void KCubeBoxWidget::initCubes() } -TQSize KCubeBoxWidget::sizeHint() const +TQSize KCubeBoxWidget::tqsizeHint() const { return TQSize(400,400); } void KCubeBoxWidget::deleteCubes() { - if(layout) - delete layout; + if(tqlayout) + delete tqlayout; CubeBoxBase<KCubeWidget>::deleteCubes(); } diff --git a/kjumpingcube/kcubeboxwidget.h b/kjumpingcube/kcubeboxwidget.h index e2bf73ca..e8d0553e 100644 --- a/kjumpingcube/kcubeboxwidget.h +++ b/kjumpingcube/kcubeboxwidget.h @@ -51,11 +51,12 @@ struct Loop class KCubeBoxWidget : public TQWidget , public CubeBoxBase<KCubeWidget> { Q_OBJECT + TQ_OBJECT public: - KCubeBoxWidget(const int dim=1,TQWidget *parent=0,const char *name=0); + KCubeBoxWidget(const int dim=1,TQWidget *tqparent=0,const char *name=0); - KCubeBoxWidget(CubeBox& box, TQWidget *parent=0,const char *name=0); - KCubeBoxWidget(const KCubeBoxWidget& box,TQWidget *parent=0,const char *name=0); + KCubeBoxWidget(CubeBox& box, TQWidget *tqparent=0,const char *name=0); + KCubeBoxWidget(const KCubeBoxWidget& box,TQWidget *tqparent=0,const char *name=0); virtual ~KCubeBoxWidget(); KCubeBoxWidget& operator= (CubeBox& box); @@ -130,7 +131,7 @@ signals: void stoppedThinking(); protected: - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; virtual void deleteCubes(); virtual void initCubes(); @@ -146,7 +147,7 @@ protected slots: private: void init(); - TQGridLayout *layout; + TQGridLayout *tqlayout; CubeBox *undoBox; Brain brain; diff --git a/kjumpingcube/kcubewidget.cpp b/kjumpingcube/kcubewidget.cpp index 27797683..d4556eac 100644 --- a/kjumpingcube/kcubewidget.cpp +++ b/kjumpingcube/kcubewidget.cpp @@ -73,9 +73,9 @@ TQPalette KCubeWidget::color(Owner forWhom) ** public functions ** ** ****************************************************** */ -KCubeWidget::KCubeWidget(TQWidget* parent,const char* name +KCubeWidget::KCubeWidget(TQWidget* tqparent,const char* name ,Owner owner,int value,int max) - : TQFrame(parent,name), + : TQFrame(tqparent,name), Cube(owner,value,max) { setFrameStyle(Panel|Raised); @@ -85,7 +85,7 @@ KCubeWidget::KCubeWidget(TQWidget* parent,const char* name setCoordinates(0,0); //initialize hintTimer - // will be automatically destroyed by the parent + // will be automatically destroyed by the tqparent hintTimer = new TQTimer(this); hintCounter=0; connect(hintTimer,TQT_SIGNAL(timeout()),TQT_SLOT(hint())); @@ -93,7 +93,7 @@ KCubeWidget::KCubeWidget(TQWidget* parent,const char* name setPalette(kapp->palette()); // show values - repaint(false); + tqrepaint(false); } KCubeWidget::~KCubeWidget() @@ -240,7 +240,7 @@ void KCubeWidget::mouseReleaseEvent(TQMouseEvent *e) if(e->x()< 0 || e->x() > width() || e->y() < 0 || e->y() > height()) return; - if(e->button() == LeftButton && _clicksAllowed) + if(e->button() == Qt::LeftButton && _clicksAllowed) { stopHint(); emit clicked(row(),column(),true); diff --git a/kjumpingcube/kcubewidget.h b/kjumpingcube/kcubewidget.h index 804a9db4..3f578c13 100644 --- a/kjumpingcube/kcubewidget.h +++ b/kjumpingcube/kcubewidget.h @@ -35,10 +35,11 @@ class TQTimer; class KCubeWidget : public TQFrame , public Cube { Q_OBJECT + TQ_OBJECT public: /** constructs a new KCubeWidget*/ - KCubeWidget(TQWidget* parent=0,const char* name=0 + KCubeWidget(TQWidget* tqparent=0,const char* name=0 ,Owner owner=Cube::Nobody,int value=1,int max=0); virtual ~KCubeWidget(); diff --git a/kjumpingcube/kjumpingcube.cpp b/kjumpingcube/kjumpingcube.cpp index f63665af..a35dcf19 100644 --- a/kjumpingcube/kjumpingcube.cpp +++ b/kjumpingcube/kjumpingcube.cpp @@ -64,7 +64,7 @@ KJumpingCube::KJumpingCube() statusBar()->insertItem(s,ID_STATUS_TURN_TEXT, false); statusBar()->changeItem(s,ID_STATUS_TURN_TEXT); statusBar()->setItemAlignment (ID_STATUS_TURN_TEXT, AlignLeft | AlignVCenter); - statusBar()->setFixedHeight( statusBar()->sizeHint().height() ); + statusBar()->setFixedHeight( statusBar()->tqsizeHint().height() ); currentPlayer = new TQWidget(this, "currentPlayer"); currentPlayer->setFixedWidth(40); @@ -76,19 +76,19 @@ KJumpingCube::KJumpingCube() } void KJumpingCube::initKAction() { - KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection()); - KStdGameAction::load(this, TQT_SLOT(openGame()), actionCollection()); - KStdGameAction::save(this, TQT_SLOT(save()), actionCollection()); - KStdGameAction::saveAs(this, TQT_SLOT(saveAs()), actionCollection()); - KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection()); + KStdGameAction::load(TQT_TQOBJECT(this), TQT_SLOT(openGame()), actionCollection()); + KStdGameAction::save(TQT_TQOBJECT(this), TQT_SLOT(save()), actionCollection()); + KStdGameAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(saveAs()), actionCollection()); + KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); - hintAction = KStdGameAction::hint(view, TQT_SLOT(getHint()), actionCollection()); + hintAction = KStdGameAction::hint(TQT_TQOBJECT(view), TQT_SLOT(getHint()), actionCollection()); stopAction = new KAction(i18n("Stop &Thinking"), "stop", - Qt::Key_Escape, this, TQT_SLOT(stop()), actionCollection(), "game_stop"); + TQt::Key_Escape, TQT_TQOBJECT(this), TQT_SLOT(stop()), actionCollection(), "game_stop"); stopAction->setEnabled(false); - undoAction = KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); + undoAction = KStdGameAction::undo(TQT_TQOBJECT(this), TQT_SLOT(undo()), actionCollection()); undoAction->setEnabled(false); - KStdAction::preferences(this, TQT_SLOT(showOptions()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(showOptions()), actionCollection()); setupGUI(); } @@ -123,8 +123,8 @@ void KJumpingCube::saveGame(bool saveAs) if(KIO::NetAccess::exists(url,false,this)) { TQString mes=i18n("The file %1 exists.\n" - "Do you want to overwrite it?").arg(url.url()); - result = KMessageBox::warningContinueCancel(this, mes, TQString::null, i18n("Overwrite")); + "Do you want to overwrite it?").tqarg(url.url()); + result = KMessageBox::warningContinueCancel(this, mes, TQString(), i18n("Overwrite")); if(result==KMessageBox::Cancel) return; } @@ -147,12 +147,12 @@ void KJumpingCube::saveGame(bool saveAs) if(KIO::NetAccess::upload( tempFile.name(),gameURL,this )) { TQString s=i18n("game saved as %1"); - s=s.arg(gameURL.url()); + s=s.tqarg(gameURL.url()); statusBar()->message(s,MESSAGE_TIME); } else { - KMessageBox::sorry(this,i18n("There was an error in saving file\n%1").arg(gameURL.url())); + KMessageBox::sorry(this,i18n("There was an error in saving file\n%1").tqarg(gameURL.url())); } } @@ -168,7 +168,7 @@ void KJumpingCube::openGame() return; if(!KIO::NetAccess::exists(url,true,this)) { - TQString mes=i18n("The file %1 does not exist!").arg(url.url()); + TQString mes=i18n("The file %1 does not exist!").tqarg(url.url()); KMessageBox::sorry(this,mes); fileOk=false; } @@ -183,7 +183,7 @@ void KJumpingCube::openGame() if(!config.hasKey("Version")) { TQString mes=i18n("The file %1 isn't a KJumpingCube gamefile!") - .arg(url.url()); + .tqarg(url.url()); KMessageBox::sorry(this,mes); return; } @@ -197,7 +197,7 @@ void KJumpingCube::openGame() KIO::NetAccess::removeTempFile( tempFile ); } else - KMessageBox::sorry(this,i18n("There was an error loading file\n%1").arg( url.url() )); + KMessageBox::sorry(this,i18n("There was an error loading file\n%1").tqarg( url.url() )); } void KJumpingCube::stop() @@ -223,11 +223,11 @@ void KJumpingCube::changePlayer(int newPlayer) { undoAction->setEnabled(true); currentPlayer->setBackgroundColor(newPlayer == 1 ? Prefs::color1() : Prefs::color2()); - currentPlayer->repaint(); + currentPlayer->tqrepaint(); } void KJumpingCube::showWinner(int player) { - TQString s=i18n("Winner is Player %1!").arg(player); + TQString s=i18n("Winner is Player %1!").tqarg(player); KMessageBox::information(this,s,i18n("Winner")); view->reset(); } diff --git a/kjumpingcube/kjumpingcube.h b/kjumpingcube/kjumpingcube.h index 3d2774f4..14216922 100644 --- a/kjumpingcube/kjumpingcube.h +++ b/kjumpingcube/kjumpingcube.h @@ -42,6 +42,7 @@ class KCubeBoxWidget; */ class KJumpingCube : public KMainWindow { Q_OBJECT + TQ_OBJECT public: /** Default Constructor */ diff --git a/kjumpingcube/settings.ui b/kjumpingcube/settings.ui index 43908b76..d632e88a 100644 --- a/kjumpingcube/settings.ui +++ b/kjumpingcube/settings.ui @@ -1,10 +1,10 @@ <!DOCTYPE UI><UI version="3.1" stdsetdef="1"> <class>Settings</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>Settings</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>frame3</cstring> </property> @@ -39,7 +39,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QGroupBox" row="0" column="1"> + <widget class="TQGroupBox" row="0" column="1"> <property name="name"> <cstring>groupBox3</cstring> </property> @@ -56,7 +56,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <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_CubeDim</cstring> </property> @@ -79,7 +79,7 @@ <enum>Right</enum> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel6</cstring> </property> @@ -87,14 +87,14 @@ <string>5x5</string> </property> </widget> - <widget class="QLabel" row="1" column="2"> + <widget class="TQLabel" row="1" column="2"> <property name="name"> <cstring>textLabel8</cstring> </property> <property name="text"> <string>10x10</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> @@ -110,14 +110,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>16</height> </size> </property> </spacer> - <widget class="QGroupBox" row="1" column="1"> + <widget class="TQGroupBox" row="1" column="1"> <property name="name"> <cstring>groupBox7</cstring> </property> @@ -136,7 +136,7 @@ <string></string> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -144,7 +144,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> @@ -162,7 +162,7 @@ </widget> </grid> </widget> - <widget class="QGroupBox" row="0" column="0"> + <widget class="TQGroupBox" row="0" column="0"> <property name="name"> <cstring>groupBox2</cstring> </property> @@ -173,18 +173,18 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="1" column="1"> + <widget class="TQLabel" row="1" column="1"> <property name="name"> <cstring>textLabel4</cstring> </property> <property name="text"> <string>Average</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignCenter</set> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel3</cstring> </property> @@ -192,18 +192,18 @@ <string>Beginner</string> </property> </widget> - <widget class="QLabel" row="1" column="2"> + <widget class="TQLabel" row="1" column="2"> <property name="name"> <cstring>textLabel5</cstring> </property> <property name="text"> <string>Expert</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</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_Skill</cstring> </property> @@ -225,7 +225,7 @@ </widget> </grid> </widget> - <widget class="QGroupBox" row="1" column="0"> + <widget class="TQGroupBox" row="1" column="0"> <property name="name"> <cstring>groupBox1</cstring> </property> @@ -236,7 +236,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>kcfg_ComputerPlayer1</cstring> </property> @@ -244,7 +244,7 @@ <string>Player 1</string> </property> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>kcfg_ComputerPlayer2</cstring> </property> @@ -261,7 +261,7 @@ </widget> </vbox> </widget> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kcolorbutton.h</includehint> </includehints> |