summaryrefslogtreecommitdiffstats
path: root/kmines/field.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:42:31 +0000
commit576eb4299a00bc053db35414406f46372a0f70f2 (patch)
tree4c030922d533821db464af566188e7d40cc8848c /kmines/field.cpp
parent0718336b6017d1a4fc1d626544180a5a2a29ddec (diff)
downloadtdegames-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 'kmines/field.cpp')
-rw-r--r--kmines/field.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/kmines/field.cpp b/kmines/field.cpp
index 1f3b3dfd..ff3b4e46 100644
--- a/kmines/field.cpp
+++ b/kmines/field.cpp
@@ -21,9 +21,9 @@
#include <math.h>
-#include <qlayout.h>
-#include <qtimer.h>
-#include <qpainter.h>
+#include <tqlayout.h>
+#include <tqtimer.h>
+#include <tqpainter.h>
#include <klocale.h>
#include <knotifyclient.h>
@@ -44,22 +44,22 @@ const Field::ActionData Field::ACTION_DATA[Nb_Actions] = {
{ "UnsetUncertain", "unset_uncertain", I18N_NOOP("Question mark unset") }
};
-Field::Field(QWidget *parent)
+Field::Field(TQWidget *parent)
: FieldFrame(parent), _state(Init), _solvingState(Regular), _level(Level::Easy)
{}
void Field::readSettings()
{
if ( inside(_cursor) ) {
- QPainter p(this);
+ TQPainter p(this);
drawCase(p, _cursor);
}
if ( Settings::magicReveal() ) emit setCheating();
}
-QSize Field::sizeHint() const
+TQSize Field::sizeHint() const
{
- return QSize(2*frameWidth() + _level.width()*Settings::caseSize(),
+ return TQSize(2*frameWidth() + _level.width()*Settings::caseSize(),
2*frameWidth() + _level.height()*Settings::caseSize());
}
@@ -70,7 +70,7 @@ void Field::setLevel(const Level &level)
adjustSize();
}
-void Field::setReplayField(const QString &field)
+void Field::setReplayField(const TQString &field)
{
setState(Replaying);
initReplay(field);
@@ -97,9 +97,9 @@ void Field::reset(bool init)
update();
}
-void Field::paintEvent(QPaintEvent *e)
+void Field::paintEvent(TQPaintEvent *e)
{
- QPainter painter(this);
+ TQPainter painter(this);
drawFrame(&painter);
if ( _state==Paused ) return;
@@ -115,27 +115,27 @@ void Field::paintEvent(QPaintEvent *e)
void Field::changeCase(const Coord &p, CaseState newState)
{
BaseField::changeCase(p, newState);
- QPainter painter(this);
+ TQPainter painter(this);
drawCase(painter, p);
if ( isActive() ) emit updateStatus( hasMine(p) );
}
-QPoint Field::toPoint(const Coord &p) const
+TQPoint Field::toPoint(const Coord &p) const
{
- QPoint qp;
+ TQPoint qp;
qp.setX( p.first*Settings::caseSize() + frameWidth() );
qp.setY( p.second*Settings::caseSize() + frameWidth() );
return qp;
}
-Coord Field::fromPoint(const QPoint &qp) const
+Coord Field::fromPoint(const TQPoint &qp) const
{
double i = (double)(qp.x() - frameWidth()) / Settings::caseSize();
double j = (double)(qp.y() - frameWidth()) / Settings::caseSize();
return Coord((int)floor(i), (int)floor(j));
}
-int Field::mapMouseButton(QMouseEvent *e) const
+int Field::mapMouseButton(TQMouseEvent *e) const
{
switch (e->button()) {
case Qt::LeftButton: return Settings::mouseAction(Settings::EnumButton::left);
@@ -162,7 +162,7 @@ void Field::revealActions(bool press)
}
}
-void Field::mousePressEvent(QMouseEvent *e)
+void Field::mousePressEvent(TQMouseEvent *e)
{
if ( !isActive() || (_currentAction!=Settings::EnumMouseAction::None) ) return;
@@ -175,7 +175,7 @@ void Field::mousePressEvent(QMouseEvent *e)
revealActions(true);
}
-void Field::mouseReleaseEvent(QMouseEvent *e)
+void Field::mouseReleaseEvent(TQMouseEvent *e)
{
if ( !isActive() ) return;
@@ -199,7 +199,7 @@ void Field::mouseReleaseEvent(QMouseEvent *e)
}
}
-void Field::mouseMoveEvent(QMouseEvent *e)
+void Field::mouseMoveEvent(TQMouseEvent *e)
{
if ( !isActive() ) return;
@@ -215,7 +215,7 @@ void Field::mouseMoveEvent(QMouseEvent *e)
void Field::pressCase(const Coord &c, bool pressed)
{
if ( state(c)==Covered ) {
- QPainter painter(this);
+ TQPainter painter(this);
drawCase(painter, c, pressed);
}
}
@@ -224,7 +224,7 @@ void Field::pressClearFunction(const Coord &p, bool pressed)
{
pressCase(p, pressed);
CoordList n = coveredNeighbours(p);
- QPainter painter(this);
+ TQPainter painter(this);
for (CoordList::const_iterator it=n.begin(); it!=n.end(); ++it)
drawCase(painter, *it, pressed);
}
@@ -233,7 +233,7 @@ void Field::keyboardAutoReveal()
{
_cursor_back = _cursor;
pressClearFunction(_cursor_back, true);
- QTimer::singleShot(50, this, SLOT(keyboardAutoRevealSlot()));
+ TQTimer::singleShot(50, this, TQT_SLOT(keyboardAutoRevealSlot()));
}
void Field::keyboardAutoRevealSlot()
@@ -385,7 +385,7 @@ void Field::placeCursor(const Coord &p)
Coord old = _cursor;
_cursor = p;
if ( Settings::keyboardGame() ) {
- QPainter painter(this);
+ TQPainter painter(this);
drawCase(painter, old);
drawCase(painter, _cursor);
}
@@ -394,7 +394,7 @@ void Field::placeCursor(const Coord &p)
void Field::resetAdvised()
{
if ( !inside(_advisedCoord) ) return;
- QPainter p(this);
+ TQPainter p(this);
Coord tmp = _advisedCoord;
_advisedCoord = Coord(-1, -1);
drawCase(p, tmp);
@@ -407,16 +407,16 @@ void Field::setAdvised(const Coord &c, double proba)
_advisedCoord = c;
_advisedProba = proba;
if ( inside(c) ) {
- QPainter p(this);
+ TQPainter p(this);
drawCase(p, c);
}
}
-void Field::drawCase(QPainter &painter, const Coord &c, bool pressed) const
+void Field::drawCase(TQPainter &painter, const Coord &c, bool pressed) const
{
Q_ASSERT( inside(c) );
- QString text;
+ TQString text;
uint nbMines = 0;
PixmapType type = NoPixmap;