From 838baf3f99ec5ab81b063eb5449a3381d860f377 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 11 Jun 2011 04:58:26 +0000 Subject: 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 --- ksnake/appearance.ui | 16 ++++++++-------- ksnake/ball.cpp | 2 +- ksnake/ball.h | 2 +- ksnake/basket.cpp | 2 +- ksnake/basket.h | 8 +++++--- ksnake/board.cpp | 8 ++++---- ksnake/board.h | 2 +- ksnake/game.cpp | 20 ++++++++++---------- ksnake/game.h | 3 ++- ksnake/general.ui | 38 +++++++++++++++++++------------------- ksnake/level.cpp | 2 +- ksnake/pixServer.cpp | 12 ++++++------ ksnake/progress.cpp | 4 ++-- ksnake/progress.h | 3 ++- ksnake/rattler.cpp | 36 ++++++++++++++++++------------------ ksnake/rattler.h | 5 +++-- ksnake/snake.cpp | 2 +- ksnake/snake.h | 5 +++-- ksnake/startroom.cpp | 14 +++++++------- ksnake/startroom.h | 5 +++-- ksnake/view.cpp | 6 +++--- ksnake/view.h | 7 ++++--- 22 files changed, 105 insertions(+), 97 deletions(-) (limited to 'ksnake') diff --git a/ksnake/appearance.ui b/ksnake/appearance.ui index 0f328f04..cfa4578f 100644 --- a/ksnake/appearance.ui +++ b/ksnake/appearance.ui @@ -1,10 +1,10 @@ Appearance - + Appearance - + 0 0 @@ -16,7 +16,7 @@ unnamed - + buttonGroup1 @@ -27,7 +27,7 @@ unnamed - + kcfg_bgimage @@ -40,7 +40,7 @@ - + kcfg_bgcolor_enabled @@ -51,7 +51,7 @@ true - + kcfg_bgimage_enabled @@ -71,7 +71,7 @@ Expanding - + 21 40 @@ -80,7 +80,7 @@ - + kcolorbutton.h diff --git a/ksnake/ball.cpp b/ksnake/ball.cpp index 2881beb9..dc86d7a0 100644 --- a/ksnake/ball.cpp +++ b/ksnake/ball.cpp @@ -73,7 +73,7 @@ void Ball::nextMove() } } -void Ball::repaint() +void Ball::tqrepaint() { static int i = 0; static bool rotate = true; diff --git a/ksnake/ball.h b/ksnake/ball.h index e7796354..609eef95 100644 --- a/ksnake/ball.h +++ b/ksnake/ball.h @@ -33,7 +33,7 @@ public: Ball(Board *b, PixServer *p); virtual ~Ball(){} virtual void nextMove(); - void repaint(); + void tqrepaint(); void zero(); protected: Board *board; diff --git a/ksnake/basket.cpp b/ksnake/basket.cpp index 138336cd..8d124a45 100644 --- a/ksnake/basket.cpp +++ b/ksnake/basket.cpp @@ -81,7 +81,7 @@ void Basket::newApples() } } -void Basket::repaint(bool dirty ) +void Basket::tqrepaint(bool dirty ) { Kaffee *g; for ( g = list->first(); g != 0; g = list->next()) { diff --git a/ksnake/basket.h b/ksnake/basket.h index 56bc8020..18386acc 100644 --- a/ksnake/basket.h +++ b/ksnake/basket.h @@ -32,9 +32,10 @@ class PixServer; enum Fruits { Red, Golden }; -class Kaffee : public QObject +class Kaffee : public TQObject { Q_OBJECT + TQ_OBJECT public: Kaffee(int pos, int r1, int r2); int position() { return p;} @@ -48,13 +49,14 @@ private: Fruits t; }; -class Basket : public QObject +class Basket : public TQObject { Q_OBJECT + TQ_OBJECT public: Basket(Board *b, PixServer *p); ~Basket(); - void repaint(bool); + void tqrepaint(bool); void newApples(); void clear(); Fruits eaten( int i); diff --git a/ksnake/board.cpp b/ksnake/board.cpp index 0959dee1..e9e44cd0 100644 --- a/ksnake/board.cpp +++ b/ksnake/board.cpp @@ -48,7 +48,7 @@ int Pos::price() const { void Pos::setParent(Pos *p) { _parent = p; } -Pos *Pos::parent() const { +Pos *Pos::tqparent() const { return(_parent); } Pos *Pos::listNext() { @@ -241,7 +241,7 @@ int Board::getNextCloseTo(int s, int d, bool diag, int lastIndex) if(list->index() == d) { // Find first movement after root. for(; ; list = p) { - p = list->parent(); + p = list->tqparent(); if(p == root) { // This is our move. int nextSq = list->index(); @@ -265,7 +265,7 @@ int Board::getNextCloseTo(int s, int d, bool diag, int lastIndex) continue; } - int pi = list->parent() ? list->parent()->index() : lastIndex; + int pi = list->tqparent() ? list->tqparent()->index() : lastIndex; if(pi != -1 && direction(pi, list->index()) != direction(list->index(), i)) { pri += 10; @@ -277,7 +277,7 @@ int Board::getNextCloseTo(int s, int d, bool diag, int lastIndex) // Check price of found position with current one. if(p->price() > pri) { // We found a cheapear way to reach the same - // place, so let's change the parent and price of p. + // place, so let's change the tqparent and price of p. p->setPrice(list->price() + 1); p->setParent(list); list->addList(p); diff --git a/ksnake/board.h b/ksnake/board.h index 0eece38d..c7514d75 100644 --- a/ksnake/board.h +++ b/ksnake/board.h @@ -47,7 +47,7 @@ public: void setPrice(int p); int price() const; void setParent(Pos *p); - Pos *parent() const; + Pos *tqparent() const; Pos *listNext(); void addBTree(Pos *np); Pos *searchBTree(int i); diff --git a/ksnake/game.cpp b/ksnake/game.cpp index 4817b3af..9a9e978f 100644 --- a/ksnake/game.cpp +++ b/ksnake/game.cpp @@ -54,7 +54,7 @@ #define SCORE 1 #define LIVES 2 -Game::Game(TQWidget *parent, const char *name) : KMainWindow(parent,name) +Game::Game(TQWidget *tqparent, const char *name) : KMainWindow(tqparent,name) { // create statusbar statusBar()->insertItem(i18n("Score: 0"), SCORE); @@ -88,17 +88,17 @@ Game::~Game() } void Game::scoreChanged(int score){ - statusBar()->changeItem(i18n("Score: %1").arg(score), SCORE); + statusBar()->changeItem(i18n("Score: %1").tqarg(score), SCORE); } void Game::setTrys(int tries){ - statusBar()->changeItem(i18n("Lives: %1").arg(tries), LIVES); + statusBar()->changeItem(i18n("Lives: %1").tqarg(tries), LIVES); } void Game::gameEnd(int score){ KScoreDialog di(KScoreDialog::Name | KScoreDialog::Score | KScoreDialog::Date, this); KScoreDialog::FieldInfo scoreInfo; - TQString date = TQDateTime::currentDateTime().toString(); + TQString date = TQDateTime::tqcurrentDateTime().toString(); scoreInfo.insert(KScoreDialog::Date, date); if (di.addScore(score, scoreInfo, true)) di.exec(); @@ -120,12 +120,12 @@ void Game::createMenu() actionCollection()->setAutoConnectShortcuts(true); rattler->setActionCollection(actionCollection()); - KStdGameAction::gameNew(rattler, TQT_SLOT(restart()), actionCollection()); - pause = KStdGameAction::pause(rattler, TQT_SLOT(pause()), actionCollection()); - KStdGameAction::highscores(this, TQT_SLOT(showHighScores()), actionCollection()); - KStdGameAction::quit( this, TQT_SLOT(close()), actionCollection()); + KStdGameAction::gameNew(TQT_TQOBJECT(rattler), TQT_SLOT(restart()), actionCollection()); + pause = KStdGameAction::pause(TQT_TQOBJECT(rattler), TQT_SLOT(pause()), actionCollection()); + KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighScores()), actionCollection()); + KStdGameAction::quit( TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); - KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(showSettings()), actionCollection()); // TODO change and make custom function that pauses game or // modify widget to pause when loosing focus and remove this @@ -163,7 +163,7 @@ void Game::showSettings(){ // since the filename may contain underscore, they // are replaced with spaces in the menu entry TQString s = TQFileInfo( *it ).baseName(); - s = s.replace(TQRegExp("_"), " "); + s = s.tqreplace(TQRegExp("_"), " "); list.append(s); } } diff --git a/ksnake/game.h b/ksnake/game.h index 0c9eb66b..509856e7 100644 --- a/ksnake/game.h +++ b/ksnake/game.h @@ -36,9 +36,10 @@ class View; class Game : public KMainWindow { Q_OBJECT + TQ_OBJECT public: - Game(TQWidget *parent=0, const char *name=0); + Game(TQWidget *tqparent=0, const char *name=0); ~Game(); private slots: diff --git a/ksnake/general.ui b/ksnake/general.ui index de9ef8cb..1a9f7650 100644 --- a/ksnake/general.ui +++ b/ksnake/general.ui @@ -1,10 +1,10 @@ General - + General - + 0 0 @@ -16,7 +16,7 @@ unnamed - + groupBox4 @@ -27,7 +27,7 @@ unnamed - + kcfg_Skill @@ -44,7 +44,7 @@ Below - + textLabel10 @@ -52,20 +52,20 @@ Slow - + textLabel12 Fast - + AlignVCenter|AlignRight - + groupBox6 @@ -76,7 +76,7 @@ unnamed - + textLabel7 @@ -84,7 +84,7 @@ Snake behavior: - + Random @@ -104,7 +104,7 @@ kcfg_SnakesAI - + kcfg_ComputerSnakes @@ -112,7 +112,7 @@ 1 - + textLabel8 @@ -122,7 +122,7 @@ - + groupBox5 @@ -133,7 +133,7 @@ unnamed - + textLabel9 @@ -141,7 +141,7 @@ Number of balls: - + kcfg_Balls @@ -149,7 +149,7 @@ 1 - + Dumb @@ -169,7 +169,7 @@ kcfg_BallsAI - + textLabel13 @@ -189,7 +189,7 @@ Expanding - + 20 70 @@ -198,5 +198,5 @@ - + diff --git a/ksnake/level.cpp b/ksnake/level.cpp index 0ea100f0..5ece0a1f 100644 --- a/ksnake/level.cpp +++ b/ksnake/level.cpp @@ -85,7 +85,7 @@ void Level::initBoard(const TQImage &image) uchar *b; for ( int y = 0;y < image.height();y++ ) { - b = image.scanLine(y); + b = const_cast(image).scanLine(y); for ( int x = 0;x < image.width();x++ ) { if ( image.bitOrder() == TQImage::BigEndian ) { diff --git a/ksnake/pixServer.cpp b/ksnake/pixServer.cpp index ac25f9be..c27e554f 100644 --- a/ksnake/pixServer.cpp +++ b/ksnake/pixServer.cpp @@ -100,7 +100,7 @@ void PixServer::initPixmaps() pm.convertFromImage(qi,TQPixmap::AvoidDither); for (int x = 0 ; x < 18; x++){ compuSnakePix[x].resize(BRICKSIZE, BRICKSIZE); - bitBlt(&compuSnakePix[x] ,0,0, &pm,x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, Qt::CopyROP, true); + bitBlt(TQT_TQPAINTDEVICE(&compuSnakePix[x]) ,0,0, TQT_TQPAINTDEVICE(&pm),x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, TQt::CopyROP, true); compuSnakePix[x].setMask(compuSnakePix[x].createHeuristicMask()); } @@ -110,7 +110,7 @@ void PixServer::initPixmaps() pm.convertFromImage(qi,TQPixmap::AvoidDither); for (int x = 0 ; x < 18; x++){ samyPix[x].resize(BRICKSIZE, BRICKSIZE); - bitBlt(&samyPix[x] ,0,0, &pm,x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, Qt::CopyROP, true); + bitBlt(TQT_TQPAINTDEVICE(&samyPix[x]) ,0,0, TQT_TQPAINTDEVICE(&pm),x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, TQt::CopyROP, true); samyPix[x].setMask(samyPix[x].createHeuristicMask()); } @@ -120,7 +120,7 @@ void PixServer::initPixmaps() pm.convertFromImage(qi,TQPixmap::AvoidDither); for (int x = 0 ; x < 4; x++){ ballPix[x].resize(BRICKSIZE, BRICKSIZE); - bitBlt(&ballPix[x] ,0,0, &pm,x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, Qt::CopyROP, true); + bitBlt(TQT_TQPAINTDEVICE(&ballPix[x]) ,0,0, TQT_TQPAINTDEVICE(&pm),x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, TQt::CopyROP, true); ballPix[x].setMask(ballPix[x].createHeuristicMask()); } @@ -130,7 +130,7 @@ void PixServer::initPixmaps() pm.convertFromImage(qi,TQPixmap::AvoidDither); for (int x = 0 ; x < 2; x++){ applePix[x].resize(BRICKSIZE, BRICKSIZE); - bitBlt(&applePix[x] ,0,0, &pm,x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, Qt::CopyROP, true); + bitBlt(TQT_TQPAINTDEVICE(&applePix[x]) ,0,0, TQT_TQPAINTDEVICE(&pm),x*BRICKSIZE, 0, BRICKSIZE, BRICKSIZE, TQt::CopyROP, true); applePix[x].setMask(applePix[x].createHeuristicMask()); } } @@ -181,7 +181,7 @@ void PixServer::initBrickPixmap() { TQPixmap pm = TQPixmap(locate("appdata", "pics/brick.png")); if (pm.isNull()) { - kdFatal() << i18n("error loading %1, aborting\n").arg("brick.png"); + kdFatal() << i18n("error loading %1, aborting\n").tqarg("brick.png"); } int pw = pm.width(); int ph = pm.height(); @@ -216,7 +216,7 @@ void PixServer::drawBrick(TQPainter *p ,int i) TQColor light(180,180,180); TQColor dark(100,100,100); - int topSq = board->getNext(N, i); //find 'address' of neighbouring squares + int topSq = board->getNext(N, i); //tqfind 'address' of neighbouring squares int botSq = board->getNext(S, i); int rightSq = board->getNext(E ,i); int leftSq = board->getNext(W, i); diff --git a/ksnake/progress.cpp b/ksnake/progress.cpp index c5024a0f..1e2c0f72 100644 --- a/ksnake/progress.cpp +++ b/ksnake/progress.cpp @@ -25,8 +25,8 @@ #include "progress.h" -Progress::Progress(TQWidget *parent, const char *name) - : KGameProgress(0, 300, 300, KGameProgress::Horizontal, parent, name) +Progress::Progress(TQWidget *tqparent, const char *name) + : KGameProgress(0, 300, 300, Qt::Horizontal, tqparent, name) { setBarColor("green1"); setTextEnabled(false); diff --git a/ksnake/progress.h b/ksnake/progress.h index 311a2bcf..ae78aa47 100644 --- a/ksnake/progress.h +++ b/ksnake/progress.h @@ -31,8 +31,9 @@ class Progress : public KGameProgress { Q_OBJECT + TQ_OBJECT public: - Progress( TQWidget *parent=0, const char *name=0 ); + Progress( TQWidget *tqparent=0, const char *name=0 ); public slots: void advance(); diff --git a/ksnake/rattler.cpp b/ksnake/rattler.cpp index 1085d6f8..8fc0999f 100644 --- a/ksnake/rattler.cpp +++ b/ksnake/rattler.cpp @@ -43,10 +43,10 @@ TQBitArray gameState(5); TQLabel *label = 0; int speed[4] = { 130, 95, 55, 40 }; -Rattler::Rattler( TQWidget *parent, const char *name ) - : TQWidget( parent, name ) +Rattler::Rattler( TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ) { - setFocusPolicy(TQWidget::StrongFocus); + setFocusPolicy(TQ_StrongFocus); numBalls = Settings::balls(); ballsAI = Settings::ballsAI(); @@ -114,7 +114,7 @@ void Rattler::paintEvent( TQPaintEvent *e) return; TQPixmap levelPix = pix->levelPix(); - basket->repaint(true); + basket->tqrepaint(true); bitBlt(this, rect.x(), rect.y(), &levelPix, rect.x(), rect.y(), rect.width(), rect.height()); @@ -130,14 +130,14 @@ void Rattler::timerEvent( TQTimerEvent * ) for (CompuSnake *c = computerSnakes->first(); c != 0; c = computerSnakes->next()){ if(c) { c->nextMove(); - c->repaint(false); + c->tqrepaint(false); } } for (Ball *b = balls->first(); b != 0; b = balls->next()){ if (b) { b->nextMove(); - b->repaint(); + b->tqrepaint(); } } @@ -147,10 +147,10 @@ void Rattler::timerEvent( TQTimerEvent * ) if(!gameState.testBit(Demo)) { state = samy->nextMove(direction); - samy->repaint( false ); + samy->tqrepaint( false ); } - basket->repaint( false); + basket->tqrepaint( false); if (state == ko) newTry(); @@ -313,8 +313,8 @@ void Rattler::pause() label = new TQLabel(this); label->setFont( TQFont( "Times", 14, TQFont::Bold ) ); label->setText(i18n("Game Paused\n Press %1 to resume\n") - .arg(tempPauseAction->shortcutText())); - label->setAlignment( AlignCenter ); + .tqarg(tempPauseAction->shortcutText())); + label->tqsetAlignment( AlignCenter ); label->setFrameStyle( TQFrame::Panel | TQFrame::Raised ); label->setGeometry(182, 206, 198, 80); label->show(); @@ -351,7 +351,7 @@ void Rattler::restartDemo() level->create(Intro); pix->initRoomPixmap(); init(false); - repaint(); + tqrepaint(); start(); } @@ -374,7 +374,7 @@ void Rattler::demo() level->create(Intro); pix->initRoomPixmap(); } - repaint(rect(), false); + tqrepaint(rect(), false); init(false); run(); first_time = false; @@ -413,7 +413,7 @@ void Rattler::restart() cleanLabel(); - repaint(); + tqrepaint(); TQTimer::singleShot( 2000, this, TQT_SLOT(showRoom()) ); } @@ -426,7 +426,7 @@ void Rattler::newTry() gameState.setBit(Over); level->create(GameOver); pix->initRoomPixmap(); - repaint(); + tqrepaint(); TQTimer::singleShot( 5000, this, TQT_SLOT(demo()) ); emit setScore(points); return; @@ -439,7 +439,7 @@ void Rattler::newTry() level->create(Room); pix->initRoomPixmap(); init(true); - repaint(); + tqrepaint(); TQTimer::singleShot( 1000, this, TQT_SLOT(run()) ); } @@ -456,7 +456,7 @@ void Rattler::levelUp() level->nextLevel(); level->create(Banner); pix->initRoomPixmap(); - repaint(); + tqrepaint(); TQTimer::singleShot( 2000, this, TQT_SLOT(showRoom()) ); } @@ -493,7 +493,7 @@ void Rattler::showRoom() level->create(Room); pix->initRoomPixmap(); init(true); - repaint(); + tqrepaint(); TQTimer::singleShot( 1000, this, TQT_SLOT(run()) ); } @@ -534,7 +534,7 @@ void Rattler::start(int t) void Rattler::stop() { - killTimers(); + TQT_TQOBJECT(this)->killTimers(); } void Rattler::restartComputerSnakes(bool play) diff --git a/ksnake/rattler.h b/ksnake/rattler.h index da0c13bd..4c9b72ee 100644 --- a/ksnake/rattler.h +++ b/ksnake/rattler.h @@ -40,12 +40,13 @@ class SamySnake; enum { Init, Playing, Demo, Paused, Over }; -class Rattler : public QWidget +class Rattler : public TQWidget { Q_OBJECT + TQ_OBJECT public: - Rattler ( TQWidget *parent=0, const char *name=0 ); + Rattler ( TQWidget *tqparent=0, const char *name=0 ); ~Rattler(); void setActionCollection(KActionCollection *a){ actionCollection = a;} diff --git a/ksnake/snake.cpp b/ksnake/snake.cpp index c892452b..2d6337ac 100644 --- a/ksnake/snake.cpp +++ b/ksnake/snake.cpp @@ -143,7 +143,7 @@ void Snake::reset(int index, int border) } } -void Snake::repaint( bool dirty) +void Snake::tqrepaint( bool dirty) { int x = 0; for ( Samy *sam = list.first(); sam != 0; sam = list.next(), x++) { diff --git a/ksnake/snake.h b/ksnake/snake.h index 6ea2dac2..206ea126 100644 --- a/ksnake/snake.h +++ b/ksnake/snake.h @@ -30,10 +30,11 @@ #include "pixServer.h" #include "board.h" -class Snake : public QObject +class Snake : public TQObject { Q_OBJECT + TQ_OBJECT signals: void score(bool, int); @@ -45,7 +46,7 @@ signals: public: Snake(Board *b, PixServer *p, Gate g, PixMap x); ~Snake() {} - void repaint( bool ); + void tqrepaint( bool ); void zero(); protected: diff --git a/ksnake/startroom.cpp b/ksnake/startroom.cpp index 24874ee9..a50536e0 100644 --- a/ksnake/startroom.cpp +++ b/ksnake/startroom.cpp @@ -33,23 +33,23 @@ #include "levels.h" -StartRoom::StartRoom( TQWidget *parent, const char *name) - : TQWidget( parent, name ) +StartRoom::StartRoom( TQWidget *tqparent, const char *name) + : TQWidget( tqparent, name ) { TQGridLayout *Form1Layout = new TQGridLayout( this, 1, 1, 11, 6, "Form1Layout"); TQSpacerItem* spacer = new TQSpacerItem( 20, 61, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); Form1Layout->addItem( spacer, 2, 1 ); - TQHBoxLayout *layout1 = new TQHBoxLayout( 0, 0, 6, "layout1"); + TQHBoxLayout *tqlayout1 = new TQHBoxLayout( 0, 0, 6, "tqlayout1"); TQSpacerItem* spacer_2 = new TQSpacerItem( 91, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); - layout1->addItem( spacer_2 ); + tqlayout1->addItem( spacer_2 ); picture = new TQLabel( this, "picture" ); - layout1->addWidget( picture ); + tqlayout1->addWidget( picture ); TQSpacerItem* spacer_3 = new TQSpacerItem( 41, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); - layout1->addItem( spacer_3 ); + tqlayout1->addItem( spacer_3 ); - Form1Layout->addMultiCellLayout( layout1, 0, 0, 0, 1 ); + Form1Layout->addMultiCellLayout( tqlayout1, 0, 0, 0, 1 ); roomRange = new TQSpinBox( this, "kcfg_StartingRoom" ); roomRange->setMaxValue( 25 ); diff --git a/ksnake/startroom.h b/ksnake/startroom.h index 3750b6c4..222bd50f 100644 --- a/ksnake/startroom.h +++ b/ksnake/startroom.h @@ -31,11 +31,12 @@ class TQLabel; class TQSpinBox; -class StartRoom : public QWidget +class StartRoom : public TQWidget { Q_OBJECT + TQ_OBJECT public: - StartRoom( TQWidget *parent=0, const char *name=0 ); + StartRoom( TQWidget *tqparent=0, const char *name=0 ); private slots: void loadLevel(int level); diff --git a/ksnake/view.cpp b/ksnake/view.cpp index a8503700..dec662ea 100644 --- a/ksnake/view.cpp +++ b/ksnake/view.cpp @@ -32,8 +32,8 @@ int MAPWIDTH = BRICKSIZE * 35; int MAPHEIGHT = MAPWIDTH; #define BAR_HEIGHT 12 -View::View( TQWidget *parent, const char *name ) - : TQWidget( parent, name ) +View::View( TQWidget *tqparent, const char *name ) + : TQWidget( tqparent, name ) { progress = new Progress(this); rattler = new Rattler( this); @@ -51,7 +51,7 @@ void View::resizeEvent( TQResizeEvent * ) rattler->setGeometry(0, BAR_HEIGHT, width(), height()-BAR_HEIGHT); } -TQSize View::sizeHint() const +TQSize View::tqsizeHint() const { return TQSize(490,502); } diff --git a/ksnake/view.h b/ksnake/view.h index 68fd2412..2ab132d7 100644 --- a/ksnake/view.h +++ b/ksnake/view.h @@ -30,18 +30,19 @@ class Progress; class Rattler; -class View : public QWidget +class View : public TQWidget { Q_OBJECT + TQ_OBJECT public: - View ( TQWidget *parent=0, const char *name=0 ); + View ( TQWidget *tqparent=0, const char *name=0 ); Progress *progress; Rattler *rattler; protected: void resizeEvent( TQResizeEvent * ); - virtual TQSize sizeHint() const; + virtual TQSize tqsizeHint() const; }; #endif // VIEW_H -- cgit v1.2.1