diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
commit | 576eb4299a00bc053db35414406f46372a0f70f2 (patch) | |
tree | 4c030922d533821db464af566188e7d40cc8848c /kmahjongg/boardwidget.cpp | |
parent | 0718336b6017d1a4fc1d626544180a5a2a29ddec (diff) | |
download | tdegames-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 'kmahjongg/boardwidget.cpp')
-rw-r--r-- | kmahjongg/boardwidget.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/kmahjongg/boardwidget.cpp b/kmahjongg/boardwidget.cpp index 9c3355ea..c8a5cd61 100644 --- a/kmahjongg/boardwidget.cpp +++ b/kmahjongg/boardwidget.cpp @@ -3,25 +3,25 @@ #include <kmessagebox.h> #include <kapplication.h> -#include <qtimer.h> -#include <qpainter.h> +#include <tqtimer.h> +#include <tqpainter.h> #include <klocale.h> #include <kstandarddirs.h> -#include <qfile.h> +#include <tqfile.h> #include <kconfig.h> /** * Constructor. * Loads tileset and background bitmaps. */ -BoardWidget::BoardWidget( QWidget* parent, const char *name ) - : QWidget( parent, name ), theTiles(false) +BoardWidget::BoardWidget( TQWidget* parent, const char *name ) + : TQWidget( parent, name ), theTiles(false) { - setBackgroundColor( QColor( 0,0,0 ) ); + setBackgroundColor( TQColor( 0,0,0 ) ); - timer = new QTimer(this); - connect( timer, SIGNAL(timeout()), - this, SLOT(helpMoveTimeout()) ); + timer = new TQTimer(this); + connect( timer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(helpMoveTimeout()) ); TimerState = Stop; gamePaused = false; @@ -39,7 +39,7 @@ BoardWidget::BoardWidget( QWidget* parent, const char *name ) updateBackBuffer=true; // Load tileset. First try to load the last use tileset - QString tFile; + TQString tFile; getFileOrDefault(Prefs::tileSet(), "tileset", tFile); if (!loadTileset(tFile)){ @@ -95,13 +95,13 @@ void BoardWidget::saveSettings(){ //config->writePathEntry("Layout_file", layout); } -void BoardWidget::getFileOrDefault(QString filename, QString type, QString &res) +void BoardWidget::getFileOrDefault(TQString filename, TQString type, TQString &res) { - QString picsPos = "pics/"; + TQString picsPos = "pics/"; picsPos += "default."; picsPos += type; - if (QFile::exists(filename)) { + if (TQFile::exists(filename)) { res = filename; } else { @@ -156,7 +156,7 @@ void BoardWidget::calcShadow(int e, int y, int x, int &l, int &t, int &c) { // if a second shadow botton left to top right is rendered over it // then the shadow becomes a box (ie in the middle of the run) -void BoardWidget::shadowTopLeft(int depth, int sx, int sy, int rx, int ry, QPixmap *src, bool flag) { +void BoardWidget::shadowTopLeft(int depth, int sx, int sy, int rx, int ry, TQPixmap *src, bool flag) { if (depth) { int shadowPixels= (depth+1) * theTiles.shadowSize(); int xOffset=theTiles.qWidth()-shadowPixels; @@ -181,7 +181,7 @@ void BoardWidget::shadowTopLeft(int depth, int sx, int sy, int rx, int ry, QPixm } // Second triangular shadow generator see above -void BoardWidget::shadowBotRight(int depth, int sx, int sy, int rx, int ry, QPixmap *src, bool flag) { +void BoardWidget::shadowBotRight(int depth, int sx, int sy, int rx, int ry, TQPixmap *src, bool flag) { if (depth) { int shadowPixels= (depth+1) * theTiles.shadowSize(); int xOffset=theTiles.qWidth(); @@ -211,7 +211,7 @@ void BoardWidget::shadowBotRight(int depth, int sx, int sy, int rx, int ry, QPix -void BoardWidget::shadowArea(int z, int y, int x, int sx, int sy,int rx, int ry, QPixmap *src) +void BoardWidget::shadowArea(int z, int y, int x, int sx, int sy,int rx, int ry, TQPixmap *src) { // quick check to see if we are obscured if (z < BoardLayout::depth-1) { @@ -246,9 +246,9 @@ void BoardWidget::shadowArea(int z, int y, int x, int sx, int sy,int rx, int ry, } // --------------------------------------------------------- -void BoardWidget::paintEvent( QPaintEvent* pa ) +void BoardWidget::paintEvent( TQPaintEvent* pa ) { - QPixmap *back; + TQPixmap *back; int xx = pa->rect().left(); int xheight = pa->rect().height(); @@ -317,8 +317,8 @@ void BoardWidget::paintEvent( QPaintEvent* pa ) if (!Game.tilePresent(z,y,x)) continue; - QPixmap *t; - QPixmap *s; + TQPixmap *t; + TQPixmap *s; if (Game.hilighted[z][y][x]) { t= theTiles.selectedPixmaps( Game.Board[z][y][x]-TILE_OFFSET); @@ -438,8 +438,8 @@ void BoardWidget::stackTiles(unsigned char t, unsigned short h, unsigned short x { int ss = theTiles.shadowSize(); - QPainter p(&backBuffer); - QPen line; + TQPainter p(&backBuffer); + TQPen line; p.setBackgroundMode(OpaqueMode); p.setBackgroundColor(black); @@ -456,10 +456,10 @@ void BoardWidget::stackTiles(unsigned char t, unsigned short h, unsigned short x p.drawLine(x2, y+ss, x2, y2); p.drawLine(x+1, y2, x2, y2); - // p.fillRect(x+1, y+ss+1, theTiles.width()-ss-2, theTiles.height()-ss-2, QBrush(lightGray)); + // p.fillRect(x+1, y+ss+1, theTiles.width()-ss-2, theTiles.height()-ss-2, TQBrush(lightGray)); for (unsigned short pos=0; pos < h; pos++) { - QPixmap *p = theTiles.unselectedPixmaps(t-TILE_OFFSET); + TQPixmap *p = theTiles.unselectedPixmaps(t-TILE_OFFSET); bitBlt( &backBuffer, x+(pos*ss), y-(pos*ss), p, 0,0, p->width(), p->height(), CopyROP ); } @@ -633,7 +633,7 @@ void BoardWidget::demoMoveTimeout() break; } // restart timer - QTimer::singleShot( ANIMSPEED, this, SLOT( demoMoveTimeout() ) ); + TQTimer::singleShot( ANIMSPEED, this, TQT_SLOT( demoMoveTimeout() ) ); } } @@ -667,7 +667,7 @@ void BoardWidget::matchAnimationTimeout() } } if( TimerState == Match ) - QTimer::singleShot( ANIMSPEED, this, SLOT( matchAnimationTimeout() ) ); + TQTimer::singleShot( ANIMSPEED, this, TQT_SLOT( matchAnimationTimeout() ) ); } // --------------------------------------------------------- void BoardWidget::stopMatchAnimation() @@ -1618,7 +1618,7 @@ void BoardWidget::removeTile( POSITION& Pos , bool doRepaint) } // --------------------------------------------------------- -void BoardWidget::mousePressEvent ( QMouseEvent* event ) +void BoardWidget::mousePressEvent ( TQMouseEvent* event ) { if (gamePaused) return; @@ -1708,7 +1708,7 @@ void BoardWidget::mousePressEvent ( QMouseEvent* event ) @param MouseClickPos Output: Position in game board */ void BoardWidget::transformPointToPosition( - const QPoint& point, + const TQPoint& point, POSITION& MouseClickPos ) { @@ -1788,7 +1788,7 @@ bool BoardWidget::loadBoard( ) } // --------------------------------------------------------- -void BoardWidget::setStatusText( const QString & pszText ) +void BoardWidget::setStatusText( const TQString & pszText ) { emit statusTextChanged( pszText, gameGenerationNum ); } @@ -1797,7 +1797,7 @@ void BoardWidget::setStatusText( const QString & pszText ) // --------------------------------------------------------- bool BoardWidget::loadBackground( - const QString& pszFileName, + const TQString& pszFileName, bool bShowError ) { @@ -1919,7 +1919,7 @@ void BoardWidget::initialiseRemovedTiles() { } // --------------------------------------------------------- -bool BoardWidget::loadTileset(const QString &path) { +bool BoardWidget::loadTileset(const TQString &path) { if (theTiles.loadTileset(path)) { Prefs::setTileSet(path); @@ -1931,7 +1931,7 @@ bool BoardWidget::loadTileset(const QString &path) { } -bool BoardWidget::loadBoardLayout(const QString &file) { +bool BoardWidget::loadBoardLayout(const TQString &file) { if (theBoardLayout.loadBoardLayout(file)) { Prefs::setLayout(file); Prefs::writeConfig(); |