summaryrefslogtreecommitdiffstats
path: root/klickety
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 /klickety
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 'klickety')
-rw-r--r--klickety/board.cpp14
-rw-r--r--klickety/board.h8
-rw-r--r--klickety/field.cpp22
-rw-r--r--klickety/field.h6
-rw-r--r--klickety/highscores.cpp2
-rw-r--r--klickety/main.h4
-rw-r--r--klickety/piece.cpp26
-rw-r--r--klickety/piece.h6
8 files changed, 44 insertions, 44 deletions
diff --git a/klickety/board.cpp b/klickety/board.cpp
index 92969d6e..b60e766a 100644
--- a/klickety/board.cpp
+++ b/klickety/board.cpp
@@ -6,13 +6,13 @@
using namespace KGrid2D;
-void KLBoard::contentsMouseReleaseEvent(QMouseEvent *e)
+void KLBoard::contentsMouseReleaseEvent(TQMouseEvent *e)
{
if ( e->button()!=LeftButton || blocked ) return;
- QCanvasItemList list = canvas()->collisions(e->pos());
+ TQCanvasItemList list = canvas()->collisions(e->pos());
if ( list.count()==0 ) return;
- QCanvasSprite *spr = static_cast<QCanvasSprite *>(list.first());
+ TQCanvasSprite *spr = static_cast<TQCanvasSprite *>(list.first());
Coord c = findSprite(spr);
field.fill(0);
addRemoved = findGroup(field, c);
@@ -26,7 +26,7 @@ void KLBoard::contentsMouseReleaseEvent(QMouseEvent *e)
}
}
-KLBoard::KLBoard(QWidget *parent)
+KLBoard::KLBoard(TQWidget *parent)
: BaseBoard(true, parent),
field(matrix().width(), matrix().height()),
empty(matrix().width()),
@@ -52,7 +52,7 @@ void KLBoard::start(const GTInitData &data)
showBoard(true);
}
-Coord KLBoard::findSprite(QCanvasSprite *spr) const
+Coord KLBoard::findSprite(TQCanvasSprite *spr) const
{
for (uint i=0; i<matrix().width(); i++)
for (uint j=0; j<matrix().height(); j++) {
@@ -111,7 +111,7 @@ bool KLBoard::doSlide(bool doAll, bool first, bool lineByLine)
for (uint j=0; j<firstClearLine(); j++) {
// compute
uint h = 0;
- QMemArray<uint> heights(matrix().width());
+ TQMemArray<uint> heights(matrix().width());
for (uint i=1; i<matrix().width(); i++) { // first column cannot slide
Coord src(i, j);
if ( toSlide(src) ) h++;
@@ -157,7 +157,7 @@ bool KLBoard::afterAfterRemove()
{
// check if there are remaining groups
field.fill(0);
- QMemArray<uint> groups = findGroups(field, 2, true);
+ TQMemArray<uint> groups = findGroups(field, 2, true);
blocked = false;
return groups.size()!=0;
}
diff --git a/klickety/board.h b/klickety/board.h
index d239f83d..472556b7 100644
--- a/klickety/board.h
+++ b/klickety/board.h
@@ -8,7 +8,7 @@ class KLBoard : public BaseBoard
{
Q_OBJECT
public:
- KLBoard(QWidget *parent);
+ KLBoard(TQWidget *parent);
void start(const GTInitData &data);
@@ -18,11 +18,11 @@ class KLBoard : public BaseBoard
private:
KGrid2D::Square<int> field;
bool sliding;
- QMemArray<bool> empty;
+ TQMemArray<bool> empty;
uint addRemoved;
bool blocked;
- KGrid2D::Coord findSprite(QCanvasSprite *) const;
+ KGrid2D::Coord findSprite(TQCanvasSprite *) const;
AfterRemoveResult afterRemove(bool doAll, bool first);
bool afterAfterRemove();
bool toBeRemoved(const KGrid2D::Coord &) const;
@@ -32,7 +32,7 @@ class KLBoard : public BaseBoard
bool doSlide(bool doAll, bool first, bool lineByLine);
void computeInfos();
- void contentsMouseReleaseEvent(QMouseEvent *);
+ void contentsMouseReleaseEvent(TQMouseEvent *);
};
#endif
diff --git a/klickety/field.cpp b/klickety/field.cpp
index 4b85a3fe..67533acc 100644
--- a/klickety/field.cpp
+++ b/klickety/field.cpp
@@ -1,8 +1,8 @@
#include "field.h"
#include "field.moc"
-#include <qwhatsthis.h>
-#include <qlayout.h>
+#include <tqwhatsthis.h>
+#include <tqlayout.h>
#include <kapplication.h>
#include <klocale.h>
@@ -11,13 +11,13 @@
#include "base/board.h"
-Field::Field(QWidget *parent)
- : QWidget(parent, "field"), BaseField(this)
+Field::Field(TQWidget *parent)
+ : TQWidget(parent, "field"), BaseField(this)
{
KGameLCDList *sc = new KGameLCDList(i18n("Remaining blocks"), this);
showScore = new KGameLCD(3, sc);
sc->append(showScore);
- QWhatsThis::add(sc, i18n("<qt>Display the number of remaining "
+ TQWhatsThis::add(sc, i18n("<qt>Display the number of remaining "
"blocks.<br/>"
"It turns <font color=\"blue\">blue"
"</font> if it is a highscore "
@@ -28,17 +28,17 @@ Field::Field(QWidget *parent)
KGameLCDList *et = new KGameLCDList(i18n("Elapsed time"), this);
elapsedTime = new KGameLCDClock(et);
- connect(board, SIGNAL(firstBlockClicked()), elapsedTime, SLOT(start()));
+ connect(board, TQT_SIGNAL(firstBlockClicked()), elapsedTime, TQT_SLOT(start()));
et->append(elapsedTime);
lcds->addWidget(et, 5, 0);
lcds->setRowStretch(6, 1);
- connect(board, SIGNAL(scoreUpdated()), SLOT(scoreUpdatedSlot()));
- connect(board, SIGNAL(gameOverSignal()), SLOT(gameOver()));
+ connect(board, TQT_SIGNAL(scoreUpdated()), TQT_SLOT(scoreUpdatedSlot()));
+ connect(board, TQT_SIGNAL(gameOverSignal()), TQT_SLOT(gameOver()));
settingsChanged();
- connect(parent, SIGNAL(settingsChanged()), SLOT(settingsChanged()));
- QTimer::singleShot(0, this, SLOT(start()));
+ connect(parent, TQT_SIGNAL(settingsChanged()), TQT_SLOT(settingsChanged()));
+ TQTimer::singleShot(0, this, TQT_SLOT(start()));
}
void Field::pause()
@@ -52,7 +52,7 @@ void Field::pause()
void Field::start()
{
- init(false, false, true, true, QString::null);
+ init(false, false, true, true, TQString::null);
GTInitData data;
data.seed = kapp->random();
BaseField::start(data);
diff --git a/klickety/field.h b/klickety/field.h
index 67e6529b..7f1acb4f 100644
--- a/klickety/field.h
+++ b/klickety/field.h
@@ -1,18 +1,18 @@
#ifndef KL_FIELD_H
#define KL_FIELD_H
-#include <qwidget.h>
+#include <tqwidget.h>
#include "base/field.h"
#include "base/inter.h"
class KGameLCDClock;
-class Field : public QWidget, public BaseField, public BaseInterface
+class Field : public TQWidget, public BaseField, public BaseInterface
{
Q_OBJECT
public:
- Field(QWidget *parent);
+ Field(TQWidget *parent);
private slots:
void scoreUpdatedSlot() { scoreUpdated(); }
diff --git a/klickety/highscores.cpp b/klickety/highscores.cpp
index 6c49952e..62a2e28b 100644
--- a/klickety/highscores.cpp
+++ b/klickety/highscores.cpp
@@ -23,5 +23,5 @@ bool KLHighscores::isStrictlyLess(const Score &s1, const Score &s2) const
void KLHighscores::additionalQueryItems(KURL &url, const Score &s) const
{
uint time = s.data("time").toUInt();
- addToQueryURL(url, "scoreTime", QString::number(time));
+ addToQueryURL(url, "scoreTime", TQString::number(time));
}
diff --git a/klickety/main.h b/klickety/main.h
index e5b335f8..54443103 100644
--- a/klickety/main.h
+++ b/klickety/main.h
@@ -13,9 +13,9 @@ class KLFactory : public BaseFactory
KLFactory();
protected:
- virtual BaseBoard *createBoard(bool, QWidget *parent)
+ virtual BaseBoard *createBoard(bool, TQWidget *parent)
{ return new KLBoard(parent); }
- virtual BaseInterface *createInterface(QWidget *parent)
+ virtual BaseInterface *createInterface(TQWidget *parent)
{ return new Field(parent); }
};
diff --git a/klickety/piece.cpp b/klickety/piece.cpp
index 4a33910b..fcc2fdff 100644
--- a/klickety/piece.cpp
+++ b/klickety/piece.cpp
@@ -1,6 +1,6 @@
#include "piece.h"
-#include <qpainter.h>
+#include <tqpainter.h>
#include <klocale.h>
#include "base/board.h"
@@ -9,26 +9,26 @@ const char *KLPieceInfo::DEFAULT_COLORS[NB_BLOCK_TYPES] = {
"#C86464", "#64C864", "#6464C8", "#C8C864", "#C864C8"
};
-QColor KLPieceInfo::defaultColor(uint i) const
+TQColor KLPieceInfo::defaultColor(uint i) const
{
- if ( i>=nbColors() ) return QColor();
- return QColor(DEFAULT_COLORS[i]);
+ if ( i>=nbColors() ) return TQColor();
+ return TQColor(DEFAULT_COLORS[i]);
}
-QString KLPieceInfo::colorLabel(uint i) const
+TQString KLPieceInfo::colorLabel(uint i) const
{
return i18n("Color #%1:").arg(i+1);
}
-void KLPieceInfo::draw(QPixmap *pixmap, uint blockType, uint bMode,
+void KLPieceInfo::draw(TQPixmap *pixmap, uint blockType, uint bMode,
bool lighted) const
{
- QColor col = color(blockType);
+ TQColor col = color(blockType);
if (lighted) col = col.light();
pixmap->fill(col);
- QPainter p(pixmap);
- QRect r = pixmap->rect();
+ TQPainter p(pixmap);
+ TQRect r = pixmap->rect();
p.setPen(col.dark());
if ( !(bMode & BaseBoard::Up) )
@@ -42,11 +42,11 @@ void KLPieceInfo::draw(QPixmap *pixmap, uint blockType, uint bMode,
p.setPen(col.dark(110));
if (bMode & BaseBoard::Up)
- p.drawLine(r.topLeft()+QPoint(1,0), r.topRight()+QPoint(-1,0));
+ p.drawLine(r.topLeft()+TQPoint(1,0), r.topRight()+TQPoint(-1,0));
if (bMode & BaseBoard::Down)
- p.drawLine(r.bottomLeft()+QPoint(1,0), r.bottomRight()+QPoint(-1,0));
+ p.drawLine(r.bottomLeft()+TQPoint(1,0), r.bottomRight()+TQPoint(-1,0));
if (bMode & BaseBoard::Left)
- p.drawLine(r.topLeft()+QPoint(0,1), r.bottomLeft()+QPoint(0,-1));
+ p.drawLine(r.topLeft()+TQPoint(0,1), r.bottomLeft()+TQPoint(0,-1));
if (bMode & BaseBoard::Right)
- p.drawLine(r.topRight()+QPoint(0,1), r.bottomRight()+QPoint(0,-1));
+ p.drawLine(r.topRight()+TQPoint(0,1), r.bottomRight()+TQPoint(0,-1));
}
diff --git a/klickety/piece.h b/klickety/piece.h
index b7d192f0..6966ff80 100644
--- a/klickety/piece.h
+++ b/klickety/piece.h
@@ -24,11 +24,11 @@ class KLPieceInfo : public GPieceInfo
virtual uint nbBlockModes() const { return 1+4+6+4+1; }
virtual uint nbColors() const { return NB_BLOCK_TYPES; }
- virtual QString colorLabel(uint i) const;
- virtual QColor defaultColor(uint i) const;
+ virtual TQString colorLabel(uint i) const;
+ virtual TQColor defaultColor(uint i) const;
protected:
- void draw(QPixmap *, uint blockType, uint blockMode,
+ void draw(TQPixmap *, uint blockType, uint blockMode,
bool lighted) const;
private: