From 576eb4299a00bc053db35414406f46372a0f70f2 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:42:31 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmines/solver/bfield.cpp | 8 ++++---- kmines/solver/bfield.h | 8 ++++---- kmines/solver/solver.cpp | 30 +++++++++++++++--------------- kmines/solver/solver.h | 6 +++--- kmines/solver/test.cpp | 2 +- 5 files changed, 27 insertions(+), 27 deletions(-) (limited to 'kmines/solver') 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 +#include #include #include @@ -36,8 +36,8 @@ class BaseField : public KGrid2D::Square, 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, 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 #include -#include -#include -#include +#include +#include +#include #include #include @@ -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