summaryrefslogtreecommitdiffstats
path: root/kmines/solver
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/solver
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/solver')
-rw-r--r--kmines/solver/bfield.cpp8
-rw-r--r--kmines/solver/bfield.h8
-rw-r--r--kmines/solver/solver.cpp30
-rw-r--r--kmines/solver/solver.h6
-rw-r--r--kmines/solver/test.cpp2
5 files changed, 27 insertions, 27 deletions
diff --git a/kmines/solver/bfield.cpp b/kmines/solver/bfield.cpp
index d6c03643..24f5221f 100644
--- a/kmines/solver/bfield.cpp
+++ b/kmines/solver/bfield.cpp
@@ -58,7 +58,7 @@ void BaseField::reset(uint width, uint height, uint nbMines)
fill(tmp);
}
-bool BaseField::checkField(uint w, uint h, uint nb, const QString &s)
+bool BaseField::checkField(uint w, uint h, uint nb, const TQString &s)
{
if ( s.length()!=w*h ) return false;
uint n = 0;
@@ -69,7 +69,7 @@ bool BaseField::checkField(uint w, uint h, uint nb, const QString &s)
return ( n==nb );
}
-void BaseField::initReplay(const QString &s)
+void BaseField::initReplay(const TQString &s)
{
Q_ASSERT( checkField(width(), height(), _nbMines, s) );
@@ -212,9 +212,9 @@ void BaseField::doMark(const Coord &c)
changeCase(c, Marked);
}
-QCString BaseField::string() const
+TQCString BaseField::string() const
{
- QCString s(size());
+ TQCString s(size());
for (uint i=0; i<size(); i++)
s[i] = (hasMine(coord(i)) ? '1' : '0');
return s;
diff --git a/kmines/solver/bfield.h b/kmines/solver/bfield.h
index 9c91d41c..a4849ced 100644
--- a/kmines/solver/bfield.h
+++ b/kmines/solver/bfield.h
@@ -19,7 +19,7 @@
#ifndef BASE_FIELD_H
#define BASE_FIELD_H
-#include <qcstring.h>
+#include <tqcstring.h>
#include <krandomsequence.h>
#include <kgrid2d.h>
@@ -36,8 +36,8 @@ class BaseField : public KGrid2D::Square<KMines::Case>, public KMines
void reset(uint width, uint height, uint nbMines);
static bool checkField(uint width, uint height, uint nbMines,
- const QString &field);
- void initReplay(const QString &field); // string == "0100011011000101..."
+ const TQString &field);
+ void initReplay(const TQString &field); // string == "0100011011000101..."
// --------------------------
// interface used by the solver
@@ -56,7 +56,7 @@ class BaseField : public KGrid2D::Square<KMines::Case>, public KMines
// -------------------------
uint nbMarked() const { return _nbMarked; }
- QCString string() const;
+ TQCString string() const;
void showAllMines(bool won);
diff --git a/kmines/solver/solver.cpp b/kmines/solver/solver.cpp
index 00807fca..f8607b79 100644
--- a/kmines/solver/solver.cpp
+++ b/kmines/solver/solver.cpp
@@ -23,9 +23,9 @@
#include <algorithm>
#include <assert.h>
-#include <qtimer.h>
-#include <qlayout.h>
-#include <qlabel.h>
+#include <tqtimer.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
#include <kprogress.h>
#include <klocale.h>
@@ -50,8 +50,8 @@ class SolverPrivate
#endif
};
-Solver::Solver(QObject *parent)
- : QObject(parent)
+Solver::Solver(TQObject *parent)
+ : TQObject(parent)
{
d = new SolverPrivate;
@@ -174,7 +174,7 @@ bool Solver::solveStep()
}
if (_inOneStep) return solveStep();
- else QTimer::singleShot(0, this, SLOT(solveStep()));
+ else TQTimer::singleShot(0, this, TQT_SLOT(solveStep()));
return false;
}
@@ -186,24 +186,24 @@ bool Solver::solveOneStep(BaseField &field)
//-----------------------------------------------------------------------------
-SolvingRateDialog::SolvingRateDialog(const BaseField &field, QWidget *parent)
+SolvingRateDialog::SolvingRateDialog(const BaseField &field, TQWidget *parent)
: KDialogBase(Plain, i18n("Compute Solving Rate"), Ok|Close,
Close, parent, "compute_solving_rate", true, true),
_refField(field)
{
- connect(&_solver, SIGNAL(solvingDone(bool)), SLOT(solvingDone(bool)));
+ connect(&_solver, TQT_SIGNAL(solvingDone(bool)), TQT_SLOT(solvingDone(bool)));
KGuiItem item = KStdGuiItem::ok();
item.setText(i18n("Start"));
setButtonOK(item);
- QVBoxLayout *top = new QVBoxLayout(plainPage(), 0, spacingHint());
- QLabel *label = new QLabel(i18n("Width: %1").arg(field.width()),
+ TQVBoxLayout *top = new TQVBoxLayout(plainPage(), 0, spacingHint());
+ TQLabel *label = new TQLabel(i18n("Width: %1").arg(field.width()),
plainPage());
top->addWidget(label);
- label = new QLabel(i18n("Height: %1").arg(field.height()), plainPage());
+ label = new TQLabel(i18n("Height: %1").arg(field.height()), plainPage());
top->addWidget(label);
- label = new QLabel(i18n("Mines: %1 (%2%)").arg(field.nbMines())
+ label = new TQLabel(i18n("Mines: %1 (%2%)").arg(field.nbMines())
.arg( field.nbMines() * 100.0 / field.size()),
plainPage());
top->addWidget(label);
@@ -215,7 +215,7 @@ SolvingRateDialog::SolvingRateDialog(const BaseField &field, QWidget *parent)
_progress->setFormat("%v");
top->addWidget(_progress);
- _label = new QLabel(i18n("Success rate:"), plainPage());
+ _label = new TQLabel(i18n("Success rate:"), plainPage());
top->addWidget(_label);
}
@@ -225,7 +225,7 @@ void SolvingRateDialog::slotOk()
_i = 0;
_success = 0;
_progress->setValue(0);
- QTimer::singleShot(0, this, SLOT(step()));
+ TQTimer::singleShot(0, this, TQT_SLOT(step()));
}
void SolvingRateDialog::step()
@@ -245,5 +245,5 @@ void SolvingRateDialog::solvingDone(bool success)
_label->setText(i18n("Success rate: %1%")
.arg(_success * 100.0 / _i, 0, 'f', 3));
_progress->advance(1);
- QTimer::singleShot(0, this, SLOT(step()));
+ TQTimer::singleShot(0, this, TQT_SLOT(step()));
}
diff --git a/kmines/solver/solver.h b/kmines/solver/solver.h
index f076874e..22d6c591 100644
--- a/kmines/solver/solver.h
+++ b/kmines/solver/solver.h
@@ -33,7 +33,7 @@ class Solver : public QObject
{
Q_OBJECT
public:
- Solver(QObject *parent = 0);
+ Solver(TQObject *parent = 0);
~Solver();
/** A method to advice a point placement */
@@ -63,7 +63,7 @@ class SolvingRateDialog : public KDialogBase
{
Q_OBJECT
public:
- SolvingRateDialog(const BaseField &field, QWidget *parent);
+ SolvingRateDialog(const BaseField &field, TQWidget *parent);
private slots:
void step();
@@ -75,7 +75,7 @@ class SolvingRateDialog : public KDialogBase
BaseField _field;
Solver _solver;
uint _i, _success;
- QLabel *_label;
+ TQLabel *_label;
KProgress *_progress;
static const uint NB_STEPS = 200;
diff --git a/kmines/solver/test.cpp b/kmines/solver/test.cpp
index dd56d7a0..ed42da70 100644
--- a/kmines/solver/test.cpp
+++ b/kmines/solver/test.cpp
@@ -34,7 +34,7 @@ int main(int argc, char *argv[])
for(pmi = pm.begin(); pmi != pm.end(); ++pmi)
pic[pmi->second.second][pmi->second.first] = pmi->first;
- QString s;
+ TQString s;
for(uint i=0;i<H;++i) {
for(uint j=0;j<W;++j)
cout << s.sprintf("%+.02f ", pic[i][j]).latin1();