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 /kshisen | |
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 'kshisen')
-rw-r--r-- | kshisen/app.cpp | 154 | ||||
-rw-r--r-- | kshisen/app.h | 10 | ||||
-rw-r--r-- | kshisen/board.cpp | 52 | ||||
-rw-r--r-- | kshisen/board.h | 18 | ||||
-rw-r--r-- | kshisen/tileset.cpp | 14 | ||||
-rw-r--r-- | kshisen/tileset.h | 10 |
6 files changed, 129 insertions, 129 deletions
diff --git a/kshisen/app.cpp b/kshisen/app.cpp index 27f8cbf2..ab6e3b85 100644 --- a/kshisen/app.cpp +++ b/kshisen/app.cpp @@ -52,9 +52,9 @@ #include <kstdguiitem.h> #include <kconfigdialog.h> -#include <qlayout.h> -#include <qtimer.h> -#include <qlineedit.h> +#include <tqlayout.h> +#include <tqtimer.h> +#include <tqlineedit.h> #include <cmath> @@ -62,7 +62,7 @@ #include "prefs.h" #include "settings.h" -App::App(QWidget *parent, const char *name) : KMainWindow(parent, name), +App::App(TQWidget *parent, const char *name) : KMainWindow(parent, name), cheat(false) { highscoreTable = new KHighscore(this); @@ -89,13 +89,13 @@ App::App(QWidget *parent, const char *name) : KMainWindow(parent, name), setupGUI(); - connect(board, SIGNAL(changed()), this, SLOT(enableItems())); + connect(board, TQT_SIGNAL(changed()), this, TQT_SLOT(enableItems())); - QTimer *t = new QTimer(this); + TQTimer *t = new TQTimer(this); t->start(1000); - connect(t, SIGNAL(timeout()), this, SLOT(updateScore())); - connect(board, SIGNAL(endOfGame()), this, SLOT(slotEndOfGame())); - connect(board, SIGNAL(resized()), this, SLOT(boardResized())); + connect(t, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateScore())); + connect(board, TQT_SIGNAL(endOfGame()), this, TQT_SLOT(slotEndOfGame())); + connect(board, TQT_SIGNAL(resized()), this, TQT_SLOT(boardResized())); kapp->processEvents(); @@ -106,25 +106,25 @@ App::App(QWidget *parent, const char *name) : KMainWindow(parent, name), void App::initKAction() { // Game - KStdGameAction::gameNew(this, SLOT(newGame()), actionCollection()); - KStdGameAction::restart(this, SLOT(restartGame()), actionCollection()); - KStdGameAction::pause(this, SLOT(pause()), actionCollection()); - KStdGameAction::highscores(this, SLOT(hallOfFame()), actionCollection()); - KStdGameAction::quit(this, SLOT(quitGame()), actionCollection()); + KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection()); + KStdGameAction::restart(this, TQT_SLOT(restartGame()), actionCollection()); + KStdGameAction::pause(this, TQT_SLOT(pause()), actionCollection()); + KStdGameAction::highscores(this, TQT_SLOT(hallOfFame()), actionCollection()); + KStdGameAction::quit(this, TQT_SLOT(quitGame()), actionCollection()); // Move - KStdGameAction::undo(this, SLOT(undo()), actionCollection()); - KStdGameAction::redo(this, SLOT(redo()), actionCollection()); - KStdGameAction::hint(this, SLOT(hint()), actionCollection()); + KStdGameAction::undo(this, TQT_SLOT(undo()), actionCollection()); + KStdGameAction::redo(this, TQT_SLOT(redo()), actionCollection()); + KStdGameAction::hint(this, TQT_SLOT(hint()), actionCollection()); //new KAction(i18n("Is Game Solvable?"), 0, this, - // SLOT(isSolvable()), actionCollection(), "move_solvable"); + // TQT_SLOT(isSolvable()), actionCollection(), "move_solvable"); #ifdef DEBUGGING - (void)new KAction(i18n("&Finish"), 0, board, SLOT(finish()), actionCollection(), "move_finish"); + (void)new KAction(i18n("&Finish"), 0, board, TQT_SLOT(finish()), actionCollection(), "move_finish"); #endif // Settings - KStdAction::preferences(this, SLOT(showSettings()), actionCollection()); + KStdAction::preferences(this, TQT_SLOT(showSettings()), actionCollection()); } void App::hallOfFame() @@ -207,7 +207,7 @@ void App::loadSettings() // The user can work-around this situation by un-maximizing the window first. if(Prefs::unscaled()) { - QSize s = board->unscaledSize(); + TQSize s = board->unscaledSize(); // We would have liked to have used KMainWindow::sizeForCentralWidgetSize(), // but this function does not seem to work when the toolbar is docked on the @@ -298,10 +298,10 @@ void App::slotEndOfGame() } else { - QString s = i18n("Congratulations! You made it in %1:%2:%3") - .arg(QString().sprintf("%02d", board->getTimeForGame()/3600)) - .arg(QString().sprintf("%02d", (board->getTimeForGame() / 60) % 60)) - .arg(QString().sprintf("%02d", board->getTimeForGame() % 60)); + TQString s = i18n("Congratulations! You made it in %1:%2:%3") + .arg(TQString().sprintf("%02d", board->getTimeForGame()/3600)) + .arg(TQString().sprintf("%02d", (board->getTimeForGame() / 60) % 60)) + .arg(TQString().sprintf("%02d", board->getTimeForGame() % 60)); KMessageBox::information(this, s, i18n("End of Game")); } @@ -314,19 +314,19 @@ void App::slotEndOfGame() void App::updateScore() { int t = board->getTimeForGame(); - QString s = i18n(" Your time: %1:%2:%3 %4") - .arg(QString().sprintf("%02d", t / 3600 )) - .arg(QString().sprintf("%02d", (t / 60) % 60 )) - .arg(QString().sprintf("%02d", t % 60 )) - .arg(board->isPaused()?i18n("(Paused) "):QString::null); + TQString s = i18n(" Your time: %1:%2:%3 %4") + .arg(TQString().sprintf("%02d", t / 3600 )) + .arg(TQString().sprintf("%02d", (t / 60) % 60 )) + .arg(TQString().sprintf("%02d", t % 60 )) + .arg(board->isPaused()?i18n("(Paused) "):TQString::null); statusBar()->changeItem(s, SBI_TIME); // Number of tiles int tl = (board->x_tiles() * board->y_tiles()); s = i18n(" Removed: %1/%2 ") - .arg(QString().sprintf("%d", tl - board->tilesLeft())) - .arg(QString().sprintf("%d", tl )); + .arg(TQString().sprintf("%d", tl - board->tilesLeft())) + .arg(TQString().sprintf("%d", tl )); statusBar()->changeItem(s, SBI_TILES); } @@ -351,33 +351,33 @@ void App::resetCheatMode() } } -QString App::getPlayerName() +TQString App::getPlayerName() { - QDialog *dlg = new QDialog(this, "Hall of Fame", true); + TQDialog *dlg = new TQDialog(this, "Hall of Fame", true); - QLabel *l1 = new QLabel(i18n("You've made it into the \"Hall Of Fame\". Type in\nyour name so mankind will always remember\nyour cool rating."), dlg); + TQLabel *l1 = new TQLabel(i18n("You've made it into the \"Hall Of Fame\". Type in\nyour name so mankind will always remember\nyour cool rating."), dlg); l1->setFixedSize(l1->sizeHint()); - QLabel *l2 = new QLabel(i18n("Your name:"), dlg); + TQLabel *l2 = new TQLabel(i18n("Your name:"), dlg); l2->setFixedSize(l2->sizeHint()); - QLineEdit *e = new QLineEdit(dlg); + TQLineEdit *e = new TQLineEdit(dlg); e->setText("XXXXXXXXXXXXXXXX"); e->setMinimumWidth(e->sizeHint().width()); e->setFixedHeight(e->sizeHint().height()); e->setText( lastPlayerName ); e->setFocus(); - QPushButton *b = new KPushButton(KStdGuiItem::ok(), dlg); + TQPushButton *b = new KPushButton(KStdGuiItem::ok(), dlg); b->setDefault(true); b->setFixedSize(b->sizeHint()); - connect(b, SIGNAL(released()), dlg, SLOT(accept())); - connect(e, SIGNAL(returnPressed()), dlg, SLOT(accept())); + connect(b, TQT_SIGNAL(released()), dlg, TQT_SLOT(accept())); + connect(e, TQT_SIGNAL(returnPressed()), dlg, TQT_SLOT(accept())); // create layout - QVBoxLayout *tl = new QVBoxLayout(dlg, 10); - QHBoxLayout *tl1 = new QHBoxLayout(); + TQVBoxLayout *tl = new TQVBoxLayout(dlg, 10); + TQHBoxLayout *tl1 = new TQHBoxLayout(); tl->addWidget(l1); tl->addSpacing(5); tl->addLayout(tl1); @@ -469,7 +469,7 @@ int App::insertHighscore(const HighScore &hs) void App::readHighscore() { - QStringList hi_x, hi_y, hi_sec, hi_date, hi_grav, hi_name; + TQStringList hi_x, hi_y, hi_sec, hi_date, hi_grav, hi_name; hi_x = highscoreTable->readList("x", HIGHSCORE_MAX); hi_y = highscoreTable->readList("y", HIGHSCORE_MAX); hi_sec = highscoreTable->readList("seconds", HIGHSCORE_MAX); @@ -501,7 +501,7 @@ void App::readOldHighscore() { // this is for before-KHighscore-highscores int i; - QString s, e, grp; + TQString s, e, grp; KConfig *conf = kapp->config(); highscore.resize(0); @@ -519,7 +519,7 @@ void App::readOldHighscore() HighScore hs; - QStringList e = conf->readListEntry(s, ' '); + TQStringList e = conf->readListEntry(s, ' '); int nelem = e.count(); hs.x = (*e.at(0)).toInt(); hs.y = (*e.at(1)).toInt(); @@ -570,15 +570,15 @@ void App::readOldHighscore() void App::writeHighscore() { int i; - QStringList hi_x, hi_y, hi_sec, hi_date, hi_grav, hi_name; + TQStringList hi_x, hi_y, hi_sec, hi_date, hi_grav, hi_name; for(i = 0; i < (int)highscore.size(); i++) { HighScore hs = highscore[i]; - hi_x.append(QString::number(hs.x)); - hi_y.append(QString::number(hs.y)); - hi_sec.append(QString::number(hs.seconds)); - hi_date.append(QString::number(hs.date)); - hi_grav.append(QString::number(hs.gravity)); + hi_x.append(TQString::number(hs.x)); + hi_y.append(TQString::number(hs.y)); + hi_sec.append(TQString::number(hs.seconds)); + hi_date.append(TQString::number(hs.date)); + hi_grav.append(TQString::number(hs.gravity)); hi_name.append(hs.name); } highscoreTable->writeList("x", hi_x); @@ -593,13 +593,13 @@ void App::writeHighscore() void App::showHighscore(int focusitem) { // this may look a little bit confusing... - QDialog *dlg = new QDialog(0, "hall_Of_fame", true); + TQDialog *dlg = new TQDialog(0, "hall_Of_fame", true); dlg->setCaption(i18n("Hall of Fame")); - QVBoxLayout *tl = new QVBoxLayout(dlg, 10); + TQVBoxLayout *tl = new TQVBoxLayout(dlg, 10); - QLabel *l = new QLabel(i18n("Hall of Fame"), dlg); - QFont f = font(); + TQLabel *l = new TQLabel(i18n("Hall of Fame"), dlg); + TQFont f = font(); f.setPointSize(24); f.setBold(true); l->setFont(f); @@ -609,7 +609,7 @@ void App::showHighscore(int focusitem) tl->addWidget(l); // insert highscores in a gridlayout - QGridLayout *table = new QGridLayout(12, 5, 5); + TQGridLayout *table = new TQGridLayout(12, 5, 5); tl->addLayout(table, 1); // add a separator line @@ -619,29 +619,29 @@ void App::showHighscore(int focusitem) // add titles f = font(); f.setBold(true); - l = new QLabel(i18n("Rank"), dlg); + l = new TQLabel(i18n("Rank"), dlg); l->setFont(f); l->setMinimumSize(l->sizeHint()); table->addWidget(l, 0, 0); - l = new QLabel(i18n("Name"), dlg); + l = new TQLabel(i18n("Name"), dlg); l->setFont(f); l->setMinimumSize(l->sizeHint()); table->addWidget(l, 0, 1); - l = new QLabel(i18n("Time"), dlg); + l = new TQLabel(i18n("Time"), dlg); l->setFont(f); l->setMinimumSize(l->sizeHint()); table->addWidget(l, 0, 2); - l = new QLabel(i18n("Size"), dlg); + l = new TQLabel(i18n("Size"), dlg); l->setFont(f); l->setMinimumSize(l->sizeHint()); table->addWidget(l, 0, 3); - l = new QLabel(i18n("Score"), dlg); + l = new TQLabel(i18n("Score"), dlg); l->setFont(f); l->setMinimumSize(l->sizeHint().width()*3, l->sizeHint().height()); table->addWidget(l, 0, 4); - QString s; - QLabel *e[10][5]; + TQString s; + TQLabel *e[10][5]; unsigned i, j; for(i = 0; i < 10; i++) @@ -652,25 +652,25 @@ void App::showHighscore(int focusitem) // insert rank s.sprintf("%d", i+1); - e[i][0] = new QLabel(s, dlg); + e[i][0] = new TQLabel(s, dlg); // insert name if(i < highscore.size()) - e[i][1] = new QLabel(hs.name, dlg); + e[i][1] = new TQLabel(hs.name, dlg); else - e[i][1] = new QLabel("", dlg); + e[i][1] = new TQLabel("", dlg); // insert time - QTime ti(0,0,0); + TQTime ti(0,0,0); if(i < highscore.size()) { ti = ti.addSecs(hs.seconds); s.sprintf("%02d:%02d:%02d", ti.hour(), ti.minute(), ti.second()); - e[i][2] = new QLabel(s, dlg); + e[i][2] = new TQLabel(s, dlg); } else { - e[i][2] = new QLabel("", dlg); + e[i][2] = new TQLabel("", dlg); } // insert size @@ -679,21 +679,21 @@ void App::showHighscore(int focusitem) else s = ""; - e[i][3] = new QLabel(s, dlg); + e[i][3] = new TQLabel(s, dlg); // insert score if(i < highscore.size()) { - s = QString("%1 %2") + s = TQString("%1 %2") .arg(getScore(hs)) - .arg(hs.gravity ? i18n("(gravity)") : QString("")); + .arg(hs.gravity ? i18n("(gravity)") : TQString("")); } else { s = ""; } - e[i][4] = new QLabel(s, dlg); + e[i][4] = new TQLabel(s, dlg); e[i][4]->setAlignment(AlignRight); } @@ -718,12 +718,12 @@ void App::showHighscore(int focusitem) } } - QPushButton *b = new KPushButton(KStdGuiItem::close(), dlg); + TQPushButton *b = new KPushButton(KStdGuiItem::close(), dlg); b->setFixedSize(b->sizeHint()); // connect the "Close"-button to done - connect(b, SIGNAL(clicked()), dlg, SLOT(accept())); + connect(b, TQT_SIGNAL(clicked()), dlg, TQT_SLOT(accept())); b->setDefault(true); b->setFocus(); @@ -752,8 +752,8 @@ void App::showSettings(){ KConfigDialog *dialog = new KConfigDialog(this, "settings", Prefs::self(), KDialogBase::Swallow); Settings *general = new Settings(0, "General"); dialog->addPage(general, i18n("General"), "package_settings"); - connect(dialog, SIGNAL(settingsChanged()), this, SLOT(loadSettings())); - connect(dialog, SIGNAL(settingsChanged()), board, SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(loadSettings())); + connect(dialog, TQT_SIGNAL(settingsChanged()), board, TQT_SLOT(loadSettings())); dialog->show(); } diff --git a/kshisen/app.h b/kshisen/app.h index 47808f9e..7e670138 100644 --- a/kshisen/app.h +++ b/kshisen/app.h @@ -50,7 +50,7 @@ class KHighscore; struct HighScore { - QString name; + TQString name; int seconds; int x, y; time_t date; @@ -64,7 +64,7 @@ class App : public KMainWindow Q_OBJECT public: - App(QWidget *parent = 0, const char *name=0); + App(TQWidget *parent = 0, const char *name=0); private slots: void loadSettings(); @@ -88,7 +88,7 @@ private slots: private: void lockMenus(bool); - QString getPlayerName(); + TQString getPlayerName(); /** * Read the old (pre- @ref KHighscore) highscore table. @@ -109,9 +109,9 @@ private: void resetCheatMode(); private: - QString lastPlayerName; + TQString lastPlayerName; Board *board; - QValueVector<HighScore> highscore; + TQValueVector<HighScore> highscore; KHighscore* highscoreTable; bool cheat; diff --git a/kshisen/board.cpp b/kshisen/board.cpp index ab61a912..ee0d70a7 100644 --- a/kshisen/board.cpp +++ b/kshisen/board.cpp @@ -42,9 +42,9 @@ #include <kglobalsettings.h> #include <kdebug.h> -#include <qpainter.h> -#include <qpaintdevicemetrics.h> -#include <qtimer.h> +#include <tqpainter.h> +#include <tqpaintdevicemetrics.h> +#include <tqtimer.h> #include "board.h" #include "prefs.h" @@ -57,8 +57,8 @@ static int size_x[5] = {14, 18, 24, 26, 30}; static int size_y[5] = { 6, 8, 12, 14, 16}; static int DELAY[5] = {1000, 750, 500, 250, 125}; -Board::Board(QWidget *parent, const char *name) : - QWidget(parent, name, WResizeNoErase), field(0), +Board::Board(TQWidget *parent, const char *name) : + TQWidget(parent, name, WResizeNoErase), field(0), _x_tiles(0), _y_tiles(0), _delay(125), paused(false), gravity_flag(true), _solvable_flag(true), @@ -74,7 +74,7 @@ Board::Board(QWidget *parent, const char *name) : _redo.setAutoDelete(true); _undo.setAutoDelete(true); - QPixmap bg(KGlobal::dirs()->findResource("appdata", "kshisen_bgnd.png")); + TQPixmap bg(KGlobal::dirs()->findResource("appdata", "kshisen_bgnd.png")); setBackgroundPixmap(bg); loadSettings(); @@ -165,7 +165,7 @@ void Board::gravity(int col, bool update) } } -void Board::mousePressEvent(QMouseEvent *e) +void Board::mousePressEvent(TQMouseEvent *e) { // Calculate field position int pos_x = (e->pos().x() - xOffset()) / tiles.tileWidth(); @@ -273,7 +273,7 @@ void Board::setSize(int x, int y) emit changed(); } -void Board::resizeEvent(QResizeEvent*) +void Board::resizeEvent(TQResizeEvent*) { resizeBoard(); emit resized(); @@ -292,11 +292,11 @@ void Board::resizeBoard() tiles.resizeTiles(w, h); } -QSize Board::unscaledSize() const +TQSize Board::unscaledSize() const { int w = tiles.unscaledTileWidth() * x_tiles() + tiles.unscaledTileWidth(); int h = tiles.unscaledTileHeight() * y_tiles() + tiles.unscaledTileWidth(); - return QSize(w, h); + return TQSize(w, h); } void Board::newGame() @@ -439,7 +439,7 @@ bool Board::isTileHighlighted(int x, int y) const void Board::updateField(int x, int y, bool erase) { - QRect r(xOffset() + x * tiles.tileWidth(), + TQRect r(xOffset() + x * tiles.tileWidth(), yOffset() + y * tiles.tileHeight(), tiles.tileWidth(), tiles.tileHeight()); @@ -447,13 +447,13 @@ void Board::updateField(int x, int y, bool erase) repaint(r, erase); } -void Board::paintEvent(QPaintEvent *e) +void Board::paintEvent(TQPaintEvent *e) { - QRect ur = e->rect(); // rectangle to update - QPixmap pm(ur.size()); // Pixmap for double-buffering + TQRect ur = e->rect(); // rectangle to update + TQPixmap pm(ur.size()); // Pixmap for double-buffering pm.fill(this, ur.topLeft()); // fill with widget background - QPainter p(&pm); + TQPainter p(&pm); p.translate(-ur.x(), -ur.y()); // use widget coordinate system if(paused) @@ -475,7 +475,7 @@ void Board::paintEvent(QPaintEvent *e) int xpos = xOffset() + i * w; int ypos = yOffset() + j * h; - QRect r(xpos, ypos, w, h); + TQRect r(xpos, ypos, w, h); if(e->rect().intersects(r)) { if(isTileHighlighted(i, j)) @@ -664,9 +664,9 @@ void Board::drawConnection(int timeout) updateField(connection.front().x, connection.front().y); updateField(connection.back().x, connection.back().y); - QPainter p; + TQPainter p; p.begin(this); - p.setPen(QPen(QColor("red"), tiles.lineWidth())); + p.setPen(TQPen(TQColor("red"), tiles.lineWidth())); // Path.size() will always be >= 2 Path::const_iterator pathEnd = connection.end(); @@ -683,7 +683,7 @@ void Board::drawConnection(int timeout) p.flush(); p.end(); - QTimer::singleShot(timeout, this, SLOT(undrawConnection())); + TQTimer::singleShot(timeout, this, TQT_SLOT(undrawConnection())); } void Board::undrawConnection() @@ -735,9 +735,9 @@ void Board::undrawConnection() } } -QPoint Board::midCoord(int x, int y) const +TQPoint Board::midCoord(int x, int y) const { - QPoint p; + TQPoint p; int w = tiles.tileWidth(); int h = tiles.tileHeight(); @@ -893,14 +893,14 @@ void Board::dumpBoard() const kdDebug() << "Board contents:" << endl; for(int y = 0; y < y_tiles(); ++y) { - QString row; + TQString row; for(int x = 0; x < x_tiles(); ++x) { int tile = getField(x, y); if(tile == EMPTY) row += " --"; else - row += QString("%1").arg(getField(x, y), 3); + row += TQString("%1").arg(getField(x, y), 3); } kdDebug() << row << endl; } @@ -1071,12 +1071,12 @@ bool Board::pause() return paused; } -QSize Board::sizeHint() const +TQSize Board::sizeHint() const { - int dpi = QPaintDeviceMetrics(this).logicalDpiX(); + int dpi = TQPaintDeviceMetrics(this).logicalDpiX(); if (dpi < 75) dpi = 75; - return QSize(9*dpi,7*dpi); + return TQSize(9*dpi,7*dpi); } #include "board.moc" diff --git a/kshisen/board.h b/kshisen/board.h index c38fba57..2413d8d4 100644 --- a/kshisen/board.h +++ b/kshisen/board.h @@ -72,12 +72,12 @@ class Board : public QWidget Q_OBJECT public: - Board(QWidget *parent = 0, const char *name=0); + Board(TQWidget *parent = 0, const char *name=0); ~Board(); - virtual void paintEvent(QPaintEvent *); - virtual void mousePressEvent(QMouseEvent *); - virtual void resizeEvent(QResizeEvent*); + virtual void paintEvent(TQPaintEvent *); + virtual void mousePressEvent(TQMouseEvent *); + virtual void resizeEvent(TQResizeEvent*); void setDelay(int); int getDelay() const; @@ -89,7 +89,7 @@ public: void setSize(int x, int y); void resizeBoard(); - QSize unscaledSize() const; + TQSize unscaledSize() const; void newGame(); void setShuffle(int); int getShuffle() const; @@ -134,7 +134,7 @@ private slots: void gravity(int, bool); protected: - virtual QSize sizeHint() const; + virtual TQSize sizeHint() const; private: // functions void initBoard(); @@ -151,7 +151,7 @@ private: // functions bool findSimplePath(int x1, int y1, int x2, int y2, Path& p) const; bool isTileHighlighted(int x, int y) const; void drawConnection(int timeout); - QPoint midCoord(int x, int y) const; + TQPoint midCoord(int x, int y) const; void marked(int x, int y); void madeMove(int x1, int y1, int x2, int y2); @@ -163,8 +163,8 @@ private: KRandomSequence random; - QPtrList<Move> _undo; - QPtrList<Move> _redo; + TQPtrList<Move> _undo; + TQPtrList<Move> _redo; int undraw_timer_id; int mark_x; diff --git a/kshisen/tileset.cpp b/kshisen/tileset.cpp index f44e2698..492cde79 100644 --- a/kshisen/tileset.cpp +++ b/kshisen/tileset.cpp @@ -27,7 +27,7 @@ #include <kmessagebox.h> #include <kdebug.h> -#include <qimage.h> +#include <tqimage.h> #include <algorithm> @@ -36,7 +36,7 @@ TileSet::TileSet() : scaledTiles(nTiles) { //loadTiles - QImage tileset(KGlobal::dirs()->findResource("appdata", "tileset.png")); + TQImage tileset(KGlobal::dirs()->findResource("appdata", "tileset.png")); if(tileset.isNull()) { KMessageBox::sorry(0, i18n("Cannot load tiles pixmap!")); @@ -76,7 +76,7 @@ void TileSet::resizeTiles(int maxWidth, int maxHeight) //kdDebug() << "tile size: " << maxWidth << "x" << maxHeight << endl; - QImage img; + TQImage img; for(int i = 0; i < nTiles; i++) { if(maxHeight == unscaledTileHeight()) @@ -88,17 +88,17 @@ void TileSet::resizeTiles(int maxWidth, int maxHeight) } } -const QPixmap &TileSet::tile(int n) const +const TQPixmap &TileSet::tile(int n) const { return scaledTiles[n]; } -QPixmap TileSet::highlightedTile(int n) const +TQPixmap TileSet::highlightedTile(int n) const { const double LIGHTEN_FACTOR = 1.3; // lighten the image - QImage img = scaledTiles[n].convertToImage().convertDepth(32); + TQImage img = scaledTiles[n].convertToImage().convertDepth(32); for(int y = 0; y < img.height(); y++) { @@ -110,7 +110,7 @@ QPixmap TileSet::highlightedTile(int n) const } } - QPixmap highlightedTile; + TQPixmap highlightedTile; highlightedTile.convertFromImage(img); return highlightedTile; diff --git a/kshisen/tileset.h b/kshisen/tileset.h index 02905201..ee371327 100644 --- a/kshisen/tileset.h +++ b/kshisen/tileset.h @@ -24,7 +24,7 @@ #ifndef __IMAGEDATA__H__ #define __IMAGEDATA__H__ -#include <qvaluevector.h> +#include <tqvaluevector.h> class TileSet { @@ -38,8 +38,8 @@ public: void resizeTiles(int maxWidth, int maxHeight); - const QPixmap &tile(int n) const; - QPixmap highlightedTile(int n) const; + const TQPixmap &tile(int n) const; + TQPixmap highlightedTile(int n) const; int lineWidth() const; @@ -50,8 +50,8 @@ public: private: - QValueVector<QPixmap> scaledTiles; - QValueVector<QImage> unscaledTiles; + TQValueVector<TQPixmap> scaledTiles; + TQValueVector<TQImage> unscaledTiles; }; |