diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
commit | 838baf3f99ec5ab81b063eb5449a3381d860f377 (patch) | |
tree | dd31abcfde08ca92e4623b8f50b3d762a87c997a /ksame/StoneWidget.cpp | |
parent | 2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff) | |
download | tdegames-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 'ksame/StoneWidget.cpp')
-rw-r--r-- | ksame/StoneWidget.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ksame/StoneWidget.cpp b/ksame/StoneWidget.cpp index 81fafca9..3109c33e 100644 --- a/ksame/StoneWidget.cpp +++ b/ksame/StoneWidget.cpp @@ -46,8 +46,8 @@ struct StoneSlice { }; -StoneWidget::StoneWidget( TQWidget *parent, int x, int y ) - : TQWidget(parent,"StoneWidget"), stonefield(x,y) +StoneWidget::StoneWidget( TQWidget *tqparent, int x, int y ) + : TQWidget(tqparent,"StoneWidget"), stonefield(x,y) { setBackgroundPixmap(TQPixmap(locate("wallpaper", "Time-For-Lunch-2.jpg"))); TQPixmap stonemap(locate("appdata", "stones.png")); @@ -65,20 +65,20 @@ StoneWidget::StoneWidget( TQWidget *parent, int x, int y ) stone_height=stonemap.height()/maxcolors; map = new StoneSlice*[maxcolors]; - TQBitmap mask; + TQBitmap tqmask; for (int c = 0; c < maxcolors; c++) { map[c] = new StoneSlice[maxslices]; for (int s = 0; s < maxslices; s++) { map[c][s].stone.resize(stone_width, stone_height); assert(!map[c][s].stone.isNull()); - bitBlt(&map[c][s].stone, 0, 0, - &stonemap, stone_width * s, + bitBlt(TQT_TQPAINTDEVICE(&map[c][s].stone), 0, 0, + TQT_TQPAINTDEVICE(&stonemap), stone_width * s, c*stone_height, stone_width,stone_height,CopyROP,false); TQImage im = map[c][s].stone.convertToImage(); - mask = im.createHeuristicMask(); - map[c][s].stone.setMask(mask); + tqmask.convertFromImage(im.createHeuristicMask()); + map[c][s].stone.setMask(tqmask); } } @@ -102,7 +102,7 @@ StoneWidget::~StoneWidget() { delete [] map; setMouseTracking(false); - killTimers(); + TQT_TQOBJECT(this)->killTimers(); } unsigned int @@ -125,7 +125,7 @@ StoneWidget::marked() { return stonefield.getMarked(); } -QSize +TQSize StoneWidget::size() { return TQSize(sizex,sizey); } @@ -135,8 +135,8 @@ StoneWidget::colors() { return stonefield.getColors(); } -QSize -StoneWidget::sizeHint () const { +TQSize +StoneWidget::tqsizeHint () const { return TQSize(field_width,field_height); } @@ -276,8 +276,8 @@ StoneWidget::paintEvent( TQPaintEvent *e ) { if (stone->color) { int tslice = stone->marked?slice:0; - bitBlt(this,cx,cy, - &map[stone->color-1][tslice].stone, + bitBlt(TQT_TQPAINTDEVICE(this),cx,cy, + TQT_TQPAINTDEVICE(&map[stone->color-1][tslice].stone), 0, 0, stone_width,stone_height,CopyROP,FALSE); |