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 /kreversi/qreversigameview.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 'kreversi/qreversigameview.cpp')
-rw-r--r-- | kreversi/qreversigameview.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/kreversi/qreversigameview.cpp b/kreversi/qreversigameview.cpp index e9104398..e6a17cbf 100644 --- a/kreversi/qreversigameview.cpp +++ b/kreversi/qreversigameview.cpp @@ -71,8 +71,8 @@ // class StatusWidget -StatusWidget::StatusWidget(const TQString &text, TQWidget *parent) - : TQWidget(parent, "status_widget") +StatusWidget::StatusWidget(const TQString &text, TQWidget *tqparent) + : TQWidget(tqparent, "status_widget") { TQHBoxLayout *hbox = new TQHBoxLayout(this, 0, KDialog::spacingHint()); TQLabel *label; @@ -119,11 +119,11 @@ void StatusWidget::setScore(uint s) // ================================================================ -// class QReversiGameView +// class TQReversiGameView -QReversiGameView::QReversiGameView(TQWidget *parent, QReversiGame *game) - : TQWidget(parent, "gameview") +TQReversiGameView::TQReversiGameView(TQWidget *tqparent, TQReversiGame *game) + : TQWidget(tqparent, "gameview") { // Store a pointer to the game. m_game = game; @@ -147,39 +147,39 @@ QReversiGameView::QReversiGameView(TQWidget *parent, QReversiGame *game) } -QReversiGameView::~QReversiGameView() +TQReversiGameView::~TQReversiGameView() { } // Create the entire view. Only called once from the constructor. -void QReversiGameView::createView() +void TQReversiGameView::createView() { - TQGridLayout *layout = new TQGridLayout(this, 4, 2); + TQGridLayout *tqlayout = new TQGridLayout(this, 4, 2); // The board - m_boardView = new QReversiBoardView(this, m_game); + m_boardView = new TQReversiBoardView(this, m_game); m_boardView->loadSettings(); // Load the pixmaps used in the status widgets. - layout->addMultiCellWidget(m_boardView, 0, 3, 0, 0); + tqlayout->addMultiCellWidget(m_boardView, 0, 3, 0, 0); // The status widgets - m_blackStatus = new StatusWidget(TQString::null, this); - m_blackStatus->setPixmap(m_boardView->chipPixmap(Black, 20)); - layout->addWidget(m_blackStatus, 0, 1); - m_whiteStatus = new StatusWidget(TQString::null, this); - m_whiteStatus->setPixmap(m_boardView->chipPixmap(White, 20)); - layout->addWidget(m_whiteStatus, 1, 1); + m_blacktqStatus = new StatusWidget(TQString(), this); + m_blacktqStatus->setPixmap(m_boardView->chipPixmap(Black, 20)); + tqlayout->addWidget(m_blacktqStatus, 0, 1); + m_whitetqStatus = new StatusWidget(TQString(), this); + m_whitetqStatus->setPixmap(m_boardView->chipPixmap(White, 20)); + tqlayout->addWidget(m_whitetqStatus, 1, 1); // The "Moves" label TQLabel *movesLabel = new TQLabel( i18n("Moves"), this); - movesLabel->setAlignment(AlignCenter); - layout->addWidget(movesLabel, 2, 1); + movesLabel->tqsetAlignment(AlignCenter); + tqlayout->addWidget(movesLabel, 2, 1); // The list of moves. m_movesView = new TQListBox(this, "moves"); m_movesView->setMinimumWidth(150); - layout->addWidget(m_movesView, 3, 1); + tqlayout->addWidget(m_movesView, 3, 1); } @@ -189,17 +189,17 @@ void QReversiGameView::createView() // Recieves the sig_newGame signal from the game. -void QReversiGameView::newGame() +void TQReversiGameView::newGame() { m_boardView->updateBoard(true); m_movesView->clear(); - updateStatus(); + updatetqStatus(); } // Recieves the sig_move signal from the game. -void QReversiGameView::moveMade(uint moveNum, Move &move) +void TQReversiGameView::moveMade(uint moveNum, Move &move) { //FIXME: Error checks. TQString colorsWB[] = { @@ -213,10 +213,10 @@ void QReversiGameView::moveMade(uint moveNum, Move &move) // Insert the new move in the listbox and mark it as the current one. m_movesView->insertItem(TQString("%1. %2 %3") - .arg(moveNum) - .arg(Prefs::grayscale() ? colorsWB[move.color()] + .tqarg(moveNum) + .tqarg(Prefs::grayscale() ? colorsWB[move.color()] : colorsRB[move.color()]) - .arg(move.asString())); + .tqarg(move.asString())); m_movesView->setCurrentItem(moveNum - 1); m_movesView->ensureCurrentVisible(); @@ -225,33 +225,33 @@ void QReversiGameView::moveMade(uint moveNum, Move &move) m_boardView->updateBoard(); // Update the score. - updateStatus(); + updatetqStatus(); } // Recieves the sig_update signal from the game, and can be called // whenever a total update of the view is required. -void QReversiGameView::updateView() +void TQReversiGameView::updateView() { m_boardView->updateBoard(true); updateMovelist(); - updateStatus(); + updatetqStatus(); } // Only updates the status widgets (score). -void QReversiGameView::updateStatus() +void TQReversiGameView::updatetqStatus() { - m_blackStatus->setScore(m_game->score(Black)); - m_whiteStatus->setScore(m_game->score(White)); + m_blacktqStatus->setScore(m_game->score(Black)); + m_whitetqStatus->setScore(m_game->score(White)); } // Only updates the status board. -void QReversiGameView::updateBoard(bool force) +void TQReversiGameView::updateBoard(bool force) { m_boardView->updateBoard(force); } @@ -260,7 +260,7 @@ void QReversiGameView::updateBoard(bool force) // Only updates the movelist. This method regenerates the list from // scratch. -void QReversiGameView::updateMovelist() +void TQReversiGameView::updateMovelist() { // FIXME: NYI } @@ -270,7 +270,7 @@ void QReversiGameView::updateMovelist() // access to the internal board view. // -void QReversiGameView::squareClicked(int row, int col) +void TQReversiGameView::squareClicked(int row, int col) { emit signalSquareClicked(row, col); } @@ -280,17 +280,17 @@ void QReversiGameView::squareClicked(int row, int col) // Other public methods. -void QReversiGameView::setHumanColor(Color color) +void TQReversiGameView::setHumanColor(Color color) { m_humanColor = color; if (color == Black) { - m_blackStatus->setText(i18n("You")); - m_whiteStatus->setText(""); + m_blacktqStatus->setText(i18n("You")); + m_whitetqStatus->setText(""); } else { - m_blackStatus->setText(""); - m_whiteStatus->setText(i18n("You")); + m_blacktqStatus->setText(""); + m_whitetqStatus->setText(i18n("You")); } } |