summaryrefslogtreecommitdiffstats
path: root/ksame/StoneWidget.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 /ksame/StoneWidget.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 'ksame/StoneWidget.cpp')
-rw-r--r--ksame/StoneWidget.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/ksame/StoneWidget.cpp b/ksame/StoneWidget.cpp
index 3d4114de..81fafca9 100644
--- a/ksame/StoneWidget.cpp
+++ b/ksame/StoneWidget.cpp
@@ -22,11 +22,11 @@
#include <stdio.h>
#include <stdlib.h>
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qbitmap.h>
-#include <qimage.h>
-#include <qcursor.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
+#include <tqbitmap.h>
+#include <tqimage.h>
+#include <tqcursor.h>
#include <kapplication.h>
#include <kconfig.h>
@@ -42,15 +42,15 @@
struct StoneSlice {
- QPixmap stone;
+ TQPixmap stone;
};
-StoneWidget::StoneWidget( QWidget *parent, int x, int y )
- : QWidget(parent,"StoneWidget"), stonefield(x,y)
+StoneWidget::StoneWidget( TQWidget *parent, int x, int y )
+ : TQWidget(parent,"StoneWidget"), stonefield(x,y)
{
- setBackgroundPixmap(QPixmap(locate("wallpaper", "Time-For-Lunch-2.jpg")));
- QPixmap stonemap(locate("appdata", "stones.png"));
+ setBackgroundPixmap(TQPixmap(locate("wallpaper", "Time-For-Lunch-2.jpg")));
+ TQPixmap stonemap(locate("appdata", "stones.png"));
assert(!stonemap.isNull());
@@ -65,7 +65,7 @@ StoneWidget::StoneWidget( QWidget *parent, int x, int y )
stone_height=stonemap.height()/maxcolors;
map = new StoneSlice*[maxcolors];
- QBitmap mask;
+ TQBitmap mask;
for (int c = 0; c < maxcolors; c++) {
map[c] = new StoneSlice[maxslices];
@@ -76,7 +76,7 @@ StoneWidget::StoneWidget( QWidget *parent, int x, int y )
&stonemap, stone_width * s,
c*stone_height,
stone_width,stone_height,CopyROP,false);
- QImage im = map[c][s].stone.convertToImage();
+ TQImage im = map[c][s].stone.convertToImage();
mask = im.createHeuristicMask();
map[c][s].stone.setMask(mask);
}
@@ -87,7 +87,7 @@ StoneWidget::StoneWidget( QWidget *parent, int x, int y )
setMouseTracking(true);
- // QColor c(115,115,115);
+ // TQColor c(115,115,115);
// setBackgroundColor(c);
// emit s_sizechanged();
@@ -127,7 +127,7 @@ StoneWidget::marked() {
QSize
StoneWidget::size() {
- return QSize(sizex,sizey);
+ return TQSize(sizex,sizey);
}
int
@@ -137,7 +137,7 @@ StoneWidget::colors() {
QSize
StoneWidget::sizeHint () const {
- return QSize(field_width,field_height);
+ return TQSize(field_width,field_height);
}
void
@@ -174,7 +174,7 @@ StoneWidget::undo(int count) {
int ret_val=stonefield.undo(count);
- QPoint p=mapFromGlobal(cursor().pos());
+ TQPoint p=mapFromGlobal(cursor().pos());
int x=p.x();
int y=p.y();
if (x<0||y<0||x>=field_width||y>=field_height) {
@@ -214,13 +214,13 @@ void StoneWidget::readProperties(KConfig *conf) {
}
newGame(conf->readNumEntry("Board"),conf->readNumEntry("Colors"));
- QStrList list;
+ TQStrList list;
conf->readListEntry("Stones",list);
for (const char *item=list.first();item;item=list.next()) {
int x=-1,y=-1;
if (sscanf(item,"%02X%02X",&x,&y)!=2) break;
- history.append(new QPoint(x,y));
+ history.append(new TQPoint(x,y));
stonefield.remove(x,y);
}
}
@@ -230,10 +230,10 @@ void
StoneWidget::saveProperties(KConfig *conf) {
Q_ASSERT(conf);
- QStrList list(true);
- QString tmp;
+ TQStrList list(true);
+ TQString tmp;
- for (QPoint *item=history.first();item;item=history.next()) {
+ for (TQPoint *item=history.first();item;item=history.next()) {
tmp.sprintf("%02X%02X",item->x(),item->y());
list.append(tmp.ascii());
}
@@ -244,8 +244,8 @@ StoneWidget::saveProperties(KConfig *conf) {
}
void
-StoneWidget::timerEvent( QTimerEvent * ) {
- QPoint p=mapFromGlobal(cursor().pos());
+StoneWidget::timerEvent( TQTimerEvent * ) {
+ TQPoint p=mapFromGlobal(cursor().pos());
int x=p.x();
int y=p.y();
if (x<0||y<0||x>=field_width||y>=field_height)
@@ -255,7 +255,7 @@ StoneWidget::timerEvent( QTimerEvent * ) {
}
void
-StoneWidget::paintEvent( QPaintEvent *e ) {
+StoneWidget::paintEvent( TQPaintEvent *e ) {
Stone *stone=stonefield.getField();
@@ -268,7 +268,7 @@ StoneWidget::paintEvent( QPaintEvent *e ) {
bool redraw=stone->marked||stone->changed;
if (!redraw&&e) {
- QRect r(cx,cy,stone_width,stone_height);
+ TQRect r(cx,cy,stone_width,stone_height);
redraw=r.intersects(e->rect());
}
if (redraw) {
@@ -291,7 +291,7 @@ StoneWidget::paintEvent( QPaintEvent *e ) {
}
void
-StoneWidget::mousePressEvent ( QMouseEvent *e) {
+StoneWidget::mousePressEvent ( TQMouseEvent *e) {
if (stonefield.isGameover()) return;
@@ -303,7 +303,7 @@ StoneWidget::mousePressEvent ( QMouseEvent *e) {
int sy=y/stone_height;
if (stonefield.remove(sx, sy)) {
- history.append(new QPoint(sx, sy));
+ history.append(new TQPoint(sx, sy));
emit s_remove(sx, sy);
@@ -317,7 +317,7 @@ StoneWidget::mousePressEvent ( QMouseEvent *e) {
}
void
-StoneWidget::mouseMoveEvent ( QMouseEvent *e)
+StoneWidget::mouseMoveEvent ( TQMouseEvent *e)
{
if (stonefield.isGameover()) {
stonefield.unmark();