summaryrefslogtreecommitdiffstats
path: root/kfouleggs/piece.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 /kfouleggs/piece.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 'kfouleggs/piece.cpp')
-rw-r--r--kfouleggs/piece.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/kfouleggs/piece.cpp b/kfouleggs/piece.cpp
index 3c676f1c..bb5aad42 100644
--- a/kfouleggs/piece.cpp
+++ b/kfouleggs/piece.cpp
@@ -2,8 +2,8 @@
#include <math.h>
-#include <qpainter.h>
-#include <qbitmap.h>
+#include <tqpainter.h>
+#include <tqbitmap.h>
#include <klocale.h>
@@ -19,45 +19,45 @@ const char *FEPieceInfo::DEFAULT_COLORS[NB_NORM_BLOCK_TYPES + 1] = {
"#64C864", "#64C8C8", "#C86464", "#C864C8", "#C8C8C8"
};
-QColor FEPieceInfo::defaultColor(uint i) const
+TQColor FEPieceInfo::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 FEPieceInfo::colorLabel(uint i) const
+TQString FEPieceInfo::colorLabel(uint i) const
{
return (i==NB_NORM_BLOCK_TYPES ? i18n("Garbage color:")
: i18n("Color #%1:").arg(i+1));
}
-void FEPieceInfo::draw(QPixmap *pixmap, uint blockType, uint,
+void FEPieceInfo::draw(TQPixmap *pixmap, uint blockType, uint,
bool lighted) const
{
- QColor col = color(blockType);
+ TQColor col = color(blockType);
if (lighted) col = col.light();
pixmap->fill(col);
}
-void FEPieceInfo::setMask(QPixmap *pixmap, uint blockMode) const
+void FEPieceInfo::setMask(TQPixmap *pixmap, uint blockMode) const
{
Q_ASSERT( pixmap->width()==pixmap->height() ); // drawing code assumes that
- QBitmap bitmap(pixmap->size(), true);
- QPainter p(&bitmap);
+ TQBitmap bitmap(pixmap->size(), true);
+ TQPainter p(&bitmap);
p.setBrush(Qt::color1);
- p.setPen( QPen(Qt::NoPen) );
+ p.setPen( TQPen(Qt::NoPen) );
// base circle
int w = pixmap->width();
int d = (int)((sqrt(2)-2./3)*w);
- QRect cr = QRect(0, 0, d, d);
- cr.moveCenter(QPoint(w/2, w/2));
+ TQRect cr = TQRect(0, 0, d, d);
+ cr.moveCenter(TQPoint(w/2, w/2));
p.drawEllipse(cr);
if (blockMode) {
int a = (int)(w/(3.*sqrt(2)));
int ra = 2*w/3+1;
- cr = QRect(0, 0, ra, ra);
+ cr = TQRect(0, 0, ra, ra);
// first drawing with color1
if ( blockMode & BaseBoard::Up ) p.drawRect( 0, 0, w, a);
@@ -68,19 +68,19 @@ void FEPieceInfo::setMask(QPixmap *pixmap, uint blockMode) const
// second drawing with color0
p.setBrush(Qt::color0);
if ( (blockMode & BaseBoard::Up) || (blockMode & BaseBoard::Left) ) {
- cr.moveCenter(QPoint(0, 0));
+ cr.moveCenter(TQPoint(0, 0));
p.drawEllipse(cr);
}
if ( (blockMode & BaseBoard::Right) || (blockMode & BaseBoard::Up) ) {
- cr.moveCenter(QPoint(w-1, 0));
+ cr.moveCenter(TQPoint(w-1, 0));
p.drawEllipse(cr);
}
if ( (blockMode & BaseBoard::Down) || (blockMode & BaseBoard::Right) ){
- cr.moveCenter(QPoint(w-1, w-1));
+ cr.moveCenter(TQPoint(w-1, w-1));
p.drawEllipse(cr);
}
if ( (blockMode & BaseBoard::Left) || (blockMode & BaseBoard::Down) ) {
- cr.moveCenter(QPoint(0, w-1));
+ cr.moveCenter(TQPoint(0, w-1));
p.drawEllipse(cr);
}
}