summaryrefslogtreecommitdiffstats
path: root/kenolaba/BoardWidget.cpp
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 /kenolaba/BoardWidget.cpp
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 'kenolaba/BoardWidget.cpp')
-rw-r--r--kenolaba/BoardWidget.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/kenolaba/BoardWidget.cpp b/kenolaba/BoardWidget.cpp
index da6358c7..af4a103a 100644
--- a/kenolaba/BoardWidget.cpp
+++ b/kenolaba/BoardWidget.cpp
@@ -34,8 +34,8 @@
#include "bitmaps/Arrow6"
#include "bitmaps/Arrow6Mask"
-BoardWidget::BoardWidget(Board& b, TQWidget *parent, const char *name)
- : BallWidget(10,9,parent, name), board(b)
+BoardWidget::BoardWidget(Board& b, TQWidget *tqparent, const char *name)
+ : BallWidget(10,9,tqparent, name), board(b)
{
pList =0;
gettingMove = false;
@@ -164,7 +164,7 @@ void BoardWidget::paintEvent(TQPaintEvent *)
{
if (renderMode) {
pm = boardPM;
- BallWidget::paint(&pm);
+ BallWidget::paint(TQT_TQPAINTDEVICE(&pm));
}
else
draw();
@@ -237,7 +237,7 @@ void BoardWidget::drawBoard()
#ifndef HAVE_KIR
TQColorGroup g = TQPalette( *boardColor ).active();
- TQColorGroup g2 = TQWidget::colorGroup();
+ TQColorGroup g2 = TQWidget::tqcolorGroup();
int boardSize = width() *10/12;
if (boardSize > height()) boardSize = height();
@@ -345,7 +345,7 @@ void BoardWidget::draw()
if (renderMode) {
updateBalls();
- repaint(false);
+ tqrepaint(false);
return;
}
@@ -631,7 +631,7 @@ void BoardWidget::choseMove(MoveList *pl)
*/
int BoardWidget::positionOf(int xx, int yy)
{
- int boardSize = QMIN( width()*10/12, height() );
+ int boardSize = TQMIN( width()*10/12, height() );
int x = (1000 * (xx- (width()-boardSize)/2)) / boardSize;
int y = (1000 * (yy- (height()-boardSize)/2)) / boardSize;
@@ -834,7 +834,7 @@ void BoardWidget::mousePressEvent( TQMouseEvent* pEvent )
int pos = positionOf( pEvent->x(), pEvent->y() );
int f = fieldOf(pos);
- if (pEvent->button() == RightButton) {
+ if (pEvent->button() == Qt::RightButton) {
emit rightButtonPressed(f, pEvent->globalPos());
return;
}
@@ -846,9 +846,9 @@ void BoardWidget::mousePressEvent( TQMouseEvent* pEvent )
if (editMode) {
- editColor = (pEvent->button() == MidButton) ?
+ editColor = (pEvent->button() == Qt::MidButton) ?
Board::color2 : Board::color1;
- int newColor = (pEvent->button() == MidButton) ?
+ int newColor = (pEvent->button() == Qt::MidButton) ?
Board::color2bright : Board::color1bright;
if (field[f] == Board::free) {
@@ -877,7 +877,7 @@ void BoardWidget::mousePressEvent( TQMouseEvent* pEvent )
return;
}
- startValid = isValidStart(pos, (pEvent->button() == MidButton));
+ startValid = isValidStart(pos, (pEvent->button() == Qt::MidButton));
kdDebug(12011) << "Start pos " << pos << " is valid: " << startValid << endl;
// actMove.print();
@@ -889,7 +889,7 @@ void BoardWidget::mousePressEvent( TQMouseEvent* pEvent )
TQString tmp;
actValue = - board.calcEvaluation();
- tmp = i18n("Board value: %1").arg(actValue);
+ tmp = i18n("Board value: %1").tqarg(actValue);
emit updateSpy(tmp);
}
@@ -918,7 +918,7 @@ void BoardWidget::mouseMoveEvent( TQMouseEvent* pEvent )
if (!startValid) {
/* We haven't a valid move yet. Check if we are over a valid start */
- startValid = isValidStart(pos, (pEvent->button() == MidButton));
+ startValid = isValidStart(pos, (pEvent->button() == Qt::MidButton));
kdDebug(12011) << "Start pos " << pos << " is valid: " << startValid << endl;
// actMove.print();
@@ -930,7 +930,7 @@ void BoardWidget::mouseMoveEvent( TQMouseEvent* pEvent )
TQString tmp;
actValue = - board.calcEvaluation();
- tmp = i18n("Board value: %1").arg(actValue);
+ tmp = i18n("Board value: %1").tqarg(actValue);
emit updateSpy(tmp);
return;
}
@@ -948,7 +948,7 @@ void BoardWidget::mouseMoveEvent( TQMouseEvent* pEvent )
TQString tmp;
tmp.sprintf("%+d", v-actValue);
- TQString str = TQString("%1 : %2").arg(actMove.name()).arg(tmp);
+ TQString str = TQString("%1 : %2").tqarg(actMove.name()).tqarg(tmp);
emit updateSpy(str);
showMove(actMove,3);
@@ -961,7 +961,7 @@ void BoardWidget::mouseMoveEvent( TQMouseEvent* pEvent )
if (pos == startPos) {
showStart(actMove,1);
startShown = true;
- tmp = i18n("Board value: %1").arg(actValue);
+ tmp = i18n("Board value: %1").tqarg(actValue);
}
else
draw();
@@ -1019,7 +1019,7 @@ void BoardWidget::mouseReleaseEvent( TQMouseEvent* pEvent )
emit updateSpy(tmp);
}
-TQSize BoardWidget::sizeHint() const
+TQSize BoardWidget::tqsizeHint() const
{
return TQSize(400, 350);
}