summaryrefslogtreecommitdiff
path: root/noncore/games/minesweep/minesweep.cpp
Side-by-side diff
Diffstat (limited to 'noncore/games/minesweep/minesweep.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/games/minesweep/minesweep.cpp26
1 files changed, 14 insertions, 12 deletions
diff --git a/noncore/games/minesweep/minesweep.cpp b/noncore/games/minesweep/minesweep.cpp
index 48644b3..7214a73 100644
--- a/noncore/games/minesweep/minesweep.cpp
+++ b/noncore/games/minesweep/minesweep.cpp
@@ -22,4 +22,5 @@
#include "minefield.h"
+#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
#include <qpe/config.h>
@@ -156,10 +157,10 @@ static const char * dead_xpm[] = {
class ResultIndicator : private QLabel
{
-public:
+public:
static void showResult( QWidget *ref, bool won );
-private:
+private:
ResultIndicator( QWidget *parent, const char *name, WFlags f)
:QLabel( parent, name, f ) {}
-
+
void timerEvent( QTimerEvent *);
void center();
@@ -171,5 +172,5 @@ void ResultIndicator::showResult( QWidget *ref, bool won )
{
ResultIndicator *r = new ResultIndicator( ref, 0, WStyle_Customize | WStyle_Tool | WType_TopLevel );
-
+
r->setAlignment( AlignCenter );
r->setFrameStyle( Sunken|StyledPanel );
@@ -196,5 +197,5 @@ void ResultIndicator::center()
QWidget *w = parentWidget();
- QPoint pp = w->mapToGlobal( QPoint(0,0) );
+ QPoint pp = w->mapToGlobal( QPoint(0,0) );
QSize s = sizeHint()*3;
pp = QPoint( pp.x() + w->width()/2 - s.width()/2,
@@ -202,5 +203,5 @@ void ResultIndicator::center()
setGeometry( QRect(pp, s) );
-
+
}
@@ -229,5 +230,5 @@ protected:
void resizeEvent( QResizeEvent *e ) {
field->setAvailableRect( contentsRect());
- QFrame::resizeEvent(e);
+ QFrame::resizeEvent(e);
}
private:
@@ -240,4 +241,5 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
: QMainWindow( parent, name, f )
{
+ QPEApplication::setInputMethodHint(this, QPEApplication::AlwaysOff );
srand(::time(0));
setCaption( tr("Mine Hunt") );
@@ -255,5 +257,5 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
menuBar->insertItem( tr("Game"), gameMenu );
-
+
guessLCD = new QLCDNumber( toolBar );
toolBar->setStretchableWidget( guessLCD );
@@ -262,5 +264,5 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
lcdPal.setColor( QColorGroup::Background, QApplication::palette().active().background() );
lcdPal.setColor( QColorGroup::Button, QApplication::palette().active().button() );
-
+
// guessLCD->setPalette( lcdPal );
guessLCD->setSegmentStyle( QLCDNumber::Flat );
@@ -272,5 +274,5 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
newGameButton->setFocusPolicy(QWidget::NoFocus);
connect( newGameButton, SIGNAL(clicked()), this, SLOT(newGame()) );
-
+
timeLCD = new QLCDNumber( toolBar );
// timeLCD->setPalette( lcdPal );
@@ -279,5 +281,5 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
timeLCD->setNumDigits( 5 ); // "mm:ss"
timeLCD->setBackgroundMode( PaletteButton );
-
+
setToolBarsMovable ( FALSE );
@@ -297,5 +299,5 @@ MineSweep::MineSweep( QWidget* parent, const char* name, WFlags f )
field->setFocus();
setCentralWidget( mainframe );
-
+
connect( field, SIGNAL( gameOver( bool ) ), this, SLOT( gameOver( bool ) ) );
connect( field, SIGNAL( mineCount( int ) ), this, SLOT( setCounter( int ) ) );