summaryrefslogtreecommitdiffstats
path: root/libksirtet/base/board.cpp
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 /libksirtet/base/board.cpp
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 'libksirtet/base/board.cpp')
-rw-r--r--libksirtet/base/board.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/libksirtet/base/board.cpp b/libksirtet/base/board.cpp
index 257e72c3..12193e31 100644
--- a/libksirtet/base/board.cpp
+++ b/libksirtet/base/board.cpp
@@ -12,14 +12,14 @@
using namespace KGrid2D;
//-----------------------------------------------------------------------------
-FixedCanvasView::FixedCanvasView(QWidget *parent, const char *name)
- : QCanvasView(parent, name, WNoAutoErase)
+FixedCanvasView::FixedCanvasView(TQWidget *parent, const char *name)
+ : TQCanvasView(parent, name, WNoAutoErase)
{}
-QSize FixedCanvasView::sizeHint() const
+TQSize FixedCanvasView::sizeHint() const
{
- if ( canvas()==0 ) return QSize();
- return canvas()->size() + 2 * QSize(frameWidth(), frameWidth());
+ if ( canvas()==0 ) return TQSize();
+ return canvas()->size() + 2 * TQSize(frameWidth(), frameWidth());
}
void FixedCanvasView::adjustSize()
@@ -35,7 +35,7 @@ const BaseBoard::DirectionData BaseBoard::DIRECTION_DATA[Nb_Direction] = {
{ SquareBase::Up, Down }
};
-BaseBoard::BaseBoard(bool graphic, QWidget *parent)
+BaseBoard::BaseBoard(bool graphic, TQWidget *parent)
: FixedCanvasView(parent, "board"),
GenericTetris(bfactory->bbi.width, bfactory->bbi.height,
bfactory->bbi.withPieces, graphic),
@@ -45,7 +45,7 @@ BaseBoard::BaseBoard(bool graphic, QWidget *parent)
if (graphic) {
setVScrollBarMode(AlwaysOff);
setHScrollBarMode(AlwaysOff);
- setFrameStyle( QFrame::Panel | QFrame::Sunken );
+ setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
sequences = new SequenceArray;
main = new BlockInfo(*sequences);
@@ -54,7 +54,7 @@ BaseBoard::BaseBoard(bool graphic, QWidget *parent)
_next = new BlockInfo(*sequences);
setBlockInfo(main, _next);
- connect(&timer, SIGNAL(timeout()), SLOT(timeout()));
+ connect(&timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeout()));
Piece::info().loadColors();
KZoomMainWindow::addWidget(this);
@@ -83,7 +83,7 @@ void BaseBoard::adjustSize()
for (uint j=0; j<firstClearLine(); j++) {
Coord c(i, j);
if ( matrix()[c]==0 ) continue;
- partialMoveBlock(c, QPoint(0, 0));
+ partialMoveBlock(c, TQPoint(0, 0));
}
if (_next) {
@@ -143,10 +143,10 @@ void BaseBoard::gameOver()
emit gameOverSignal();
}
-void BaseBoard::showCanvas(QCanvas *c, bool show)
+void BaseBoard::showCanvas(TQCanvas *c, bool show)
{
- QCanvasItemList l = c->allItems();
- QCanvasItemList::Iterator it;
+ TQCanvasItemList l = c->allItems();
+ TQCanvasItemList::Iterator it;
for (it=l.begin(); it!=l.end(); ++it) {
if (show) (*it)->show();
else (*it)->hide();
@@ -236,7 +236,7 @@ bool BaseBoard::doFall(bool doAll, bool first, bool lineByLine)
// we do not rely on firstClearLine() here since this method is
// used in kfouleggs to make gift blocks fall down ...
uint h = 0;
- QMemArray<uint> heights(matrix().height());
+ TQMemArray<uint> heights(matrix().height());
for (uint j=1; j<matrix().height(); j++) { // first line cannot fall
Coord src(i, j);
if ( toFall(src) ) h++;
@@ -347,7 +347,7 @@ void BaseBoard::partialBlockFall(const Coord &src, const Coord &dest)
float c = float(loop+1) / bfactory->bbi.nbFallStages * BasePrefs::blockSize();
int xdec = dest.first - src.first;
int ydec = src.second - dest.second;
- QPoint p(int(xdec * c), int(ydec * c));
+ TQPoint p(int(xdec * c), int(ydec * c));
partialMoveBlock(src, p);
}
@@ -383,11 +383,11 @@ void BaseBoard::blockInGroup(Square<int> &field, const Coord &c, uint value,
_findGroup(field, c, nb, set);
}
-QMemArray<uint> BaseBoard::findGroups(Square<int> &field, uint minSize,
+TQMemArray<uint> BaseBoard::findGroups(Square<int> &field, uint minSize,
bool exitAtFirstFound) const
{
field.fill(0);
- QMemArray<uint> groups;
+ TQMemArray<uint> groups;
for (uint j=0; j<firstClearLine(); j++)
for (uint i=0; i<matrix().width(); i++) {
Coord c(i, j);