summaryrefslogtreecommitdiffstats
path: root/kmahjongg/boardwidget.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-11 04:58:26 +0000
commit838baf3f99ec5ab81b063eb5449a3381d860f377 (patch)
treedd31abcfde08ca92e4623b8f50b3d762a87c997a /kmahjongg/boardwidget.cpp
parent2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff)
downloadtdegames-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 'kmahjongg/boardwidget.cpp')
-rw-r--r--kmahjongg/boardwidget.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/kmahjongg/boardwidget.cpp b/kmahjongg/boardwidget.cpp
index c8a5cd61..615091ab 100644
--- a/kmahjongg/boardwidget.cpp
+++ b/kmahjongg/boardwidget.cpp
@@ -14,8 +14,8 @@
* Constructor.
* Loads tileset and background bitmaps.
*/
-BoardWidget::BoardWidget( TQWidget* parent, const char *name )
- : TQWidget( parent, name ), theTiles(false)
+BoardWidget::BoardWidget( TQWidget* tqparent, const char *name )
+ : TQWidget( tqparent, name ), theTiles(false)
{
setBackgroundColor( TQColor( 0,0,0 ) );
@@ -45,7 +45,7 @@ BoardWidget::BoardWidget( TQWidget* parent, const char *name )
if (!loadTileset(tFile)){
KMessageBox::error(this,
i18n("An error occurred when loading the tileset file %1\n"
- "KMahjongg will now terminate.").arg(tFile));
+ "KMahjongg will now terminate.").tqarg(tFile));
kapp->quit();
}
@@ -55,17 +55,17 @@ BoardWidget::BoardWidget( TQWidget* parent, const char *name )
if( ! loadBackground(tFile, false ) )
{
KMessageBox::error(this,
- i18n("An error occurred when loading the background image\n%1").arg(tFile)+
+ i18n("An error occurred when loading the background image\n%1").tqarg(tFile)+
i18n("KMahjongg will now terminate."));
kapp->quit();
}
- getFileOrDefault(Prefs::layout(), "layout", tFile);
+ getFileOrDefault(Prefs::layout(), "tqlayout", tFile);
if( ! loadBoardLayout(tFile) )
{
KMessageBox::error(this,
- i18n("An error occurred when loading the board layout %1\n"
- "KMahjongg will now terminate.").arg(tFile));
+ i18n("An error occurred when loading the board tqlayout %1\n"
+ "KMahjongg will now terminate.").tqarg(tFile));
kapp->quit();
}
setDisplayedWidth();
@@ -92,7 +92,7 @@ void BoardWidget::saveSettings(){
//config->writePathEntry("Tileset_file", tileFile);
//config->writePathEntry("Background_file", backgroundFile);
- //config->writePathEntry("Layout_file", layout);
+ //config->writePathEntry("Layout_file", tqlayout);
}
void BoardWidget::getFileOrDefault(TQString filename, TQString type, TQString &res)
@@ -111,7 +111,7 @@ void BoardWidget::getFileOrDefault(TQString filename, TQString type, TQString &r
if (res.isEmpty()) {
KMessageBox::error(this, i18n("KMahjongg could not locate the file: %1\n"
"or the default file of type: %2\n"
- "KMahjongg will now terminate").arg(filename).arg(type) );
+ "KMahjongg will now terminate").tqarg(filename).tqarg(type) );
kapp->quit();
}
}
@@ -264,7 +264,7 @@ void BoardWidget::paintEvent( TQPaintEvent* pa )
return;
}
- // if the repaint is because of a window redraw after a move
+ // if the tqrepaint is because of a window redraw after a move
// or a menu roll up, then just blit in the last rendered image
if (!updateBackBuffer) {
bitBlt(this, xx,pa->rect().top(),
@@ -440,7 +440,7 @@ void BoardWidget::stackTiles(unsigned char t, unsigned short h, unsigned short x
int ss = theTiles.shadowSize();
TQPainter p(&backBuffer);
TQPen line;
- p.setBackgroundMode(OpaqueMode);
+ p.setBackgroundMode(Qt::OpaqueMode);
p.setBackgroundColor(black);
@@ -766,7 +766,7 @@ void BoardWidget::calculateNewGame( int gNumber)
}
// ---------------------------------------------------------
-// Generate the position data for the layout from contents of Game.Map.
+// Generate the position data for the tqlayout from contents of Game.Map.
void BoardWidget::generateTilePositions() {
numTiles = 0;
@@ -788,7 +788,7 @@ void BoardWidget::generateTilePositions() {
}
// ---------------------------------------------------------
-// Generate the dependency data for the layout from the position data.
+// Generate the dependency data for the tqlayout from the position data.
// Note that the coordinates of each tile in tilePositions are those of
// the upper left quarter of the tile.
void BoardWidget::generatePositionDepends() {
@@ -882,7 +882,7 @@ int BoardWidget::tileAt(int x, int y, int z) {
bool BoardWidget::generateSolvableGame() {
// Initially we want to mark positions on layer 0 so that we have only
- // one free position per apparent horizontal line.
+ // one free position per aptqparent horizontal line.
for (int i = 0; i < numTiles; i++) {
// Pick a random tile on layer 0
@@ -894,7 +894,7 @@ bool BoardWidget::generateSolvableGame() {
}
} while (tilePositions[position].e != 0);
- // If there are no other free positions on the same apparent
+ // If there are no other free positions on the same aptqparent
// horizontal line, we can mark that position as free.
if (onlyFreeInLine(position)) {
positionDepends[position].free = true;
@@ -965,7 +965,7 @@ bool BoardWidget::generateSolvableGame() {
// ---------------------------------------------------------
// Determines whether it is ok to mark this position as "free" because
-// there are no other positions marked "free" in its apparent horizontal
+// there are no other positions marked "free" in its aptqparent horizontal
// line.
bool BoardWidget::onlyFreeInLine(int position) {
@@ -1104,7 +1104,7 @@ void BoardWidget::updateDepend(int position) {
}
}
- // If position is first free on apparent horizontal, it is
+ // If position is first free on aptqparent horizontal, it is
// now free to be filled.
if (onlyFreeInLine(position)) {
positionDepends[position].free = true;
@@ -1393,7 +1393,7 @@ bool BoardWidget::findMove( POSITION& posA, POSITION& posB )
iPosCount = 0; // Hier Anzahl der gefunden Paare merken
- // The new tile layout with non-contiguos horizantle spans
+ // The new tile tqlayout with non-contiguos horizantle spans
// can lead to huge numbers of matching pairs being exposed.
// we alter the loop to bail out when BoardLayout::maxTiles/2 pairs are found
// (or less);
@@ -1623,7 +1623,7 @@ void BoardWidget::mousePressEvent ( TQMouseEvent* event )
if (gamePaused)
return;
- if( event->button() == LeftButton )
+ if( event->button() == Qt::LeftButton )
{
if( TimerState == Demo )
{
@@ -1804,7 +1804,7 @@ bool BoardWidget::loadBackground(
if( ! theBackground.load( pszFileName, requiredWidth(), requiredHeight()) )
{
if( bShowError )
- KMessageBox::sorry(this, i18n("Failed to load image:\n%1").arg(pszFileName) );
+ KMessageBox::sorry(this, i18n("Failed to load image:\n%1").tqarg(pszFileName) );
return( false );
}
Prefs::setBackground(pszFileName);
@@ -2010,7 +2010,7 @@ void BoardWidget::shuffle() {
// force a redraw
updateBackBuffer=true;
- repaint(false);
+ tqrepaint(false);
// I consider this s very bad cheat so, I punish the user