From 838baf3f99ec5ab81b063eb5449a3381d860f377 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 11 Jun 2011 04:58:26 +0000 Subject: 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 --- kmines/solver/advFastRules.cpp | 26 +++++++++++++------------- kmines/solver/headerP.h | 2 +- kmines/solver/solver.cpp | 18 +++++++++--------- kmines/solver/solver.h | 8 +++++--- 4 files changed, 28 insertions(+), 26 deletions(-) (limited to 'kmines/solver') diff --git a/kmines/solver/advFastRules.cpp b/kmines/solver/advFastRules.cpp index 79c42bba..56b97b72 100644 --- a/kmines/solver/advFastRules.cpp +++ b/kmines/solver/advFastRules.cpp @@ -159,9 +159,9 @@ void AdviseFast::RuleSet::addGeneral(Coord p){ int AdviseFast::Rule::leaks = 0; #endif -AdviseFast::Rule::Rule(RuleSet *parent) : - _parent(parent), - _facts(parent->facts) +AdviseFast::Rule::Rule(RuleSet *tqparent) : + _parent(tqparent), + _facts(tqparent->facts) { #if defined(DEBUG) && DEBUG >= 2 cout << "Rule::Rule, leaks = " << ++leaks << endl; @@ -177,8 +177,8 @@ AdviseFast::Rule::~Rule() AdviseFast::GeneralRule::GeneralRule( Coord fact, - RuleSet *parent) : - Rule(parent), + RuleSet *tqparent) : + Rule(tqparent), _fact(fact) {} @@ -242,8 +242,8 @@ bool AdviseFast::GeneralRule::apply(CoordSet *) AdviseFast::EmptyRule::EmptyRule( Coord fact, - RuleSet *parent) : - Rule(parent), + RuleSet *tqparent) : + Rule(tqparent), _fact(fact) {} @@ -285,8 +285,8 @@ bool AdviseFast::EmptyRule::apply( AdviseFast::FullRule::FullRule( Coord fact, - RuleSet *parent) : - Rule(parent), + RuleSet *tqparent) : + Rule(tqparent), _fact(fact) {} @@ -336,8 +336,8 @@ bool AdviseFast::FullRule::apply( AdviseFast::InclusionRule::InclusionRule( Coord bigger, Coord smaller, - RuleSet *parent) : - Rule(parent), + RuleSet *tqparent) : + Rule(tqparent), _bigger(bigger), _smaller(smaller) {} @@ -402,8 +402,8 @@ bool AdviseFast::InclusionRule::apply( AdviseFast::IntersectionRule::IntersectionRule( Coord bigger, Coord smaller, - RuleSet *parent) : - Rule(parent), + RuleSet *tqparent) : + Rule(tqparent), _bigger(bigger), _smaller(smaller) {} diff --git a/kmines/solver/headerP.h b/kmines/solver/headerP.h index 984e3113..6cecd458 100644 --- a/kmines/solver/headerP.h +++ b/kmines/solver/headerP.h @@ -107,7 +107,7 @@ namespace AdviseFast { */ class RuleSet; struct Rule { - Rule(RuleSet *parent); + Rule(RuleSet *tqparent); virtual ~Rule(); virtual bool apply(CoordSet *surePoints) = 0; diff --git a/kmines/solver/solver.cpp b/kmines/solver/solver.cpp index f8607b79..36519043 100644 --- a/kmines/solver/solver.cpp +++ b/kmines/solver/solver.cpp @@ -50,8 +50,8 @@ class SolverPrivate #endif }; -Solver::Solver(TQObject *parent) - : TQObject(parent) +Solver::Solver(TQObject *tqparent) + : TQObject(tqparent) { d = new SolverPrivate; @@ -186,9 +186,9 @@ bool Solver::solveOneStep(BaseField &field) //----------------------------------------------------------------------------- -SolvingRateDialog::SolvingRateDialog(const BaseField &field, TQWidget *parent) +SolvingRateDialog::SolvingRateDialog(const BaseField &field, TQWidget *tqparent) : KDialogBase(Plain, i18n("Compute Solving Rate"), Ok|Close, - Close, parent, "compute_solving_rate", true, true), + Close, tqparent, "compute_solving_rate", true, true), _refField(field) { connect(&_solver, TQT_SIGNAL(solvingDone(bool)), TQT_SLOT(solvingDone(bool))); @@ -198,13 +198,13 @@ SolvingRateDialog::SolvingRateDialog(const BaseField &field, TQWidget *parent) setButtonOK(item); TQVBoxLayout *top = new TQVBoxLayout(plainPage(), 0, spacingHint()); - TQLabel *label = new TQLabel(i18n("Width: %1").arg(field.width()), + TQLabel *label = new TQLabel(i18n("Width: %1").tqarg(field.width()), plainPage()); top->addWidget(label); - label = new TQLabel(i18n("Height: %1").arg(field.height()), plainPage()); + label = new TQLabel(i18n("Height: %1").tqarg(field.height()), plainPage()); top->addWidget(label); - label = new TQLabel(i18n("Mines: %1 (%2%)").arg(field.nbMines()) - .arg( field.nbMines() * 100.0 / field.size()), + label = new TQLabel(i18n("Mines: %1 (%2%)").tqarg(field.nbMines()) + .tqarg( field.nbMines() * 100.0 / field.size()), plainPage()); top->addWidget(label); @@ -243,7 +243,7 @@ void SolvingRateDialog::solvingDone(bool success) { if (success) _success++; _label->setText(i18n("Success rate: %1%") - .arg(_success * 100.0 / _i, 0, 'f', 3)); + .tqarg(_success * 100.0 / _i, 0, 'f', 3)); _progress->advance(1); TQTimer::singleShot(0, this, TQT_SLOT(step())); } diff --git a/kmines/solver/solver.h b/kmines/solver/solver.h index c90c56d1..07b8881a 100644 --- a/kmines/solver/solver.h +++ b/kmines/solver/solver.h @@ -29,11 +29,12 @@ class TQLabel; class KProgress; class SolverPrivate; -class Solver : public QObject +class Solver : public TQObject { Q_OBJECT + TQ_OBJECT public: - Solver(TQObject *parent = 0); + Solver(TQObject *tqparent = 0); ~Solver(); /** A method to advice a point placement */ @@ -62,8 +63,9 @@ class Solver : public QObject class SolvingRateDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - SolvingRateDialog(const BaseField &field, TQWidget *parent); + SolvingRateDialog(const BaseField &field, TQWidget *tqparent); private slots: void step(); -- cgit v1.2.1