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 --- kolf/ball.cpp | 18 +- kolf/canvasitem.h | 4 +- kolf/config.cpp | 16 +- kolf/config.h | 11 +- kolf/editor.cpp | 18 +- kolf/editor.h | 5 +- kolf/floater.cpp | 20 +- kolf/floater.h | 7 +- kolf/game.cpp | 400 ++++++++++++++++++------------------- kolf/game.h | 49 +++-- kolf/kcomboboxdialog.cpp | 22 +- kolf/kcomboboxdialog.h | 19 +- kolf/kolf.cpp | 154 +++++++------- kolf/kolf.h | 3 +- kolf/kvolumecontrol.cpp | 12 +- kolf/kvolumecontrol.h | 7 +- kolf/main.cpp | 8 +- kolf/newgame.cpp | 64 +++--- kolf/newgame.h | 10 +- kolf/object.h | 5 +- kolf/objects/poolball/poolball.cpp | 18 +- kolf/objects/poolball/poolball.h | 7 +- kolf/objects/test/test.cpp | 30 +-- kolf/objects/test/test.h | 7 +- kolf/printdialogpage.cpp | 8 +- kolf/printdialogpage.h | 3 +- kolf/scoreboard.cpp | 6 +- kolf/scoreboard.h | 5 +- kolf/slope.cpp | 32 +-- kolf/slope.h | 5 +- kolf/tutorial.kolf | 2 +- 31 files changed, 500 insertions(+), 475 deletions(-) (limited to 'kolf') diff --git a/kolf/ball.cpp b/kolf/ball.cpp index 9ac849bc..569a5ba2 100644 --- a/kolf/ball.cpp +++ b/kolf/ball.cpp @@ -33,7 +33,7 @@ Ball::Ball(TQCanvas *canvas) //font.setPixelSize(10); label = new TQCanvasText("", font, canvas); label->setColor(white); - label->setVisible(false); + label->tqsetVisible(false); // this sets z setState(Stopped); @@ -249,7 +249,7 @@ void Ball::collisionDetect(double oldx, double oldy) m_collisionLock = true; // move this ball to where it was barely touching double ballAngle = m_vector.direction(); - while (collisions(true).contains(item) > 0) + while (collisions(true).tqcontains(item) > 0) move(x() - cos(ballAngle) / 2.0, y() + sin(ballAngle) / 2.0); // make a 2 pixel separation @@ -308,10 +308,10 @@ void Ball::collisionDetect(double oldx, double oldy) for (iterpoint = points.first(); iterpoint; iterpoint = points.next()) { //kdDebug(12007) << "-----\n"; - const Wall *parentWall = iterpoint->parentWall(); - const TQPoint qp(iterpoint->x() + parentWall->x(), iterpoint->y() + parentWall->y()); + const Wall *tqparentWall = iterpoint->tqparentWall(); + const TQPoint qp(iterpoint->x() + tqparentWall->x(), iterpoint->y() + tqparentWall->y()); const Point p(qp.x(), qp.y()); - const TQPoint qother = TQPoint(parentWall->startPoint() == qp? parentWall->endPoint() : parentWall->startPoint()) + TQPoint(parentWall->x(), parentWall->y()); + const TQPoint qother = TQPoint(tqparentWall->startPoint() == qp? tqparentWall->endPoint() : tqparentWall->startPoint()) + TQPoint(tqparentWall->x(), tqparentWall->y()); const Point other(qother.x(), qother.y()); // vector of wall @@ -438,12 +438,12 @@ BallState Ball::currentState() void Ball::showInfo() { - label->setVisible(isVisible()); + label->tqsetVisible(isVisible()); } void Ball::hideInfo() { - label->setVisible(false); + label->tqsetVisible(false); } void Ball::setName(const TQString &name) @@ -459,8 +459,8 @@ void Ball::setCanvas(TQCanvas *c) void Ball::setVisible(bool yes) { - TQCanvasEllipse::setVisible(yes); + TQCanvasEllipse::tqsetVisible(yes); - label->setVisible(yes && game && game->isInfoShowing()); + label->tqsetVisible(yes && game && game->isInfoShowing()); } diff --git a/kolf/canvasitem.h b/kolf/canvasitem.h index ed897d27..277fb15d 100644 --- a/kolf/canvasitem.h +++ b/kolf/canvasitem.h @@ -113,7 +113,7 @@ public: */ virtual void clean() {}; /** - * scale factor changed (game->scaleFactor(), the world matrix is game->worldMatrix()) + * scale factor changed (game->scaleFactor(), the world matrix is game->tqworldMatrix()) * NOTE: not used in Kolf 1.1, which comes with KDE 3.1. */ virtual void scaleChanged() {}; @@ -125,7 +125,7 @@ public: * returns a Config that can be used to configure this item by the user. * The default implementation returns one that says 'No configuration options'. */ - virtual Config *config(TQWidget *parent) { return new DefaultConfig(parent); } + virtual Config *config(TQWidget *tqparent) { return new DefaultConfig(tqparent); } /** * returns other items that should be moveable (besides this one of course). */ diff --git a/kolf/config.cpp b/kolf/config.cpp index 7c333755..54618a45 100644 --- a/kolf/config.cpp +++ b/kolf/config.cpp @@ -6,8 +6,8 @@ #include "config.h" -Config::Config(TQWidget *parent, const char *name) - : TQFrame(parent, name) +Config::Config(TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name) { startedUp = false; } @@ -33,15 +33,15 @@ void Config::changed() emit modified(); } -MessageConfig::MessageConfig(TQString text, TQWidget *parent, const char *name) - : Config(parent, name) +MessageConfig::MessageConfig(TQString text, TQWidget *tqparent, const char *name) + : Config(tqparent, name) { - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); - layout->addWidget(new TQLabel(text, this)); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); + tqlayout->addWidget(new TQLabel(text, this)); } -DefaultConfig::DefaultConfig(TQWidget *parent, const char *name) - : MessageConfig(i18n("No configuration options"), parent, name) +DefaultConfig::DefaultConfig(TQWidget *tqparent, const char *name) + : MessageConfig(i18n("No configuration options"), tqparent, name) { } diff --git a/kolf/config.h b/kolf/config.h index 4e0f26a6..5ca9892f 100644 --- a/kolf/config.h +++ b/kolf/config.h @@ -3,12 +3,13 @@ #include -class Config : public QFrame +class Config : public TQFrame { Q_OBJECT + TQ_OBJECT public: - Config(TQWidget *parent, const char *name = 0); + Config(TQWidget *tqparent, const char *name = 0); void ctorDone(); signals: @@ -25,18 +26,20 @@ protected: class MessageConfig : public Config { Q_OBJECT + TQ_OBJECT public: - MessageConfig(TQString text, TQWidget *parent, const char *name = 0); + MessageConfig(TQString text, TQWidget *tqparent, const char *name = 0); }; // internal class DefaultConfig : public MessageConfig { Q_OBJECT + TQ_OBJECT public: - DefaultConfig(TQWidget *parent, const char *name = 0); + DefaultConfig(TQWidget *tqparent, const char *name = 0); }; #endif diff --git a/kolf/editor.cpp b/kolf/editor.cpp index ae9cde32..88e3c375 100644 --- a/kolf/editor.cpp +++ b/kolf/editor.cpp @@ -9,19 +9,19 @@ #include "editor.h" #include "game.h" -Editor::Editor(ObjectList *list, TQWidget *parent, const char *name) - : TQWidget(parent, name) +Editor::Editor(ObjectList *list, TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name) { this->list = list; config = 0; - hlayout = new TQHBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + htqlayout = new TQHBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - TQVBoxLayout *vlayout = new TQVBoxLayout(hlayout, KDialog::spacingHint()); - vlayout->addWidget(new TQLabel(i18n("Add object:"), this)); + TQVBoxLayout *vtqlayout = new TQVBoxLayout(htqlayout, KDialog::spacingHint()); + vtqlayout->addWidget(new TQLabel(i18n("Add object:"), this)); listbox = new KListBox(this, "Listbox"); - vlayout->addWidget(listbox); - hlayout->setStretchFactor(vlayout, 2); + vtqlayout->addWidget(listbox); + htqlayout->setStretchFactor(vtqlayout, 2); TQStringList items; Object *obj = 0; @@ -49,8 +49,8 @@ void Editor::setItem(CanvasItem *item) if (!config) return; config->ctorDone(); - hlayout->addWidget(config); - hlayout->setStretchFactor(config, 2); + htqlayout->addWidget(config); + htqlayout->setStretchFactor(config, 2); config->setFrameStyle(TQFrame::Box | TQFrame::Raised); config->setLineWidth(1); config->show(); diff --git a/kolf/editor.h b/kolf/editor.h index 1280772f..8ee1b93a 100644 --- a/kolf/editor.h +++ b/kolf/editor.h @@ -10,9 +10,10 @@ class TQHBoxLayout; class TQListBoxItem; class Config; -class Editor : public QWidget +class Editor : public TQWidget { Q_OBJECT + TQ_OBJECT public: Editor(ObjectList *list, TQWidget * = 0, const char * = 0); @@ -29,7 +30,7 @@ private slots: private: ObjectList *list; - TQHBoxLayout *hlayout; + TQHBoxLayout *htqlayout; KListBox *listbox; Config *config; }; diff --git a/kolf/floater.cpp b/kolf/floater.cpp index ff42398a..1d33a2ca 100644 --- a/kolf/floater.cpp +++ b/kolf/floater.cpp @@ -39,9 +39,9 @@ void FloaterGuide::setPoints(int xa, int ya, int xb, int yb) } } -Config *FloaterGuide::config(TQWidget *parent) +Config *FloaterGuide::config(TQWidget *tqparent) { - return floater->config(parent); + return floater->config(tqparent); } ///////////////////////// @@ -253,18 +253,18 @@ void Floater::firstMove(int x, int y) ///////////////////////// -FloaterConfig::FloaterConfig(Floater *floater, TQWidget *parent) - : BridgeConfig(floater, parent) +FloaterConfig::FloaterConfig(Floater *floater, TQWidget *tqparent) + : BridgeConfig(floater, tqparent) { this->floater = floater; - m_vlayout->addStretch(); + m_vtqlayout->addStretch(); - m_vlayout->addWidget(new TQLabel(i18n("Moving speed"), this)); - TQHBoxLayout *hlayout = new TQHBoxLayout(m_vlayout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Slow"), this)); + m_vtqlayout->addWidget(new TQLabel(i18n("Moving speed"), this)); + TQHBoxLayout *htqlayout = new TQHBoxLayout(m_vtqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Slow"), this)); TQSlider *slider = new TQSlider(0, 20, 2, floater->curSpeed(), Qt::Horizontal, this); - hlayout->addWidget(slider); - hlayout->addWidget(new TQLabel(i18n("Fast"), this)); + htqlayout->addWidget(slider); + htqlayout->addWidget(new TQLabel(i18n("Fast"), this)); connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(speedChanged(int))); } diff --git a/kolf/floater.h b/kolf/floater.h index c22a8084..fbbe10ec 100644 --- a/kolf/floater.h +++ b/kolf/floater.h @@ -7,9 +7,10 @@ class Floater; class FloaterConfig : public BridgeConfig { Q_OBJECT + TQ_OBJECT public: - FloaterConfig(Floater *floater, TQWidget *parent); + FloaterConfig(Floater *floater, TQWidget *tqparent); private slots: void speedChanged(int news); @@ -24,7 +25,7 @@ public: FloaterGuide(Floater *floater, TQCanvas *canvas) : Wall(canvas) { this->floater = floater; almostDead = false; } virtual void setPoints(int xa, int ya, int xb, int yb); virtual void moveBy(double dx, double dy); - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); virtual void aboutToDelete(); virtual void aboutToDie(); @@ -51,7 +52,7 @@ public: virtual void editModeChanged(bool changed); virtual bool moveable() const { return false; } virtual void moveBy(double dx, double dy); - virtual Config *config(TQWidget *parent) { return new FloaterConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new FloaterConfig(this, tqparent); } virtual TQPtrList moveableItems() const; virtual void advance(int phase); void setSpeed(int news); diff --git a/kolf/game.cpp b/kolf/game.cpp index d76ec2bc..1a7bfe4d 100644 --- a/kolf/game.cpp +++ b/kolf/game.cpp @@ -58,12 +58,12 @@ inline TQString makeGroup(int id, int hole, TQString name, int x, int y) { - return TQString("%1-%2@%3,%4|%5").arg(hole).arg(name).arg(x).arg(y).arg(id); + return TQString("%1-%2@%3,%4|%5").tqarg(hole).tqarg(name).tqarg(x).tqarg(y).tqarg(id); } inline TQString makeStateGroup(int id, const TQString &name) { - return TQString("%1|%2").arg(name).arg(id); + return TQString("%1|%2").tqarg(name).tqarg(id); } ///////////////////////// @@ -101,13 +101,13 @@ void RectPoint::moveBy(double dx, double dy) rect->newSize(nw, nh); } -Config *RectPoint::config(TQWidget *parent) +Config *RectPoint::config(TQWidget *tqparent) { CanvasItem *citem = dynamic_cast(rect); if (citem) - return citem->config(parent); + return citem->config(tqparent); else - return CanvasItem::config(parent); + return CanvasItem::config(tqparent); } ///////////////////////// @@ -144,9 +144,9 @@ void Arrow::setZ(double newz) void Arrow::setVisible(bool yes) { - TQCanvasLine::setVisible(yes); - line1->setVisible(yes); - line2->setVisible(yes); + TQCanvasLine::tqsetVisible(yes); + line1->tqsetVisible(yes); + line2->tqsetVisible(yes); } void Arrow::moveBy(double dx, double dy) @@ -192,28 +192,28 @@ void Arrow::updateSelf() ///////////////////////// -BridgeConfig::BridgeConfig(Bridge *bridge, TQWidget *parent) - : Config(parent) +BridgeConfig::BridgeConfig(Bridge *bridge, TQWidget *tqparent) + : Config(tqparent) { this->bridge = bridge; - m_vlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); - TQGridLayout *layout = new TQGridLayout(m_vlayout, 2, 3, spacingHint()); - layout->addWidget(new TQLabel(i18n("Walls on:"), this), 0, 0); + m_vtqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); + TQGridLayout *tqlayout = new TQGridLayout(m_vtqlayout, 2, 3, spacingHint()); + tqlayout->addWidget(new TQLabel(i18n("Walls on:"), this), 0, 0); top = new TQCheckBox(i18n("&Top"), this); - layout->addWidget(top, 0, 1); + tqlayout->addWidget(top, 0, 1); connect(top, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(topWallChanged(bool))); top->setChecked(bridge->topWallVisible()); bot = new TQCheckBox(i18n("&Bottom"), this); - layout->addWidget(bot, 1, 1); + tqlayout->addWidget(bot, 1, 1); connect(bot, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(botWallChanged(bool))); bot->setChecked(bridge->botWallVisible()); left = new TQCheckBox(i18n("&Left"), this); - layout->addWidget(left, 1, 0); + tqlayout->addWidget(left, 1, 0); connect(left, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(leftWallChanged(bool))); left->setChecked(bridge->leftWallVisible()); right = new TQCheckBox(i18n("&Right"), this); - layout->addWidget(right, 1, 2); + tqlayout->addWidget(right, 1, 2); connect(right, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(rightWallChanged(bool))); right->setChecked(bridge->rightWallVisible()); } @@ -249,7 +249,7 @@ Bridge::Bridge(TQRect rect, TQCanvas *canvas) { TQColor color("#92772D"); setBrush(TQBrush(color)); - setPen(NoPen); + setPen(Qt::NoPen); setZ(998); topWall = new Wall(canvas); @@ -264,10 +264,10 @@ Bridge::Bridge(TQRect rect, TQCanvas *canvas) setWallZ(z() + 0.01); setWallColor(color); - topWall->setVisible(false); - botWall->setVisible(false); - leftWall->setVisible(false); - rightWall->setVisible(false); + topWall->tqsetVisible(false); + botWall->tqsetVisible(false); + leftWall->tqsetVisible(false); + rightWall->tqsetVisible(false); point = new RectPoint(color, this, canvas); editModeChanged(false); @@ -321,7 +321,7 @@ void Bridge::aboutToDie() void Bridge::editModeChanged(bool changed) { - point->setVisible(changed); + point->tqsetVisible(changed); moveBy(0, 0); } @@ -401,22 +401,22 @@ void Bridge::setSize(int width, int height) ///////////////////////// -WindmillConfig::WindmillConfig(Windmill *windmill, TQWidget *parent) - : BridgeConfig(windmill, parent) +WindmillConfig::WindmillConfig(Windmill *windmill, TQWidget *tqparent) + : BridgeConfig(windmill, tqparent) { this->windmill = windmill; - m_vlayout->addStretch(); + m_vtqlayout->addStretch(); TQCheckBox *check = new TQCheckBox(i18n("Windmill on bottom"), this); check->setChecked(windmill->bottom()); connect(check, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(endChanged(bool))); - m_vlayout->addWidget(check); + m_vtqlayout->addWidget(check); - TQHBoxLayout *hlayout = new TQHBoxLayout(m_vlayout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Slow"), this)); + TQHBoxLayout *htqlayout = new TQHBoxLayout(m_vtqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Slow"), this)); TQSlider *slider = new TQSlider(1, 10, 1, windmill->curSpeed(), Qt::Horizontal, this); - hlayout->addWidget(slider); - hlayout->addWidget(new TQLabel(i18n("Fast"), this)); + htqlayout->addWidget(slider); + htqlayout->addWidget(new TQLabel(i18n("Fast"), this)); connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(speedChanged(int))); endChanged(check->isChecked()); @@ -454,7 +454,7 @@ Windmill::Windmill(TQRect rect, TQCanvas *canvas) { guard = new WindmillGuard(canvas); guard->setPen(TQPen(black, 5)); - guard->setVisible(true); + guard->tqsetVisible(true); guard->setAlwaysShow(true); setSpeed(5); guard->setZ(wallZ() + .1); @@ -467,8 +467,8 @@ Windmill::Windmill(TQRect rect, TQCanvas *canvas) right->setAlwaysShow(true); left->setZ(wallZ()); right->setZ(wallZ()); - left->setVisible(true); - right->setVisible(true); + left->tqsetVisible(true); + right->tqsetVisible(true); setTopWallVisible(false); setBotWallVisible(false); @@ -629,24 +629,24 @@ void Sign::draw(TQPainter &painter) TQSimpleRichText txt(m_text, kapp->font()); const int indent = wallPen().width() + 3; txt.setWidth(width() - 2*indent); - TQColorGroup colorGroup; - colorGroup.setColor(TQColorGroup::Foreground, black); - colorGroup.setColor(TQColorGroup::Text, black); - colorGroup.setColor(TQColorGroup::Background, black); - colorGroup.setColor(TQColorGroup::Base, black); - txt.draw(&painter, x() + indent, y(), TQRect(x() + indent, y(), width() - indent, height() - indent), colorGroup); + TQColorGroup tqcolorGroup; + tqcolorGroup.setColor(TQColorGroup::Foreground, black); + tqcolorGroup.setColor(TQColorGroup::Text, black); + tqcolorGroup.setColor(TQColorGroup::Background, black); + tqcolorGroup.setColor(TQColorGroup::Base, black); + txt.draw(&painter, x() + indent, y(), TQRect(x() + indent, y(), width() - indent, height() - indent), tqcolorGroup); } ///////////////////////// -SignConfig::SignConfig(Sign *sign, TQWidget *parent) - : BridgeConfig(sign, parent) +SignConfig::SignConfig(Sign *sign, TQWidget *tqparent) + : BridgeConfig(sign, tqparent) { this->sign = sign; - m_vlayout->addStretch(); - m_vlayout->addWidget(new TQLabel(i18n("Sign HTML:"), this)); + m_vtqlayout->addStretch(); + m_vtqlayout->addWidget(new TQLabel(i18n("Sign HTML:"), this)); KLineEdit *name = new KLineEdit(sign->text(), this); - m_vlayout->addWidget(name); + m_vtqlayout->addWidget(name); connect(name, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(textChanged(const TQString &))); } @@ -658,25 +658,25 @@ void SignConfig::textChanged(const TQString &text) ///////////////////////// -EllipseConfig::EllipseConfig(Ellipse *ellipse, TQWidget *parent) - : Config(parent), slow1(0), fast1(0), slow2(0), fast2(0), slider1(0), slider2(0) +EllipseConfig::EllipseConfig(Ellipse *ellipse, TQWidget *tqparent) + : Config(tqparent), slow1(0), fast1(0), slow2(0), fast2(0), slider1(0), slider2(0) { this->ellipse = ellipse; - m_vlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); + m_vtqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); TQCheckBox *check = new TQCheckBox(i18n("Enable show/hide"), this); - m_vlayout->addWidget(check); + m_vtqlayout->addWidget(check); connect(check, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(check1Changed(bool))); check->setChecked(ellipse->changeEnabled()); - TQHBoxLayout *hlayout = new TQHBoxLayout(m_vlayout, spacingHint()); + TQHBoxLayout *htqlayout = new TQHBoxLayout(m_vtqlayout, spacingHint()); slow1 = new TQLabel(i18n("Slow"), this); - hlayout->addWidget(slow1); + htqlayout->addWidget(slow1); slider1 = new TQSlider(1, 100, 5, 100 - ellipse->changeEvery(), Qt::Horizontal, this); - hlayout->addWidget(slider1); + htqlayout->addWidget(slider1); fast1 = new TQLabel(i18n("Fast"), this); - hlayout->addWidget(fast1); + htqlayout->addWidget(fast1); connect(slider1, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(value1Changed(int))); @@ -684,7 +684,7 @@ EllipseConfig::EllipseConfig(Ellipse *ellipse, TQWidget *parent) // TODO add slider2 and friends and make it possible for ellipses to grow and contract - m_vlayout->addStretch(); + m_vtqlayout->addStretch(); } void EllipseConfig::value1Changed(int news) @@ -733,7 +733,7 @@ Ellipse::Ellipse(TQCanvas *canvas) setChangeEnabled(false); setChangeEvery(50); count = 0; - setVisible(true); + tqsetVisible(true); point = new RectPoint(black, this, canvas); point->setSizeFactor(2.0); @@ -750,7 +750,7 @@ void Ellipse::setChangeEnabled(bool changeEnabled) setAnimated(m_changeEnabled); if (!m_changeEnabled) - setVisible(true); + tqsetVisible(true); } TQPtrList Ellipse::moveableItems() const @@ -775,7 +775,7 @@ void Ellipse::moveBy(double dx, double dy) void Ellipse::editModeChanged(bool changed) { - point->setVisible(changed); + point->tqsetVisible(changed); moveBy(0, 0); } @@ -788,7 +788,7 @@ void Ellipse::advance(int phase) if (count > (m_changeEvery + 10) * 1.8) count = 0; if (count == 0) - setVisible(!isVisible()); + tqsetVisible(!isVisible()); count++; } @@ -812,14 +812,14 @@ void Ellipse::save(KConfig *cfg) cfg->writeEntry("height", height()); } -Config *Ellipse::config(TQWidget *parent) +Config *Ellipse::config(TQWidget *tqparent) { - return new EllipseConfig(this, parent); + return new EllipseConfig(this, tqparent); } void Ellipse::aboutToSave() { - setVisible(true); + tqsetVisible(true); dontHide = true; } @@ -838,7 +838,7 @@ Puddle::Puddle(TQCanvas *canvas) TQBrush brush; TQPixmap pic; - if (!TQPixmapCache::find("puddle", pic)) + if (!TQPixmapCache::tqfind("puddle", pic)) { pic.load(locate("appdata", "pics/puddle.png")); TQPixmapCache::insert("puddle", pic); @@ -860,7 +860,7 @@ bool Puddle::collision(Ball *ball, long int /*id*/) if (ball->isVisible()) { TQCanvasRectangle i(TQRect(ball->x(), ball->y(), 1, 1), canvas()); - i.setVisible(true); + i.tqsetVisible(true); // is center of ball in? if (i.collidesWith(this)/* && ball->curVector().magnitude() < 4*/) @@ -868,7 +868,7 @@ bool Puddle::collision(Ball *ball, long int /*id*/) playSound("puddle"); ball->setAddStroke(ball->addStroke() + 1); ball->setPlaceOnGround(true); - ball->setVisible(false); + ball->tqsetVisible(false); ball->setState(Stopped); ball->setVelocity(0, 0); if (game && game->curBall() == ball) @@ -891,7 +891,7 @@ Sand::Sand(TQCanvas *canvas) TQBrush brush; TQPixmap pic; - if (!TQPixmapCache::find("sand", pic)) + if (!TQPixmapCache::tqfind("sand", pic)) { pic.load(locate("appdata", "pics/sand.png")); TQPixmapCache::insert("sand", pic); @@ -911,7 +911,7 @@ Sand::Sand(TQCanvas *canvas) bool Sand::collision(Ball *ball, long int /*id*/) { TQCanvasRectangle i(TQRect(ball->x(), ball->y(), 1, 1), canvas()); - i.setVisible(true); + i.tqsetVisible(true); // is center of ball in? if (i.collidesWith(this)/* && ball->curVector().magnitude() < 4*/) @@ -954,12 +954,12 @@ Putter::Putter(TQCanvas *canvas) void Putter::showInfo() { - guideLine->setVisible(isVisible()); + guideLine->tqsetVisible(isVisible()); } void Putter::hideInfo() { - guideLine->setVisible(m_showGuideLine? isVisible() : false); + guideLine->tqsetVisible(m_showGuideLine? isVisible() : false); } void Putter::moveBy(double dx, double dy) @@ -976,8 +976,8 @@ void Putter::setShowGuideLine(bool yes) void Putter::setVisible(bool yes) { - TQCanvasLine::setVisible(yes); - guideLine->setVisible(m_showGuideLine? yes : false); + TQCanvasLine::tqsetVisible(yes); + guideLine->tqsetVisible(m_showGuideLine? yes : false); } void Putter::setOrigin(int _x, int _y) @@ -990,7 +990,7 @@ void Putter::setOrigin(int _x, int _y) void Putter::setAngle(Ball *ball) { - angle = angleMap.contains(ball)? angleMap[ball] : 0; + angle = angleMap.tqcontains(ball)? angleMap[ball] : 0; finishMe(); } @@ -1002,11 +1002,11 @@ void Putter::go(Direction d, Amount amount) { case Forwards: len -= 1; - guideLine->setVisible(false); + guideLine->tqsetVisible(false); break; case Backwards: len += 1; - guideLine->setVisible(false); + guideLine->tqsetVisible(false); break; case D_Left: angle += addition; @@ -1085,7 +1085,7 @@ void Bumper::moveBy(double dx, double dy) void Bumper::editModeChanged(bool changed) { - inside->setVisible(!changed); + inside->tqsetVisible(!changed); } void Bumper::advance(int phase) @@ -1166,7 +1166,7 @@ HoleResult Hole::result(TQPoint p, double s, bool * /*wasCenter*/) return Result_Miss; TQCanvasRectangle i(TQRect(p, TQSize(1, 1)), canvas()); - i.setVisible(true); + i.tqsetVisible(true); // is center of ball in cup? if (i.collidesWith(this)) @@ -1182,7 +1182,7 @@ HoleResult Hole::result(TQPoint p, double s, bool * /*wasCenter*/) Cup::Cup(TQCanvas *canvas) : Hole(TQColor("#808080"), canvas) { - if (!TQPixmapCache::find("cup", pixmap)) + if (!TQPixmapCache::tqfind("cup", pixmap)) { pixmap.load(locate("appdata", "pics/cup.png")); TQPixmapCache::insert("cup", pixmap); @@ -1222,7 +1222,7 @@ BlackHole::BlackHole(TQCanvas *canvas) m_maxSpeed = 5.0; runs = 0; - const TQColor myColor((QRgb)(kapp->random() % 0x01000000)); + const TQColor myColor((TQRgb)(kapp->random() % 0x01000000)); outside = new TQCanvasEllipse(canvas); outside->setZ(z() - .001); @@ -1238,7 +1238,7 @@ BlackHole::BlackHole(TQCanvas *canvas) setSize(width(), width() / .8); const float factor = 1.3; outside->setSize(width() * factor, height() * factor); - outside->setVisible(true); + outside->tqsetVisible(true); moveBy(0, 0); @@ -1249,7 +1249,7 @@ void BlackHole::showInfo() { delete infoLine; infoLine = new TQCanvasLine(canvas()); - infoLine->setVisible(true); + infoLine->tqsetVisible(true); infoLine->setPen(TQPen(exitItem->pen().color(), 2)); infoLine->setZ(10000); infoLine->setPoints(x(), y(), exitItem->x(), exitItem->y()); @@ -1277,7 +1277,7 @@ void BlackHole::updateInfo() { if (infoLine) { - infoLine->setVisible(true); + infoLine->tqsetVisible(true); infoLine->setPoints(x(), y(), exitItem->x(), exitItem->y()); exitItem->showInfo(); } @@ -1338,7 +1338,7 @@ bool BlackHole::place(Ball *ball, bool /*wasCenter*/) ball->setVelocity(0, 0); ball->setState(Stopped); - ball->setVisible(false); + ball->tqsetVisible(false); ball->setForceStillGoing(true); double magnitude = Vector(TQPoint(x(), y()), TQPoint(exitItem->x(), exitItem->y())).magnitude(); @@ -1367,7 +1367,7 @@ void BlackHole::eject(Ball *ball, double speed) ball->setVector(v); ball->setForceStillGoing(false); - ball->setVisible(true); + ball->tqsetVisible(true); ball->setState(Rolling); runs++; @@ -1418,7 +1418,7 @@ void BlackHole::finishMe() } exitItem->setPoints(start.x(), start.y(), end.x(), end.y()); - exitItem->setVisible(true); + exitItem->tqsetVisible(true); } void BlackHole::save(KConfig *cfg) @@ -1439,7 +1439,7 @@ BlackHoleExit::BlackHoleExit(BlackHole *blackHole, TQCanvas *canvas) setZ(blackHole->z()); arrow->setZ(z() - .00001); updateArrowLength(); - arrow->setVisible(false); + arrow->tqsetVisible(false); } void BlackHoleExit::aboutToDie() @@ -1484,49 +1484,49 @@ void BlackHoleExit::editModeChanged(bool editing) void BlackHoleExit::showInfo() { - arrow->setVisible(true); + arrow->tqsetVisible(true); } void BlackHoleExit::hideInfo() { - arrow->setVisible(false); + arrow->tqsetVisible(false); } -Config *BlackHoleExit::config(TQWidget *parent) +Config *BlackHoleExit::config(TQWidget *tqparent) { - return blackHole->config(parent); + return blackHole->config(tqparent); } ///////////////////////// -BlackHoleConfig::BlackHoleConfig(BlackHole *blackHole, TQWidget *parent) - : Config(parent) +BlackHoleConfig::BlackHoleConfig(BlackHole *blackHole, TQWidget *tqparent) + : Config(tqparent) { this->blackHole = blackHole; - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); - layout->addWidget(new TQLabel(i18n("Exiting ball angle:"), this)); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); + tqlayout->addWidget(new TQLabel(i18n("Exiting ball angle:"), this)); TQSpinBox *deg = new TQSpinBox(0, 359, 10, this); deg->setSuffix(TQString(" ") + i18n("degrees")); deg->setValue(blackHole->curExitDeg()); deg->setWrapping(true); - layout->addWidget(deg); + tqlayout->addWidget(deg); connect(deg, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(degChanged(int))); - layout->addStretch(); + tqlayout->addStretch(); - TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Minimum exit speed:"), this)); + TQHBoxLayout *htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Minimum exit speed:"), this)); KDoubleNumInput *min = new KDoubleNumInput(this); min->setRange(0, 8, 1, true); - hlayout->addWidget(min); + htqlayout->addWidget(min); connect(min, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(minChanged(double))); min->setValue(blackHole->minSpeed()); - hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Maximum:"), this)); + htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Maximum:"), this)); KDoubleNumInput *max = new KDoubleNumInput(this); max->setRange(1, 10, 1, true); - hlayout->addWidget(max); + htqlayout->addWidget(max); connect(max, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(maxChanged(double))); max->setValue(blackHole->maxSpeed()); } @@ -1639,7 +1639,7 @@ void WallPoint::updateVisible() void WallPoint::editModeChanged(bool changed) { editing = changed; - setVisible(true); + tqsetVisible(true); if (!editing) updateVisible(); } @@ -1741,8 +1741,8 @@ Wall::Wall(TQCanvas *canvas) startItem = new WallPoint(true, this, canvas); endItem = new WallPoint(false, this, canvas); - startItem->setVisible(true); - endItem->setVisible(true); + startItem->tqsetVisible(true); + endItem->tqsetVisible(true); setPen(TQPen(darkRed, 3)); setPoints(-15, 10, 15, -5); @@ -1777,10 +1777,10 @@ void Wall::setAlwaysShow(bool yes) void Wall::setVisible(bool yes) { - TQCanvasLine::setVisible(yes); + TQCanvasLine::tqsetVisible(yes); - startItem->setVisible(yes); - endItem->setVisible(yes); + startItem->tqsetVisible(yes); + endItem->tqsetVisible(yes); startItem->updateVisible(); endItem->updateVisible(); } @@ -1859,7 +1859,7 @@ TQPointArray Wall::areaPoints() const // it's all squished because I don't want my // line counts to count code I didn't write! - TQPointArray p(4); const int xi = int(x()); const int yi = int(y()); const TQPoint start = startPoint(); const TQPoint end = endPoint(); const int x1 = start.x(); const int x2 = end.x(); const int y1 = start.y(); const int y2 = end.y(); const int dx = QABS(x1-x2); const int dy = QABS(y1-y2); if ( dx > dy ) { p[0] = TQPoint(x1+xi,y1+yi-1); p[1] = TQPoint(x2+xi,y2+yi-1); p[2] = TQPoint(x2+xi,y2+yi+1); p[3] = TQPoint(x1+xi,y1+yi+1); } else { p[0] = TQPoint(x1+xi-1,y1+yi); p[1] = TQPoint(x2+xi-1,y2+yi); p[2] = TQPoint(x2+xi+1,y2+yi); p[3] = TQPoint(x1+xi+1,y1+yi); } return p; + TQPointArray p(4); const int xi = int(x()); const int yi = int(y()); const TQPoint start = startPoint(); const TQPoint end = endPoint(); const int x1 = start.x(); const int x2 = end.x(); const int y1 = start.y(); const int y2 = end.y(); const int dx = TQABS(x1-x2); const int dy = TQABS(y1-y2); if ( dx > dy ) { p[0] = TQPoint(x1+xi,y1+yi-1); p[1] = TQPoint(x2+xi,y2+yi-1); p[2] = TQPoint(x2+xi,y2+yi+1); p[3] = TQPoint(x1+xi,y1+yi+1); } else { p[0] = TQPoint(x1+xi-1,y1+yi); p[1] = TQPoint(x2+xi-1,y2+yi); p[2] = TQPoint(x2+xi+1,y2+yi); p[3] = TQPoint(x1+xi+1,y1+yi); } return p; } void Wall::editModeChanged(bool changed) @@ -1954,47 +1954,47 @@ void Wall::save(KConfig *cfg) ///////////////////////// -HoleConfig::HoleConfig(HoleInfo *holeInfo, TQWidget *parent) - : Config(parent) +HoleConfig::HoleConfig(HoleInfo *holeInfo, TQWidget *tqparent) + : Config(tqparent) { this->holeInfo = holeInfo; - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); - TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Course name: "), this)); + TQHBoxLayout *htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Course name: "), this)); KLineEdit *nameEdit = new KLineEdit(holeInfo->untranslatedName(), this); - hlayout->addWidget(nameEdit); + htqlayout->addWidget(nameEdit); connect(nameEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(nameChanged(const TQString &))); - hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Course author: "), this)); + htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Course author: "), this)); KLineEdit *authorEdit = new KLineEdit(holeInfo->author(), this); - hlayout->addWidget(authorEdit); + htqlayout->addWidget(authorEdit); connect(authorEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(authorChanged(const TQString &))); - layout->addStretch(); + tqlayout->addStretch(); - hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Par:"), this)); + htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Par:"), this)); TQSpinBox *par = new TQSpinBox(1, 15, 1, this); par->setValue(holeInfo->par()); - hlayout->addWidget(par); + htqlayout->addWidget(par); connect(par, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(parChanged(int))); - hlayout->addStretch(); + htqlayout->addStretch(); - hlayout->addWidget(new TQLabel(i18n("Maximum:"), this)); + htqlayout->addWidget(new TQLabel(i18n("Maximum:"), this)); TQSpinBox *maxstrokes = new TQSpinBox(holeInfo->lowestMaxStrokes(), 30, 1, this); TQWhatsThis::add(maxstrokes, i18n("Maximum number of strokes player can take on this hole.")); TQToolTip::add(maxstrokes, i18n("Maximum number of strokes")); maxstrokes->setSpecialValueText(i18n("Unlimited")); maxstrokes->setValue(holeInfo->maxStrokes()); - hlayout->addWidget(maxstrokes); + htqlayout->addWidget(maxstrokes); connect(maxstrokes, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(maxStrokesChanged(int))); TQCheckBox *check = new TQCheckBox(i18n("Show border walls"), this); check->setChecked(holeInfo->borderWalls()); - layout->addWidget(check); + tqlayout->addWidget(check); connect(check, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(borderWallsChanged(bool))); } @@ -2122,7 +2122,7 @@ void StrokeCircle::draw(TQPainter &p) length = al; } - p.setBrush(TQBrush(black, Qt::NoBrush)); + p.setBrush(TQBrush(black, TQt::NoBrush)); p.setPen(TQPen(white, ithickness / 2)); p.drawEllipse(x() + ithickness / 2, y() + ithickness / 2, iwidth - ithickness, iheight - ithickness); p.setPen(TQPen(TQColor((int)(0xff * dvalue) / dmax, 0, 0xff - (int)(0xff * dvalue) / dmax), ithickness)); @@ -2139,8 +2139,8 @@ void StrokeCircle::draw(TQPainter &p) ///////////////////////////////////////// -KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWidget *parent, const char *name ) - : TQCanvasView(parent, name) +KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWidget *tqparent, const char *name ) + : TQCanvasView(tqparent, name) { // for mouse control setMouseTracking(true); @@ -2197,22 +2197,22 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWi margin = 10; - setFocusPolicy(TQWidget::StrongFocus); + setFocusPolicy(TQ_StrongFocus); setFixedSize(width + 2 * margin, height + 2 * margin); setMargins(margin, margin, margin, margin); - course = new TQCanvas(this); + course = new TQCanvas(TQT_TQOBJECT(this)); course->setBackgroundColor(white); course->resize(width, height); TQPixmap pic; - if (!TQPixmapCache::find("grass", pic)) + if (!TQPixmapCache::tqfind("grass", pic)) { pic.load(locate("appdata", "pics/grass.png")); TQPixmapCache::insert("grass", pic); } - course->setBackgroundPixmap(pic); + course->tqsetBackgroundPixmap(pic); setCanvas(course); move(0, 0); @@ -2225,7 +2225,7 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWi highlighter = new TQCanvasRectangle(course); highlighter->setPen(TQPen(yellow, 1)); highlighter->setBrush(TQBrush(NoBrush)); - highlighter->setVisible(false); + highlighter->tqsetVisible(false); highlighter->setZ(10000); // shows some info about hole @@ -2237,14 +2237,14 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWi infoText->move(15, width/2); infoText->setZ(10001); infoText->setFont(font); - infoText->setVisible(false); + infoText->tqsetVisible(false); // create the advanced putting indicator strokeCircle = new StrokeCircle(course); strokeCircle->move(width - 90, height - 90); strokeCircle->setSize(80, 80); strokeCircle->setThickness(8); - strokeCircle->setVisible(false); + strokeCircle->tqsetVisible(false); strokeCircle->setValue(0); strokeCircle->setMaxValue(360); @@ -2252,7 +2252,7 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWi whiteBall = new Ball(course); whiteBall->setGame(this); whiteBall->setColor(white); - whiteBall->setVisible(false); + whiteBall->tqsetVisible(false); whiteBall->setDoDetect(false); int highestLog = 0; @@ -2311,7 +2311,7 @@ void KolfGame::startFirstHole(int hole) { for (; scoreboardHoles < curHole; ++scoreboardHoles) { - cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(scoreboardHoles + 1)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").tqarg(scoreboardHoles + 1)); emit newHole(cfg->readNumEntry("par", 3)); } @@ -2382,7 +2382,7 @@ void KolfGame::addBorderWall(TQPoint start, TQPoint end) { Wall *wall = new Wall(course); wall->setPoints(start.x(), start.y(), end.x(), end.y()); - wall->setVisible(true); + wall->tqsetVisible(true); wall->setGame(this); wall->setZ(998.7); borderWalls.append(wall); @@ -2420,7 +2420,7 @@ void KolfGame::handleMousePressEvent(TQMouseEvent *e) list.pop_front(); moving = false; - highlighter->setVisible(false); + highlighter->tqsetVisible(false); selectedItem = 0; movingItem = 0; @@ -2430,7 +2430,7 @@ void KolfGame::handleMousePressEvent(TQMouseEvent *e) return; } // only items we keep track of - if ((!(items.containsRef(list.first()) || list.first() == whiteBall || extraMoveable.containsRef(list.first())))) + if ((!(items.tqcontainsRef(list.first()) || list.first() == whiteBall || extraMoveable.tqcontainsRef(list.first())))) { emit newSelectedItem(&holeInfo); return; @@ -2446,7 +2446,7 @@ void KolfGame::handleMousePressEvent(TQMouseEvent *e) switch (e->button()) { // select AND move now :) - case LeftButton: + case Qt::LeftButton: { selectedItem = list.first(); movingItem = selectedItem; @@ -2458,7 +2458,7 @@ void KolfGame::handleMousePressEvent(TQMouseEvent *e) setCursor(KCursor::sizeAllCursor()); emit newSelectedItem(citem); - highlighter->setVisible(true); + highlighter->tqsetVisible(true); TQRect rect = selectedItem->boundingRect(); highlighter->move(rect.x() + 1, rect.y() + 1); highlighter->setSize(rect.width(), rect.height()); @@ -2473,9 +2473,9 @@ void KolfGame::handleMousePressEvent(TQMouseEvent *e) { if (m_useMouse) { - if (!inPlay && e->button() == LeftButton) + if (!inPlay && e->button() == Qt::LeftButton) puttPress(); - else if (e->button() == RightButton) + else if (e->button() == Qt::RightButton) toggleShowInfo(); } } @@ -2553,7 +2553,7 @@ void KolfGame::handleMouseMoveEvent(TQMouseEvent *e) highlighter->moveBy(-(double)moveX, -(double)moveY); movingItem->moveBy(-(double)moveX, -(double)moveY); TQRect brect = movingItem->boundingRect(); - emit newStatusText(TQString("%1x%2").arg(brect.x()).arg(brect.y())); + emit newStatusText(TQString("%1x%2").tqarg(brect.x()).tqarg(brect.y())); storedMousePos = mouse; } @@ -2574,7 +2574,7 @@ void KolfGame::handleMouseReleaseEvent(TQMouseEvent *e) if (editing) { - emit newStatusText(TQString::null); + emit newStatusText(TQString()); moving = false; } @@ -2583,9 +2583,9 @@ void KolfGame::handleMouseReleaseEvent(TQMouseEvent *e) if (!editing && m_useMouse) { - if (!inPlay && e->button() == LeftButton) + if (!inPlay && e->button() == Qt::LeftButton) puttRelease(); - else if (e->button() == RightButton) + else if (e->button() == Qt::RightButton) toggleShowInfo(); } @@ -2608,7 +2608,7 @@ void KolfGame::keyPressEvent(TQKeyEvent *e) putting = false; stroking = false; finishStroking = false; - strokeCircle->setVisible(false); + strokeCircle->tqsetVisible(false); putterTimer->stop(); putter->setOrigin((*curPlayer).ball()->x(), (*curPlayer).ball()->y()); break; @@ -2701,7 +2701,7 @@ void KolfGame::puttPress() strokeCircle->move(px + pw / 2 + 10, py + 10); else strokeCircle->move(px + pw / 2 + 10, py - 10 - strokeCircle->height()); - strokeCircle->setVisible(true); + strokeCircle->tqsetVisible(true); } putterTimer->start(putterTimerMsec); } @@ -2741,7 +2741,7 @@ void KolfGame::keyReleaseEvent(TQKeyEvent *e) { lastDelId = citem->curId(); - highlighter->setVisible(false); + highlighter->tqsetVisible(false); items.removeRef(item); citem->hideInfo(); citem->aboutToDelete(); @@ -2785,7 +2785,7 @@ void KolfGame::timeout() // later undo the shot for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) { - if (!course->rect().contains(TQPoint((*it).ball()->x(), (*it).ball()->y()))) + if (!course->rect().tqcontains(TQPoint((*it).ball()->x(), (*it).ball()->y()))) { (*it).ball()->setState(Stopped); @@ -2907,7 +2907,7 @@ void KolfGame::putterTimeout() { // aborted putting = false; - strokeCircle->setVisible(false); + strokeCircle->tqsetVisible(false); } else if (strength > maxStrength || puttReverse) { @@ -2950,7 +2950,7 @@ void KolfGame::putterTimeout() putter->go(Forwards); else { - strokeCircle->setVisible(false); + strokeCircle->tqsetVisible(false); finishStroking = false; putterTimer->stop(); putting = false; @@ -3084,7 +3084,7 @@ void KolfGame::loadStateList() if ((*curPlayer).id() == info.id) ballMoved(); else - player.ball()->setVisible(!info.beginningOfHole); + player.ball()->tqsetVisible(!info.beginningOfHole); player.setScoreForHole(info.score, curHole); player.ball()->setState(info.state); emit scoreChanged(info.id, curHole, info.score); @@ -3136,7 +3136,7 @@ void KolfGame::shotDone() const TQString placeOutside = i18n("Drop Outside of Hazard"); const TQString rehit = i18n("Rehit From Last Location"); options << placeOutside << rehit; - const TQString choice = KComboBoxDialog::getItem(i18n("What would you like to do for your next shot?"), i18n("%1 is in a Hazard").arg((*it).name()), options, placeOutside, "hazardOptions"); + const TQString choice = KComboBoxDialog::getItem(i18n("What would you like to do for your next shot?"), i18n("%1 is in a Hazard").tqarg((*it).name()), options, placeOutside, "hazardOptions"); if (choice == placeOutside) { @@ -3186,7 +3186,7 @@ void KolfGame::shotDone() } } - ball->setVisible(true); + ball->tqsetVisible(true); ball->setState(Stopped); (*it).ball()->setDoDetect(true); @@ -3207,7 +3207,7 @@ void KolfGame::shotDone() if (curStrokes >= holeInfo.maxStrokes() && holeInfo.hasMaxStrokes()) { ball->setState(Holed); - ball->setVisible(false); + ball->tqsetVisible(false); // move to center in case he/she hit out ball->move(width / 2, height / 2); @@ -3236,7 +3236,7 @@ void KolfGame::shotDone() emit newPlayersTurn(&(*curPlayer)); - (*curPlayer).ball()->setVisible(true); + (*curPlayer).ball()->tqsetVisible(true); putter->setAngle((*curPlayer).ball()); putter->setOrigin((*curPlayer).ball()->x(), (*curPlayer).ball()->y()); @@ -3256,7 +3256,7 @@ void KolfGame::startBall(const Vector &vector) playSound("hit"); emit inPlayStart(); - putter->setVisible(false); + putter->tqsetVisible(false); (*curPlayer).ball()->setState(Rolling); (*curPlayer).ball()->setVector(vector); @@ -3303,14 +3303,14 @@ void KolfGame::sayWhosGoing() { if (players->count() >= 2) { - KMessageBox::information(this, i18n("%1 will start off.").arg((*curPlayer).name()), i18n("New Hole"), "newHole"); + KMessageBox::information(this, i18n("%1 will start off.").tqarg((*curPlayer).name()), i18n("New Hole"), "newHole"); } } void KolfGame::holeDone() { for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) - (*it).ball()->setVisible(false); + (*it).ball()->tqsetVisible(false); startNextHole(); sayWhosGoing(); } @@ -3407,7 +3407,7 @@ void KolfGame::startNextHole() if ((int)(*it).scores().count() < curHole) (*it).addHole(); (*it).ball()->setVelocity(0, 0); - (*it).ball()->setVisible(false); + (*it).ball()->tqsetVisible(false); } emit newPlayersTurn(&(*curPlayer)); @@ -3429,7 +3429,7 @@ void KolfGame::startNextHole() for (; scoreboardHoles < curHole; ++scoreboardHoles) { - cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(scoreboardHoles + 1)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").tqarg(scoreboardHoles + 1)); emit newHole(cfg->readNumEntry("par", 3)); } @@ -3437,7 +3437,7 @@ void KolfGame::startNextHole() updateShowInfo(); // this is from shotDone() - (*curPlayer).ball()->setVisible(true); + (*curPlayer).ball()->tqsetVisible(true); putter->setOrigin((*curPlayer).ball()->x(), (*curPlayer).ball()->y()); updateMouse(); @@ -3451,31 +3451,31 @@ void KolfGame::startNextHole() void KolfGame::showInfo() { - TQString text = i18n("Hole %1: par %2, maximum %3 strokes").arg(curHole).arg(holeInfo.par()).arg(holeInfo.maxStrokes()); + TQString text = i18n("Hole %1: par %2, maximum %3 strokes").tqarg(curHole).tqarg(holeInfo.par()).tqarg(holeInfo.maxStrokes()); infoText->move((width - TQFontMetrics(infoText->font()).width(text)) / 2, infoText->y()); infoText->setText(text); // I hate this text! Let's not show it - //infoText->setVisible(true); + //infoText->tqsetVisible(true); emit newStatusText(text); } void KolfGame::showInfoDlg(bool addDontShowAgain) { - KMessageBox::information(parentWidget(), - i18n("Course name: %1").arg(holeInfo.name()) + TQString("\n") - + i18n("Created by %1").arg(holeInfo.author()) + TQString("\n") - + i18n("%1 holes").arg(highestHole), + KMessageBox::information(tqparentWidget(), + i18n("Course name: %1").tqarg(holeInfo.name()) + TQString("\n") + + i18n("Created by %1").tqarg(holeInfo.author()) + TQString("\n") + + i18n("%1 holes").tqarg(highestHole), i18n("Course Information"), - addDontShowAgain? holeInfo.name() + TQString(" ") + holeInfo.author() : TQString::null); + addDontShowAgain? holeInfo.name() + TQString(" ") + holeInfo.author() : TQString()); } void KolfGame::hideInfo() { infoText->setText(""); - infoText->setVisible(false); + infoText->tqsetVisible(false); - emit newStatusText(TQString::null); + emit newStatusText(TQString()); } void KolfGame::openFile() @@ -3514,7 +3514,7 @@ void KolfGame::openFile() holeInfo.setUntranslatedName(cfg->readEntryUntranslated("Name", holeInfo.untranslatedName())); emit titleChanged(holeInfo.name()); - cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(curHole)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").tqarg(curHole)); curPar = cfg->readNumEntry("par", 3); holeInfo.setPar(curPar); holeInfo.borderWallsChanged(cfg->readBoolEntry("borderWalls", holeInfo.borderWalls())); @@ -3533,12 +3533,12 @@ void KolfGame::openFile() cfg->setGroup(*it); const int len = (*it).length(); - const int dashIndex = (*it).find("-"); + const int dashIndex = (*it).tqfind("-"); const int holeNum = (*it).left(dashIndex).toInt(); if (holeNum > _highestHole) _highestHole = holeNum; - const int atIndex = (*it).find("@"); + const int atIndex = (*it).tqfind("@"); const TQString name = (*it).mid(dashIndex + 1, atIndex - (dashIndex + 1)); if (holeNum != curHole) @@ -3552,8 +3552,8 @@ void KolfGame::openFile() numItems++; - const int commaIndex = (*it).find(","); - const int pipeIndex = (*it).find("|"); + const int commaIndex = (*it).tqfind(","); + const int pipeIndex = (*it).tqfind("|"); const int x = (*it).mid(atIndex + 1, commaIndex - (atIndex + 1)).toInt(); const int y = (*it).mid(commaIndex + 1, pipeIndex - (commaIndex + 1)).toInt(); @@ -3593,7 +3593,7 @@ void KolfGame::openFile() newItem->move(x, y); canvasItem->firstMove(x, y); - newItem->setVisible(true); + newItem->tqsetVisible(true); // make things actually show if (!hasFinalLoad) @@ -3610,13 +3610,13 @@ void KolfGame::openFile() break; } - if (!loaded && name != "hole" && missingPlugins.contains(name) <= 0) + if (!loaded && name != "hole" && missingPlugins.tqcontains(name) <= 0) missingPlugins.append(name); } if (!missingPlugins.empty()) { - KMessageBox::informationList(this, TQString("

<http://katzbrown.com/kolf/Plugins/>

") + i18n("This hole uses the following plugins, which you do not have installed:") + TQString("

"), missingPlugins, TQString::null, TQString("%1 warning").arg(holeInfo.untranslatedName() + TQString::number(curHole))); + KMessageBox::informationList(this, TQString("

<http://katzbrown.com/kolf/Plugins/>

") + i18n("This hole uses the following plugins, which you do not have installed:") + TQString("

"), missingPlugins, TQString(), TQString("%1 warning").tqarg(holeInfo.untranslatedName() + TQString::number(curHole))); } lastDelId = -1; @@ -3634,7 +3634,7 @@ void KolfGame::openFile() clearHole(); setModified(false); for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) - (*it).ball()->setVisible(false); + (*it).ball()->tqsetVisible(false); return; } @@ -3719,7 +3719,7 @@ void KolfGame::addNewObject(Object *newObj) { TQCanvasItem *newItem = newObj->newObject(course); items.append(newItem); - newItem->setVisible(true); + newItem->tqsetVisible(true); CanvasItem *canvasItem = dynamic_cast(newItem); if (!canvasItem) @@ -3826,11 +3826,11 @@ void KolfGame::addNewHole() // make sure even the current player isn't showing for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) - (*it).ball()->setVisible(false); + (*it).ball()->tqsetVisible(false); - whiteBall->setVisible(editing); - highlighter->setVisible(false); - putter->setVisible(!editing); + whiteBall->tqsetVisible(editing); + highlighter->tqsetVisible(false); + putter->tqsetVisible(!editing); inPlay = false; // add default objects @@ -3978,7 +3978,7 @@ void KolfGame::save() // wipe out all groups from this hole for (TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it) { - int holeNum = (*it).left((*it).find("-")).toInt(); + int holeNum = (*it).left((*it).tqfind("-")).toInt(); if (holeNum == curHole) cfg->deleteGroup(*it); } @@ -3995,7 +3995,7 @@ void KolfGame::save() } // save where ball starts (whiteBall tells all) - cfg->setGroup(TQString("%1-ball@%2,%3").arg(curHole).arg((int)whiteBall->x()).arg((int)whiteBall->y())); + cfg->setGroup(TQString("%1-ball@%2,%3").tqarg(curHole).tqarg((int)whiteBall->x()).tqarg((int)whiteBall->y())); cfg->writeEntry("dummykey", true); cfg->setGroup("0-course@-50,-50"); @@ -4003,7 +4003,7 @@ void KolfGame::save() cfg->writeEntry("Name", holeInfo.untranslatedName()); // save hole info - cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(curHole)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").tqarg(curHole)); cfg->writeEntry("par", holeInfo.par()); cfg->writeEntry("maxstrokes", holeInfo.maxStrokes()); cfg->writeEntry("borderWalls", holeInfo.borderWalls()); @@ -4066,16 +4066,16 @@ void KolfGame::toggleEditMode() { // curplayer shouldn't be hidden no matter what if ((*it).ball()->beginningOfHole() && it != curPlayer) - (*it).ball()->setVisible(false); + (*it).ball()->tqsetVisible(false); else - (*it).ball()->setVisible(!editing); + (*it).ball()->tqsetVisible(!editing); } - whiteBall->setVisible(editing); - highlighter->setVisible(false); + whiteBall->tqsetVisible(editing); + highlighter->tqsetVisible(false); // shouldn't see putter whilst editing - putter->setVisible(!editing); + putter->tqsetVisible(!editing); if (editing) autoSaveTimer->start(autoSaveMsec); @@ -4103,7 +4103,7 @@ void KolfGame::playSound(TQString file, double vol) } } - file = soundDir + file + TQString::fromLatin1(".wav"); + file = soundDir + file + TQString::tqfromLatin1(".wav"); // not needed when all of the files are in the distribution //if (!TQFile::exists(file)) @@ -4160,7 +4160,7 @@ void KolfGame::print(KPrinter &pr) if (pr.option("kde-kolf-title") == "true") { - TQString text = i18n("%1 - Hole %2; by %3").arg(holeInfo.name()).arg(curHole).arg(holeInfo.author()); + TQString text = i18n("%1 - Hole %2; by %3").tqarg(holeInfo.name()).tqarg(curHole).tqarg(holeInfo.author()); TQFont font(kapp->font()); font.setPointSize(18); TQRect rect = TQFontMetrics(font).boundingRect(text); @@ -4183,7 +4183,7 @@ void KolfGame::setBorderWalls(bool showing) { Wall *wall = 0; for (wall = borderWalls.first(); wall; wall = borderWalls.next()) - wall->setVisible(showing); + wall->tqsetVisible(showing); } void KolfGame::setUseAdvancedPutting(bool yes) @@ -4219,7 +4219,7 @@ void KolfGame::courseInfo(CourseInfo &info, const TQString& filename) unsigned int par= 0; while (1) { - TQString group = TQString("%1-hole@-50,-50|0").arg(hole); + TQString group = TQString("%1-hole@-50,-50|0").tqarg(hole); if (!cfg.hasGroup(group)) { hole--; @@ -4283,7 +4283,7 @@ void KolfGame::saveScores(KConfig *config) { config->setGroup(TQString::number((*it).id())); config->writeEntry("Name", (*it).name()); - config->writeEntry("Color", (*it).ball()->color().name()); + config->writeEntry("Color", TQString((*it).ball()->color().name())); TQStringList scores; TQValueList intscores = (*it).scores(); diff --git a/kolf/game.h b/kolf/game.h index f3dfea35..3bcaaaf5 100644 --- a/kolf/game.h +++ b/kolf/game.h @@ -104,7 +104,7 @@ private: }; typedef TQValueList PlayerList; -class Arrow : public QCanvasLine +class Arrow : public TQCanvasLine { public: Arrow(TQCanvas *canvas); @@ -142,7 +142,7 @@ public: RectPoint(TQColor color, RectItem *, TQCanvas *canvas); void dontMove() { dontmove = true; } virtual void moveBy(double dx, double dy); - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); virtual bool deleteable() const { return false; } virtual bool cornerResize() const { return true; } virtual CanvasItem *itemToDelete() { return dynamic_cast(rect); } @@ -181,7 +181,7 @@ public: virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); protected: RectPoint *point; @@ -195,6 +195,7 @@ private: class EllipseConfig : public Config { Q_OBJECT + TQ_OBJECT public: EllipseConfig(Ellipse *ellipse, TQWidget *); @@ -206,7 +207,7 @@ private slots: void check2Changed(bool on); protected: - TQVBoxLayout *m_vlayout; + TQVBoxLayout *m_vtqlayout; private: TQLabel *slow1; @@ -317,9 +318,10 @@ class BlackHole; class BlackHoleConfig : public Config { Q_OBJECT + TQ_OBJECT public: - BlackHoleConfig(BlackHole *blackHole, TQWidget *parent); + BlackHoleConfig(BlackHole *blackHole, TQWidget *tqparent); private slots: void degChanged(int); @@ -344,15 +346,16 @@ public: virtual void hideInfo(); void updateArrowAngle(); void updateArrowLength(); - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); BlackHole *blackHole; protected: Arrow *arrow; }; -class BlackHoleTimer : public QObject +class BlackHoleTimer : public TQObject { Q_OBJECT + TQ_OBJECT public: BlackHoleTimer(Ball *ball, double speed, int msec); @@ -372,6 +375,7 @@ protected: class BlackHole : public TQObject, public Hole { Q_OBJECT + TQ_OBJECT public: BlackHole(TQCanvas *canvas); @@ -382,7 +386,7 @@ public: virtual bool place(Ball *ball, bool wasCenter); virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); - virtual Config *config(TQWidget *parent) { return new BlackHoleConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new BlackHoleConfig(this, tqparent); } virtual TQPtrList moveableItems() const; double minSpeed() const { return m_minSpeed; } double maxSpeed() const { return m_maxSpeed; } @@ -475,11 +479,11 @@ public: virtual bool collision(Ball *ball, long int id); virtual CanvasItem *itemToDelete() { return wall; } virtual void clean(); - virtual Config *config(TQWidget *parent) { return wall->config(parent); } + virtual Config *config(TQWidget *tqparent) { return wall->config(tqparent); } void dontMove() { dontmove = true; }; void updateVisible(); - Wall *parentWall() { return wall; } + Wall *tqparentWall() { return wall; } protected: Wall *wall; @@ -541,6 +545,7 @@ class Bridge; class BridgeConfig : public Config { Q_OBJECT + TQ_OBJECT public: BridgeConfig(Bridge *bridge, TQWidget *); @@ -552,7 +557,7 @@ protected slots: void rightWallChanged(bool); protected: - TQVBoxLayout *m_vlayout; + TQVBoxLayout *m_vtqlayout; TQCheckBox *top; TQCheckBox *bot; TQCheckBox *left; @@ -576,7 +581,7 @@ public: void doSave(KConfig *cfg); virtual void newSize(int width, int height); virtual void setGame(KolfGame *game); - virtual Config *config(TQWidget *parent) { return new BridgeConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new BridgeConfig(this, tqparent); } void setSize(int width, int height); virtual TQPtrList moveableItems() const; @@ -613,9 +618,10 @@ class Sign; class SignConfig : public BridgeConfig { Q_OBJECT + TQ_OBJECT public: - SignConfig(Sign *sign, TQWidget *parent); + SignConfig(Sign *sign, TQWidget *tqparent); private slots: void textChanged(const TQString &); @@ -631,7 +637,7 @@ public: TQString text() const { return m_text; } virtual void draw(TQPainter &painter); virtual bool vStrut() const { return false; } - virtual Config *config(TQWidget *parent) { return new SignConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new SignConfig(this, tqparent); } virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); @@ -661,9 +667,10 @@ protected: class WindmillConfig : public BridgeConfig { Q_OBJECT + TQ_OBJECT public: - WindmillConfig(Windmill *windmill, TQWidget *parent); + WindmillConfig(Windmill *windmill, TQWidget *tqparent); private slots: void speedChanged(int news); @@ -681,7 +688,7 @@ public: virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); virtual void setGame(KolfGame *game); - virtual Config *config(TQWidget *parent) { return new WindmillConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new WindmillConfig(this, tqparent); } void setSize(int width, int height); virtual void moveBy(double dx, double dy); void setSpeed(int news); @@ -708,6 +715,7 @@ class HoleInfo; class HoleConfig : public Config { Q_OBJECT + TQ_OBJECT public: HoleConfig(HoleInfo *holeInfo, TQWidget *); @@ -741,7 +749,7 @@ public: TQString name() const { return m_name; } TQString untranslatedName() const { return m_untranslatedName; } - virtual Config *config(TQWidget *parent) { return new HoleConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new HoleConfig(this, tqparent); } void borderWallsChanged(bool yes); bool borderWalls() const { return m_borderWalls; } @@ -755,7 +763,7 @@ private: int m_lowestMaxStrokes; }; -class StrokeCircle : public QCanvasItem +class StrokeCircle : public TQCanvasItem { public: StrokeCircle(TQCanvas *canvas); @@ -790,12 +798,13 @@ struct KDE_EXPORT CourseInfo unsigned int par; }; -class KDE_EXPORT KolfGame : public QCanvasView +class KDE_EXPORT KolfGame : public TQCanvasView { Q_OBJECT + TQ_OBJECT public: - KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWidget *parent=0, const char *name=0 ); + KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWidget *tqparent=0, const char *name=0 ); ~KolfGame(); void setObjects(ObjectList *obj) { this->obj = obj; } void setFilename(const TQString &filename); diff --git a/kolf/kcomboboxdialog.cpp b/kolf/kcomboboxdialog.cpp index 1e18e0b2..133edb01 100644 --- a/kolf/kcomboboxdialog.cpp +++ b/kolf/kcomboboxdialog.cpp @@ -34,8 +34,8 @@ #include "kcomboboxdialog.h" -KComboBoxDialog::KComboBoxDialog( const TQString &_text, const TQStringList &_items, const TQString& _value, bool showDontAskAgain, TQWidget *parent ) - : KDialogBase( Plain, TQString::null, Ok, Ok, parent, 0L, true, true ) +KComboBoxDialog::KComboBoxDialog( const TQString &_text, const TQStringList &_items, const TQString& _value, bool showDontAskAgain, TQWidget *tqparent ) + : KDialogBase( Plain, TQString(), Ok, Ok, tqparent, 0L, true, true ) { TQVBoxLayout *topLayout = new TQVBoxLayout( plainPage(), marginHint(), spacingHint() ); TQLabel *label = new TQLabel(_text, plainPage() ); @@ -76,12 +76,12 @@ bool KComboBoxDialog::dontAskAgainChecked() return false; } -TQString KComboBoxDialog::getItem( const TQString &_text, const TQStringList &_items, const TQString& _value, const TQString &dontAskAgainName, TQWidget *parent ) +TQString KComboBoxDialog::getItem( const TQString &_text, const TQStringList &_items, const TQString& _value, const TQString &dontAskAgainName, TQWidget *tqparent ) { - return getItem( _text, TQString::null, _items, _value, dontAskAgainName, parent ); + return getItem( _text, TQString(), _items, _value, dontAskAgainName, tqparent ); } -TQString KComboBoxDialog::getItem( const TQString &_text, const TQString &_caption, const TQStringList &_items, const TQString& _value, const TQString &dontAskAgainName, TQWidget *parent ) +TQString KComboBoxDialog::getItem( const TQString &_text, const TQString &_caption, const TQStringList &_items, const TQString& _value, const TQString &dontAskAgainName, TQWidget *tqparent ) { TQString prevAnswer; if ( !dontAskAgainName.isEmpty() ) @@ -90,11 +90,11 @@ TQString KComboBoxDialog::getItem( const TQString &_text, const TQString &_capti config->setGroup( "Notification Messages" ); prevAnswer = config->readEntry( dontAskAgainName ); if ( !prevAnswer.isEmpty() ) - if ( _items.contains( prevAnswer ) > 0 ) + if ( _items.tqcontains( prevAnswer ) > 0 ) return prevAnswer; } - KComboBoxDialog dlg( _text, _items, _value, !dontAskAgainName.isNull(), parent ); + KComboBoxDialog dlg( _text, _items, _value, !dontAskAgainName.isNull(), tqparent ); if ( !_caption.isNull() ) dlg.setCaption( _caption ); @@ -115,17 +115,17 @@ TQString KComboBoxDialog::getItem( const TQString &_text, const TQString &_capti return text; } -TQString KComboBoxDialog::getText(const TQString &_caption, const TQString &_text, const TQString &_value, bool *ok, TQWidget *parent, const TQString &configName, KConfig *config) +TQString KComboBoxDialog::getText(const TQString &_caption, const TQString &_text, const TQString &_value, bool *ok, TQWidget *tqparent, const TQString &configName, KConfig *config) { - KComboBoxDialog dlg(_text, TQStringList(), _value, false, parent); + KComboBoxDialog dlg(_text, TQStringList(), _value, false, tqparent); if ( !_caption.isNull() ) dlg.setCaption( _caption ); KHistoryCombo * const box = dlg.comboBox(); box->setEditable(true); - const TQString historyItem = TQString("%1History").arg(configName); - const TQString completionItem = TQString("%1Completion").arg(configName); + const TQString historyItem = TQString("%1History").tqarg(configName); + const TQString completionItem = TQString("%1Completion").tqarg(configName); if(!configName.isNull()) { diff --git a/kolf/kcomboboxdialog.h b/kolf/kcomboboxdialog.h index 28f3721f..91097f16 100644 --- a/kolf/kcomboboxdialog.h +++ b/kolf/kcomboboxdialog.h @@ -40,6 +40,7 @@ class KHistoryCombo; class KComboBoxDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: /** @@ -51,7 +52,7 @@ public: * @param _text Text of the label * @param _value Initial value of the combobox */ - KComboBoxDialog( const TQString &_text, const TQStringList& _items, const TQString& _value = TQString::null, bool showDontAskAgain = false, TQWidget *parent = 0 ); + KComboBoxDialog( const TQString &_text, const TQStringList& _items, const TQString& _value = TQString(), bool showDontAskAgain = false, TQWidget *tqparent = 0 ); virtual ~KComboBoxDialog(); /** @@ -70,9 +71,9 @@ public: * @param _text Text of the label * @param _items Items in the combobox * @param _value Initial value of the inputline - * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use TQString::null to disable + * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use TQString() to disable */ - static TQString getItem( const TQString &_text, const TQStringList &_items, const TQString& _value = TQString::null, const TQString &dontAskAgainName = TQString::null, TQWidget *parent = 0 ); + static TQString getItem( const TQString &_text, const TQStringList &_items, const TQString& _value = TQString(), const TQString &dontAskAgainName = TQString(), TQWidget *tqparent = 0 ); /** * Static convenience function to get input from the user. @@ -82,9 +83,9 @@ public: * @param _text Text of the label * @param _items Items in the combobox * @param _value Initial value of the inputline - * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use TQString::null to disable + * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use TQString() to disable */ - static TQString getItem( const TQString &_text, const TQString &_caption, const TQStringList &_items, const TQString& _value = TQString::null, const TQString &dontAskAgainName = TQString::null, TQWidget *parent = 0 ); + static TQString getItem( const TQString &_text, const TQString &_caption, const TQStringList &_items, const TQString& _value = TQString(), const TQString &dontAskAgainName = TQString(), TQWidget *tqparent = 0 ); /** * Static convenience method. @@ -95,14 +96,14 @@ public: * @param _text Text of the label * @param _value Initial value of the inputline * @param ok Variable to store whether the user hit OK - * @param parent Parent widget for the dialog + * @param tqparent Parent widget for the dialog * @param configName Name of the dialog for saving the completion and history * @parma config KConfig for saving the completion and history */ static TQString getText(const TQString &_caption, const TQString &_text, - const TQString &_value = TQString::null, - bool *ok = 0, TQWidget *parent = 0, - const TQString &configName = TQString::null, + const TQString &_value = TQString(), + bool *ok = 0, TQWidget *tqparent = 0, + const TQString &configName = TQString(), KConfig *config = KGlobal::config()); protected: diff --git a/kolf/kolf.cpp b/kolf/kolf.cpp index 696ddc72..5ad194a6 100644 --- a/kolf/kolf.cpp +++ b/kolf/kolf.cpp @@ -62,10 +62,10 @@ Kolf::Kolf() obj = new ObjectList; initPlugins(); - filename = TQString::null; + filename = TQString(); dummy = new TQWidget(this); setCentralWidget(dummy); - layout = new TQGridLayout(dummy, 3, 1); + tqlayout = new TQGridLayout(dummy, 3, 1); resize(420, 480); } @@ -79,75 +79,75 @@ Kolf::~Kolf() void Kolf::initGUI() { - newAction = KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection()); + newAction = KStdGameAction::gameNew(TQT_TQOBJECT(this), TQT_SLOT(newGame()), actionCollection()); newAction->setText(newAction->text() + TQString("...")); - endAction = KStdGameAction::end(this, TQT_SLOT(closeGame()), actionCollection()); - printAction = KStdGameAction::print(this, TQT_SLOT(print()), actionCollection()); + endAction = KStdGameAction::end(TQT_TQOBJECT(this), TQT_SLOT(closeGame()), actionCollection()); + printAction = KStdGameAction::print(TQT_TQOBJECT(this), TQT_SLOT(print()), actionCollection()); - (void) KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); - saveAction = KStdAction::save(this, TQT_SLOT(save()), actionCollection(), "game_save"); + (void) KStdGameAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + saveAction = KStdAction::save(TQT_TQOBJECT(this), TQT_SLOT(save()), actionCollection(), "game_save"); saveAction->setText(i18n("Save &Course")); - saveAsAction = KStdAction::saveAs(this, TQT_SLOT(saveAs()), actionCollection(), "game_save_as"); + saveAsAction = KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(saveAs()), actionCollection(), "game_save_as"); saveAsAction->setText(i18n("Save &Course As...")); - saveGameAction = new KAction(i18n("&Save Game"), 0, this, TQT_SLOT(saveGame()), actionCollection(), "savegame"); - saveGameAsAction = new KAction(i18n("&Save Game As..."), 0, this, TQT_SLOT(saveGameAs()), actionCollection(), "savegameas"); + saveGameAction = new KAction(i18n("&Save Game"), 0, TQT_TQOBJECT(this), TQT_SLOT(saveGame()), actionCollection(), "savegame"); + saveGameAsAction = new KAction(i18n("&Save Game As..."), 0, TQT_TQOBJECT(this), TQT_SLOT(saveGameAs()), actionCollection(), "savegameas"); - loadGameAction = KStdGameAction::load(this, TQT_SLOT(loadGame()), actionCollection()); + loadGameAction = KStdGameAction::load(TQT_TQOBJECT(this), TQT_SLOT(loadGame()), actionCollection()); loadGameAction->setText(i18n("Load Saved Game...")); - highScoreAction = KStdGameAction::highscores(this, TQT_SLOT(showHighScores()), actionCollection()); + highScoreAction = KStdGameAction::highscores(TQT_TQOBJECT(this), TQT_SLOT(showHighScores()), actionCollection()); - editingAction = new KToggleAction(i18n("&Edit"), "pencil", CTRL+Key_E, this, TQT_SLOT(emptySlot()), actionCollection(), "editing"); - newHoleAction = new KAction(i18n("&New"), "filenew", CTRL+SHIFT+Key_N, this, TQT_SLOT(emptySlot()), actionCollection(), "newhole"); - clearHoleAction = new KAction(KStdGuiItem::clear().text(), "locationbar_erase", CTRL+Key_Delete, this, TQT_SLOT(emptySlot()), actionCollection(), "clearhole"); - resetHoleAction = new KAction(i18n("&Reset"), CTRL+Key_R, this, TQT_SLOT(emptySlot()), actionCollection(), "resethole"); - undoShotAction = KStdAction::undo(this, TQT_SLOT(emptySlot()), actionCollection(), "undoshot"); + editingAction = new KToggleAction(i18n("&Edit"), "pencil", CTRL+Key_E, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "editing"); + newHoleAction = new KAction(i18n("&New"), "filenew", CTRL+SHIFT+Key_N, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "newhole"); + clearHoleAction = new KAction(KStdGuiItem::clear().text(), "locationbar_erase", CTRL+Key_Delete, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "clearhole"); + resetHoleAction = new KAction(i18n("&Reset"), CTRL+Key_R, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "resethole"); + undoShotAction = KStdAction::undo(TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "undoshot"); undoShotAction->setText(i18n("&Undo Shot")); - //replayShotAction = new KAction(i18n("&Replay Shot"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "replay"); + //replayShotAction = new KAction(i18n("&Replay Shot"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "replay"); - holeAction = new KListAction(i18n("Switch to Hole"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "switchhole"); - nextAction = new KAction(i18n("&Next Hole"), "forward", KStdAccel::shortcut(KStdAccel::Forward), this, TQT_SLOT(emptySlot()), actionCollection(), "nexthole"); - prevAction = new KAction(i18n("&Previous Hole"), "back", KStdAccel::shortcut(KStdAccel::Back), this, TQT_SLOT(emptySlot()), actionCollection(), "prevhole"); - firstAction = new KAction(i18n("&First Hole"), "gohome", KStdAccel::shortcut(KStdAccel::Home), this, TQT_SLOT(emptySlot()), actionCollection(), "firsthole"); - lastAction = new KAction(i18n("&Last Hole"), CTRL+SHIFT+Key_End, this, TQT_SLOT(emptySlot()), actionCollection(), "lasthole"); - randAction = new KAction(i18n("&Random Hole"), "goto", 0, this, TQT_SLOT(emptySlot()), actionCollection(), "randhole"); + holeAction = new KListAction(i18n("Switch to Hole"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "switchhole"); + nextAction = new KAction(i18n("&Next Hole"), "forward", KStdAccel::shortcut(KStdAccel::Forward), TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "nexthole"); + prevAction = new KAction(i18n("&Previous Hole"), "back", KStdAccel::shortcut(KStdAccel::Back), TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "prevhole"); + firstAction = new KAction(i18n("&First Hole"), "gohome", KStdAccel::shortcut(KStdAccel::Home), TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "firsthole"); + lastAction = new KAction(i18n("&Last Hole"), CTRL+SHIFT+Key_End, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "lasthole"); + randAction = new KAction(i18n("&Random Hole"), "goto", 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "randhole"); - useMouseAction = new KToggleAction(i18n("Enable &Mouse for Moving Putter"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "usemouse"); + useMouseAction = new KToggleAction(i18n("Enable &Mouse for Moving Putter"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "usemouse"); useMouseAction->setCheckedState(i18n("Disable &Mouse for Moving Putter")); - connect(useMouseAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(useMouseChanged(bool))); + connect(useMouseAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(useMouseChanged(bool))); KConfig *config = kapp->config(); config->setGroup("Settings"); useMouseAction->setChecked(config->readBoolEntry("useMouse", true)); - useAdvancedPuttingAction = new KToggleAction(i18n("Enable &Advanced Putting"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "useadvancedputting"); + useAdvancedPuttingAction = new KToggleAction(i18n("Enable &Advanced Putting"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "useadvancedputting"); useAdvancedPuttingAction->setCheckedState(i18n("Disable &Advanced Putting")); - connect(useAdvancedPuttingAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(useAdvancedPuttingChanged(bool))); + connect(useAdvancedPuttingAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(useAdvancedPuttingChanged(bool))); useAdvancedPuttingAction->setChecked(config->readBoolEntry("useAdvancedPutting", false)); - showInfoAction = new KToggleAction(i18n("Show &Info"), "info", CTRL+Key_I, this, TQT_SLOT(emptySlot()), actionCollection(), "showinfo"); + showInfoAction = new KToggleAction(i18n("Show &Info"), "info", CTRL+Key_I, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "showinfo"); showInfoAction->setCheckedState(i18n("Hide &Info")); - connect(showInfoAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showInfoChanged(bool))); + connect(showInfoAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(showInfoChanged(bool))); showInfoAction->setChecked(config->readBoolEntry("showInfo", false)); - showGuideLineAction = new KToggleAction(i18n("Show Putter &Guideline"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "showguideline"); + showGuideLineAction = new KToggleAction(i18n("Show Putter &Guideline"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "showguideline"); showGuideLineAction->setCheckedState(i18n("Hide Putter &Guideline")); - connect(showGuideLineAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showGuideLineChanged(bool))); + connect(showGuideLineAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(showGuideLineChanged(bool))); showGuideLineAction->setChecked(config->readBoolEntry("showGuideLine", true)); - KToggleAction *act=new KToggleAction(i18n("Enable All Dialog Boxes"), 0, this, TQT_SLOT(enableAllMessages()), actionCollection(), "enableAll"); + KToggleAction *act=new KToggleAction(i18n("Enable All Dialog Boxes"), 0, TQT_TQOBJECT(this), TQT_SLOT(enableAllMessages()), actionCollection(), "enableAll"); act->setCheckedState(i18n("Disable All Dialog Boxes")); - soundAction = new KToggleAction(i18n("Play &Sounds"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "sound"); - connect(soundAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(soundChanged(bool))); + soundAction = new KToggleAction(i18n("Play &Sounds"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "sound"); + connect(soundAction, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(soundChanged(bool))); soundAction->setChecked(config->readBoolEntry("sound", true)); - (void) new KAction(i18n("&Reload Plugins"), 0, this, TQT_SLOT(initPlugins()), actionCollection(), "reloadplugins"); - (void) new KAction(i18n("Show &Plugins"), 0, this, TQT_SLOT(showPlugins()), actionCollection(), "showplugins"); + (void) new KAction(i18n("&Reload Plugins"), 0, TQT_TQOBJECT(this), TQT_SLOT(initPlugins()), actionCollection(), "reloadplugins"); + (void) new KAction(i18n("Show &Plugins"), 0, TQT_TQOBJECT(this), TQT_SLOT(showPlugins()), actionCollection(), "showplugins"); - aboutAction = new KAction(i18n("&About Course"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "aboutcourse"); - tutorialAction = new KAction(i18n("&Tutorial"), 0, this, TQT_SLOT(tutorial()), actionCollection(), "tutorial"); + aboutAction = new KAction(i18n("&About Course"), 0, TQT_TQOBJECT(this), TQT_SLOT(emptySlot()), actionCollection(), "aboutcourse"); + tutorialAction = new KAction(i18n("&Tutorial"), 0, TQT_TQOBJECT(this), TQT_SLOT(tutorial()), actionCollection(), "tutorial"); statusBar(); setupGUI(); @@ -176,7 +176,7 @@ void Kolf::startNewGame() players.clear(); delete scoreboard; scoreboard = new ScoreBoard(dummy, "Score Board"); - layout->addWidget(scoreboard, 1, 0); + tqlayout->addWidget(scoreboard, 1, 0); scoreboard->show(); if (loadedGame.isNull()) @@ -202,7 +202,7 @@ void Kolf::startNewGame() if (isTutorial) filename = KGlobal::dirs()->findResource("appdata", "tutorial.kolf"); else - filename = config.readEntry("Course", TQString::null); + filename = config.readEntry("Course", TQString()); if (filename.isNull()) return; @@ -226,19 +226,19 @@ void Kolf::startNewGame() connect(game, TQT_SIGNAL(newHole(int)), scoreboard, TQT_SLOT(newHole(int))); connect(game, TQT_SIGNAL(scoreChanged(int, int, int)), scoreboard, TQT_SLOT(setScore(int, int, int))); connect(game, TQT_SIGNAL(parChanged(int, int)), scoreboard, TQT_SLOT(parChanged(int, int))); - connect(game, TQT_SIGNAL(modifiedChanged(bool)), this, TQT_SLOT(updateModified(bool))); - connect(game, TQT_SIGNAL(newPlayersTurn(Player *)), this, TQT_SLOT(newPlayersTurn(Player *))); - connect(game, TQT_SIGNAL(holesDone()), this, TQT_SLOT(gameOver())); - connect(game, TQT_SIGNAL(checkEditing()), this, TQT_SLOT(checkEditing())); - connect(game, TQT_SIGNAL(editingStarted()), this, TQT_SLOT(editingStarted())); - connect(game, TQT_SIGNAL(editingEnded()), this, TQT_SLOT(editingEnded())); - connect(game, TQT_SIGNAL(inPlayStart()), this, TQT_SLOT(inPlayStart())); - connect(game, TQT_SIGNAL(inPlayEnd()), this, TQT_SLOT(inPlayEnd())); - connect(game, TQT_SIGNAL(maxStrokesReached(const TQString &)), this, TQT_SLOT(maxStrokesReached(const TQString &))); - connect(game, TQT_SIGNAL(largestHole(int)), this, TQT_SLOT(updateHoleMenu(int))); - connect(game, TQT_SIGNAL(titleChanged(const TQString &)), this, TQT_SLOT(titleChanged(const TQString &))); - connect(game, TQT_SIGNAL(newStatusText(const TQString &)), this, TQT_SLOT(newStatusText(const TQString &))); - connect(game, TQT_SIGNAL(currentHole(int)), this, TQT_SLOT(setCurrentHole(int))); + connect(game, TQT_SIGNAL(modifiedChanged(bool)), TQT_TQOBJECT(this), TQT_SLOT(updateModified(bool))); + connect(game, TQT_SIGNAL(newPlayersTurn(Player *)), TQT_TQOBJECT(this), TQT_SLOT(newPlayersTurn(Player *))); + connect(game, TQT_SIGNAL(holesDone()), TQT_TQOBJECT(this), TQT_SLOT(gameOver())); + connect(game, TQT_SIGNAL(checkEditing()), TQT_TQOBJECT(this), TQT_SLOT(checkEditing())); + connect(game, TQT_SIGNAL(editingStarted()), TQT_TQOBJECT(this), TQT_SLOT(editingStarted())); + connect(game, TQT_SIGNAL(editingEnded()), TQT_TQOBJECT(this), TQT_SLOT(editingEnded())); + connect(game, TQT_SIGNAL(inPlayStart()), TQT_TQOBJECT(this), TQT_SLOT(inPlayStart())); + connect(game, TQT_SIGNAL(inPlayEnd()), TQT_TQOBJECT(this), TQT_SLOT(inPlayEnd())); + connect(game, TQT_SIGNAL(maxStrokesReached(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(maxStrokesReached(const TQString &))); + connect(game, TQT_SIGNAL(largestHole(int)), TQT_TQOBJECT(this), TQT_SLOT(updateHoleMenu(int))); + connect(game, TQT_SIGNAL(titleChanged(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(titleChanged(const TQString &))); + connect(game, TQT_SIGNAL(newStatusText(const TQString &)), TQT_TQOBJECT(this), TQT_SLOT(newStatusText(const TQString &))); + connect(game, TQT_SIGNAL(currentHole(int)), TQT_TQOBJECT(this), TQT_SLOT(setCurrentHole(int))); connect(holeAction, TQT_SIGNAL(activated(const TQString &)), game, TQT_SLOT(switchHole(const TQString &))); connect(nextAction, TQT_SIGNAL(activated()), game, TQT_SLOT(nextHole())); connect(prevAction, TQT_SIGNAL(activated()), game, TQT_SLOT(prevHole())); @@ -264,7 +264,7 @@ void Kolf::startNewGame() game->setShowGuideLine(showGuideLineAction->isChecked()); game->setSound(soundAction->isChecked()); - layout->addWidget(game, 0, 0, AlignCenter); + tqlayout->addWidget(game, 0, 0, AlignCenter); game->show(); game->setFocus(); @@ -299,7 +299,7 @@ void Kolf::startNewGame() void Kolf::newGame() { isTutorial = false; - filename = TQString::null; + filename = TQString(); startNewGame(); } @@ -309,13 +309,13 @@ void Kolf::tutorial() if (newfilename.isNull()) return; - filename = TQString::null; + filename = TQString(); loadedGame = newfilename; isTutorial = true; startNewGame(); - loadedGame = TQString::null; + loadedGame = TQString(); } void Kolf::closeGame() @@ -327,12 +327,12 @@ void Kolf::closeGame() game->pause(); } - filename = TQString::null; + filename = TQString(); editingEnded(); delete game; game = 0; - loadedGame = TQString::null; + loadedGame = TQString(); editingAction->setChecked(false); setEditingEnabled(false); @@ -353,10 +353,10 @@ void Kolf::closeGame() loadGameAction->setEnabled(true); tutorialAction->setEnabled(true); - titleChanged(TQString::null); + titleChanged(TQString()); updateModified(false); - TQTimer::singleShot(100, this, TQT_SLOT(createSpacer())); + TQTimer::singleShot(100, TQT_TQOBJECT(this), TQT_SLOT(createSpacer())); } void Kolf::createSpacer() @@ -372,7 +372,7 @@ void Kolf::createSpacer() spacer = new KolfGame(obj, &spacerPlayers, KGlobal::dirs()->findResource("appdata", "intro"), dummy); spacer->setSound(false); spacer->startFirstHole(1); - layout->addWidget(spacer, 0, 0, AlignCenter); + tqlayout->addWidget(spacer, 0, 0, AlignCenter); spacer->hidePutter(); spacer->ignoreEvents(true); @@ -431,10 +431,10 @@ void Kolf::gameOver() if (names.count() > 1) { TQString winners = names.join(i18n(" and ")); - KMessageBox::information(this, i18n("%1 tied").arg(winners)); + KMessageBox::information(this, i18n("%1 tied").tqarg(winners)); } else - KMessageBox::information(this, i18n("%1 won!").arg(names.first())); + KMessageBox::information(this, i18n("%1 won!").tqarg(names.first())); } if (competition) @@ -459,11 +459,11 @@ void Kolf::gameOver() scoreDialog->addScore((*it).score, info, false, true); } - scoreDialog->setComment(i18n("High Scores for %1").arg(courseInfo.name)); + scoreDialog->setComment(i18n("High Scores for %1").tqarg(courseInfo.name)); scoreDialog->show(); } - TQTimer::singleShot(700, this, TQT_SLOT(closeGame())); + TQTimer::singleShot(700, TQT_TQOBJECT(this), TQT_SLOT(closeGame())); } void Kolf::showHighScores() @@ -475,7 +475,7 @@ void Kolf::showHighScores() game->courseInfo(courseInfo, game->curFilename()); scoreDialog->setConfigGroup(courseInfo.untranslatedName + TQString(" Highscores")); - scoreDialog->setComment(i18n("High Scores for %1").arg(courseInfo.name)); + scoreDialog->setComment(i18n("High Scores for %1").tqarg(courseInfo.name)); scoreDialog->show(); } @@ -537,7 +537,7 @@ void Kolf::saveGame() void Kolf::loadGame() { - loadedGame = KFileDialog::getOpenFileName(":savedkolf", TQString::fromLatin1("application/x-kolf"), this, i18n("Pick Kolf Saved Game")); + loadedGame = KFileDialog::getOpenFileName(":savedkolf", TQString::tqfromLatin1("application/x-kolf"), this, i18n("Pick Kolf Saved Game")); if (loadedGame.isNull()) return; @@ -564,7 +564,7 @@ void Kolf::openURL(KURL url) return; } - TQTimer::singleShot(10, this, TQT_SLOT(startNewGame())); + TQTimer::singleShot(10, TQT_TQOBJECT(this), TQT_SLOT(startNewGame())); } else closeGame(); @@ -572,7 +572,7 @@ void Kolf::openURL(KURL url) void Kolf::newPlayersTurn(Player *player) { - tempStatusBarText = i18n("%1's turn").arg(player->name()); + tempStatusBarText = i18n("%1's turn").tqarg(player->name()); if (showInfoAction->isChecked()) statusBar()->message(tempStatusBarText, 5 * 1000); @@ -596,12 +596,12 @@ void Kolf::editingStarted() editor = new Editor(obj, dummy, "Editor"); connect(editor, TQT_SIGNAL(addNewItem(Object *)), game, TQT_SLOT(addNewObject(Object *))); connect(editor, TQT_SIGNAL(changed()), game, TQT_SLOT(setModified())); - connect(editor, TQT_SIGNAL(addNewItem(Object *)), this, TQT_SLOT(setHoleFocus())); + connect(editor, TQT_SIGNAL(addNewItem(Object *)), TQT_TQOBJECT(this), TQT_SLOT(setHoleFocus())); connect(game, TQT_SIGNAL(newSelectedItem(CanvasItem *)), editor, TQT_SLOT(setItem(CanvasItem *))); scoreboard->hide(); - layout->addWidget(editor, 1, 0); + tqlayout->addWidget(editor, 1, 0); editor->show(); clearHoleAction->setEnabled(true); @@ -643,7 +643,7 @@ void Kolf::inPlayEnd() void Kolf::maxStrokesReached(const TQString &name) { - KMessageBox::sorry(this, i18n("%1's score has reached the maximum for this hole.").arg(name)); + KMessageBox::sorry(this, i18n("%1's score has reached the maximum for this hole.").tqarg(name)); } void Kolf::updateHoleMenu(int largest) @@ -697,7 +697,7 @@ void Kolf::print() KPrinter pr; pr.addDialogPage(new PrintDialogPage()); - if (pr.setup(this, i18n("Print %1 - Hole %2").arg(game->courseName()).arg(game->currentHole()))) + if (pr.setup(this, i18n("Print %1 - Hole %2").tqarg(game->courseName()).tqarg(game->currentHole()))) { pr.newPage(); if (game) @@ -785,14 +785,14 @@ void Kolf::initPlugins() void Kolf::showPlugins() { - TQString text = TQString("

%1

    ").arg(i18n("Currently Loaded Plugins")); + TQString text = TQString("

    %1

      ").tqarg(i18n("Currently Loaded Plugins")); Object *object = 0; for (object = plugins.first(); object; object = plugins.next()) { text.append("
    1. "); text.append(object->name()); text.append(" - "); - text.append(i18n("by %1").arg(object->author())); + text.append(i18n("by %1").tqarg(object->author())); text.append("
    2. "); } text.append("
    "); diff --git a/kolf/kolf.h b/kolf/kolf.h index b57b2774..62892ea7 100644 --- a/kolf/kolf.h +++ b/kolf/kolf.h @@ -27,6 +27,7 @@ class Editor; class KDE_EXPORT Kolf : public KMainWindow { Q_OBJECT + TQ_OBJECT public: Kolf(); @@ -87,7 +88,7 @@ private: TQString filename; PlayerList players; PlayerList spacerPlayers; - TQGridLayout *layout; + TQGridLayout *tqlayout; ScoreBoard *scoreboard; KToggleAction *editingAction; KAction *newHoleAction; diff --git a/kolf/kvolumecontrol.cpp b/kolf/kvolumecontrol.cpp index e2aaa464..b2028b77 100644 --- a/kolf/kvolumecontrol.cpp +++ b/kolf/kvolumecontrol.cpp @@ -5,14 +5,14 @@ #include "kvolumecontrol.h" -KVolumeControl::KVolumeControl(Arts::SoundServerV2 server, KPlayObject *parent) - : TQObject(parent) +KVolumeControl::KVolumeControl(Arts::SoundServerV2 server, KPlayObject *tqparent) + : TQObject(tqparent) { init(server); } -KVolumeControl::KVolumeControl(double vol, Arts::SoundServerV2 server, KPlayObject *parent) - : TQObject(parent) +KVolumeControl::KVolumeControl(double vol, Arts::SoundServerV2 server, KPlayObject *tqparent) + : TQObject(tqparent) { init(server); setVolume(vol); @@ -42,8 +42,8 @@ void KVolumeControl::init(Arts::SoundServerV2 server) } volumeControl.start(); - Arts::connect((static_cast(parent()))->object(), "left", volumeControl, "inleft"); - Arts::connect((static_cast(parent()))->object(), "right", volumeControl, "inright"); + Arts::connect((static_cast(tqparent()))->object(), "left", volumeControl, "inleft"); + Arts::connect((static_cast(tqparent()))->object(), "right", volumeControl, "inright"); Arts::connect(volumeControl, manager); } diff --git a/kolf/kvolumecontrol.h b/kolf/kvolumecontrol.h index ab7632f4..190b3beb 100644 --- a/kolf/kvolumecontrol.h +++ b/kolf/kvolumecontrol.h @@ -6,13 +6,14 @@ #include #include -class KVolumeControl : public QObject +class KVolumeControl : public TQObject { Q_OBJECT + TQ_OBJECT public: - KVolumeControl(Arts::SoundServerV2 server, KPlayObject *parent); - KVolumeControl(double vol, Arts::SoundServerV2 server, KPlayObject *parent); + KVolumeControl(Arts::SoundServerV2 server, KPlayObject *tqparent); + KVolumeControl(double vol, Arts::SoundServerV2 server, KPlayObject *tqparent); ~KVolumeControl(); void setVolume(double); diff --git a/kolf/main.cpp b/kolf/main.cpp index e9e8498a..079178ee 100644 --- a/kolf/main.cpp +++ b/kolf/main.cpp @@ -57,16 +57,16 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) KolfGame::courseInfo(info, filename); cout << info.name.latin1() - << " - " << i18n("By %1").arg(info.author).latin1() - << " - " << i18n("%1 holes").arg(info.holes).latin1() - << " - " << i18n("par %1").arg(info.par).latin1() + << " - " << i18n("By %1").tqarg(info.author).latin1() + << " - " << i18n("%1 holes").tqarg(info.holes).latin1() + << " - " << i18n("par %1").tqarg(info.par).latin1() << endl; return 0; } else { - KCmdLineArgs::usage(i18n("Course %1 does not exist.").arg(filename.latin1())); + KCmdLineArgs::usage(i18n("Course %1 does not exist.").tqarg(filename.latin1())); } } diff --git a/kolf/newgame.cpp b/kolf/newgame.cpp index 22c6b785..2fd048c1 100644 --- a/kolf/newgame.cpp +++ b/kolf/newgame.cpp @@ -35,8 +35,8 @@ #include "newgame.h" #include "game.h" -NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_name) - : KDialogBase(KDialogBase::TreeList, i18n("New Game"), Ok | Cancel, Ok, parent, _name) +NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *tqparent, const char *_name) + : KDialogBase(KDialogBase::TreeList, i18n("New Game"), Ok | Cancel, Ok, tqparent, _name) { this->enableCourses = enableCourses; @@ -56,14 +56,14 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_ scroller = new TQScrollView(playerPage); bigLayout->addWidget(scroller); - layout = new TQVBox(scroller->viewport()); - if (!TQPixmapCache::find("grass", grass)) + tqlayout = new TQVBox(scroller->viewport()); + if (!TQPixmapCache::tqfind("grass", grass)) { grass.load(locate("appdata", "pics/grass.png")); TQPixmapCache::insert("grass", grass); } scroller->viewport()->setBackgroundPixmap(grass); - scroller->addChild(layout); + scroller->addChild(tqlayout); TQMap entries = config->entryMap("New Game Dialog"); unsigned int i = 0; @@ -95,7 +95,7 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_ connect(coursesLink, TQT_SIGNAL(leftClickedURL(const TQString &)), kapp, TQT_SLOT(invokeBrowser(const TQString &))); coursePageLayout->addWidget(coursesLink); - TQHBoxLayout *hlayout = new TQHBoxLayout(coursePageLayout, spacingHint()); + TQHBoxLayout *htqlayout = new TQHBoxLayout(coursePageLayout, spacingHint()); // following use this group config->setGroup("New Game Dialog Mode"); @@ -123,18 +123,18 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_ } const TQString newName(i18n("Create New")); - info[TQString::null] = CourseInfo(newName, newName, i18n("You"), 0, 0); - names.append(TQString::null); + info[TQString()] = CourseInfo(newName, newName, i18n("You"), 0, 0); + names.append(TQString()); nameList.append(newName); courseList = new KListBox(coursePage); - hlayout->addWidget(courseList); + htqlayout->addWidget(courseList); courseList->insertStringList(nameList); courseList->setCurrentItem(curItem); connect(courseList, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(courseSelected(int))); connect(courseList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(selectionChanged())); - TQVBoxLayout *detailLayout = new TQVBoxLayout(hlayout, spacingHint()); + TQVBoxLayout *detailLayout = new TQVBoxLayout(htqlayout, spacingHint()); name = new TQLabel(coursePage); detailLayout->addWidget(name); author = new TQLabel(coursePage); @@ -170,15 +170,15 @@ NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_ // options page optionsPage = addPage(i18n("Options"), i18n("Game Options")); - TQVBoxLayout *vlayout = new TQVBoxLayout(optionsPage, marginHint(), spacingHint()); + TQVBoxLayout *vtqlayout = new TQVBoxLayout(optionsPage, marginHint(), spacingHint()); mode = new TQCheckBox(i18n("&Strict mode"), optionsPage); - vlayout->addWidget(mode); + vtqlayout->addWidget(mode); mode->setChecked(config->readBoolEntry("competition", false)); TQLabel *desc = new TQLabel(i18n("In strict mode, undo, editing, and switching holes is not allowed. This is generally for competition. Only in strict mode are highscores kept."), optionsPage); desc->setTextFormat(RichText); - vlayout->addWidget(desc); + vtqlayout->addWidget(desc); } void NewGameDialog::slotOk() @@ -199,7 +199,7 @@ void NewGameDialog::slotOk() PlayerEditor *curEditor = 0; int i = 0; for (curEditor = editors.first(); curEditor; curEditor = editors.next(), ++i) - config->writeEntry(TQString::number(i) + curEditor->name(), curEditor->color().name()); + config->writeEntry(TQString::number(i) + curEditor->name(), TQString(curEditor->color().name())); config->sync(); @@ -212,11 +212,11 @@ void NewGameDialog::courseSelected(int index) CourseInfo &curinfo = info[currentCourse]; - name->setText(TQString("%1").arg(curinfo.name)); + name->setText(TQString("%1").tqarg(curinfo.name)); - author->setText(i18n("By %1").arg(curinfo.author)); - par->setText(i18n("Par %1").arg(curinfo.par)); - holes->setText(i18n("%1 Holes").arg(curinfo.holes)); + author->setText(i18n("By %1").tqarg(curinfo.author)); + par->setText(i18n("Par %1").tqarg(curinfo.par)); + holes->setText(i18n("%1 Holes").tqarg(curinfo.holes)); } void NewGameDialog::showHighscores() @@ -224,7 +224,7 @@ void NewGameDialog::showHighscores() KScoreDialog *scoreDialog = new KScoreDialog(KScoreDialog::Name | KScoreDialog::Custom1 | KScoreDialog::Score, this); scoreDialog->addField(KScoreDialog::Custom1, i18n("Par"), "Par"); scoreDialog->setConfigGroup(info[currentCourse].untranslatedName + TQString(" Highscores")); - scoreDialog->setComment(i18n("High Scores for %1").arg(info[currentCourse].name)); + scoreDialog->setComment(i18n("High Scores for %1").tqarg(info[currentCourse].name)); scoreDialog->show(); } @@ -235,7 +235,7 @@ void NewGameDialog::removeCourse() return; TQString file = *names.at(curItem); - if (externCourses.contains(file) < 1) + if (externCourses.tqcontains(file) < 1) return; names.remove(file); @@ -248,18 +248,18 @@ void NewGameDialog::removeCourse() void NewGameDialog::selectionChanged() { const int curItem = courseList->currentItem(); - remove->setEnabled(!(curItem < 0 || externCourses.contains(*names.at(curItem)) < 1)); + remove->setEnabled(!(curItem < 0 || externCourses.tqcontains(*names.at(curItem)) < 1)); } void NewGameDialog::addCourse() { - TQStringList files = KFileDialog::getOpenFileNames(":kourses", TQString::fromLatin1("application/x-kourse"), this, i18n("Pick Kolf Course")); + TQStringList files = KFileDialog::getOpenFileNames(":kourses", TQString::tqfromLatin1("application/x-kourse"), this, i18n("Pick Kolf Course")); bool hasDuplicates = false; for (TQStringList::Iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) { - if (names.contains(*fileIt) > 0) + if (names.tqcontains(*fileIt) > 0) { hasDuplicates = true; continue; @@ -287,7 +287,7 @@ void NewGameDialog::addPlayer() if (editors.count() >= startColors.count()) return; - editors.append(new PlayerEditor(i18n("Player %1").arg(editors.count() + 1), *startColors.at(editors.count()), layout)); + editors.append(new PlayerEditor(i18n("Player %1").tqarg(editors.count() + 1), *startColors.at(editors.count()), tqlayout)); editors.last()->show(); connect(editors.last(), TQT_SIGNAL(deleteEditor(PlayerEditor *)), this, TQT_SLOT(deleteEditor(PlayerEditor *))); @@ -311,12 +311,12 @@ void NewGameDialog::enableButtons() ///////////////////////// -PlayerEditor::PlayerEditor(TQString startName, TQColor startColor, TQWidget *parent, const char *_name) - : TQWidget(parent, _name) +PlayerEditor::PlayerEditor(TQString startName, TQColor startColor, TQWidget *tqparent, const char *_name) + : TQWidget(tqparent, _name) { - TQHBoxLayout *layout = new TQHBoxLayout(this, KDialogBase::spacingHint()); + TQHBoxLayout *tqlayout = new TQHBoxLayout(this, KDialogBase::spacingHint()); - if (!TQPixmapCache::find("grass", grass)) + if (!TQPixmapCache::tqfind("grass", grass)) { grass.load(locate("appdata", "pics/grass.png")); TQPixmapCache::insert("grass", grass); @@ -324,17 +324,17 @@ PlayerEditor::PlayerEditor(TQString startName, TQColor startColor, TQWidget *par setBackgroundPixmap(grass); editor = new KLineEdit(this); - layout->addWidget(editor); + tqlayout->addWidget(editor); editor->setFrame(false); editor->setText(startName); - layout->addStretch(); - layout->addWidget(colorButton = new KColorButton(startColor, this)); + tqlayout->addStretch(); + tqlayout->addWidget(colorButton = new KColorButton(startColor, this)); colorButton->setAutoMask(true); colorButton->setBackgroundPixmap(grass); KPushButton *remove = new KPushButton(i18n("Remove"), this); remove->setAutoMask(true); - layout->addWidget(remove); + tqlayout->addWidget(remove); remove->setBackgroundPixmap(grass); connect(remove, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeMe())); } diff --git a/kolf/newgame.h b/kolf/newgame.h index c4e228a4..ce5b8060 100644 --- a/kolf/newgame.h +++ b/kolf/newgame.h @@ -24,12 +24,13 @@ class TQPainter; class KListBox; class TQEvent; -class PlayerEditor : public QWidget +class PlayerEditor : public TQWidget { Q_OBJECT + TQ_OBJECT public: - PlayerEditor(TQString name = TQString::null, TQColor = red, TQWidget *parent = 0, const char *_name = 0); + PlayerEditor(TQString name = TQString(), TQColor = red, TQWidget *tqparent = 0, const char *_name = 0); TQColor color() { return colorButton->color(); } TQString name() { return editor->text(); } void setColor(TQColor col) { colorButton->setColor(col); } @@ -50,9 +51,10 @@ private: class NewGameDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - NewGameDialog(bool enableCourses, TQWidget *parent, const char *_name = 0); + NewGameDialog(bool enableCourses, TQWidget *tqparent, const char *_name = 0); TQPtrList *players() { return &editors; } bool competition() { return mode->isChecked(); } TQString course() { return currentCourse; } @@ -72,7 +74,7 @@ private slots: void showHighscores(); private: - TQVBox *layout; + TQVBox *tqlayout; KPushButton *addButton; TQFrame *playerPage; TQScrollView *scroller; diff --git a/kolf/object.h b/kolf/object.h index 1ef52c55..74464bb6 100644 --- a/kolf/object.h +++ b/kolf/object.h @@ -7,12 +7,13 @@ #include #include -class Object : public QObject +class Object : public TQObject { Q_OBJECT + TQ_OBJECT public: - Object(TQObject *parent = 0, const char *name = 0) : TQObject(parent, name) { m_addOnNewHole = false; } + Object(TQObject *tqparent = 0, const char *name = 0) : TQObject(tqparent, name) { m_addOnNewHole = false; } virtual TQCanvasItem *newObject(TQCanvas * /*canvas*/) { return 0; } TQString name() { return m_name; } TQString _name() { return m__name; } diff --git a/kolf/objects/poolball/poolball.cpp b/kolf/objects/poolball/poolball.cpp index c2fe0718..18d3ca5b 100644 --- a/kolf/objects/poolball/poolball.cpp +++ b/kolf/objects/poolball/poolball.cpp @@ -54,20 +54,20 @@ void PoolBall::draw(TQPainter &p) Ball::draw(p); } -PoolBallConfig::PoolBallConfig(PoolBall *poolBall, TQWidget *parent) - : Config(parent), m_poolBall(poolBall) +PoolBallConfig::PoolBallConfig(PoolBall *poolBall, TQWidget *tqparent) + : Config(tqparent), m_poolBall(poolBall) { - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); - layout->addStretch(); + tqlayout->addStretch(); TQLabel *num = new TQLabel(i18n("Number:"), this); - layout->addWidget(num); + tqlayout->addWidget(num); KIntNumInput *slider = new KIntNumInput(m_poolBall->number(), this); slider->setRange(1, 15); - layout->addWidget(slider); + tqlayout->addWidget(slider); - layout->addStretch(); + tqlayout->addStretch(); connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(numberChanged(int))); } @@ -78,9 +78,9 @@ void PoolBallConfig::numberChanged(int newNumber) changed(); } -Config *PoolBall::config(TQWidget *parent) +Config *PoolBall::config(TQWidget *tqparent) { - return new PoolBallConfig(this, parent); + return new PoolBallConfig(this, tqparent); } #include "poolball.moc" diff --git a/kolf/objects/poolball/poolball.h b/kolf/objects/poolball/poolball.h index 82b1dd68..312e1996 100644 --- a/kolf/objects/poolball/poolball.h +++ b/kolf/objects/poolball/poolball.h @@ -15,7 +15,7 @@ class StateDB; class KConfig; -class PoolBallFactory : KLibFactory { Q_OBJECT public: TQObject *createObject(TQObject *, const char *, const char *, const TQStringList & = TQStringList()); }; +class PoolBallFactory : KLibFactory { TQ_OBJECT public: TQObject *createObject(TQObject *, const char *, const char *, const TQStringList & = TQStringList()); }; class PoolBall : public Ball { @@ -24,7 +24,7 @@ public: virtual bool deleteable() const { return true; } - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); virtual void saveState(StateDB *); virtual void save(KConfig *cfg); virtual void loadState(StateDB *); @@ -42,9 +42,10 @@ private: class PoolBallConfig : public Config { Q_OBJECT + TQ_OBJECT public: - PoolBallConfig(PoolBall *poolBall, TQWidget *parent); + PoolBallConfig(PoolBall *poolBall, TQWidget *tqparent); private slots: void numberChanged(int); diff --git a/kolf/objects/test/test.cpp b/kolf/objects/test/test.cpp index d417f552..38a40f22 100644 --- a/kolf/objects/test/test.cpp +++ b/kolf/objects/test/test.cpp @@ -14,7 +14,7 @@ #include "test.h" K_EXPORT_COMPONENT_FACTORY(libkolftest, TestFactory) -TQObject *TestFactory::createObject (TQObject * /*parent*/, const char * /*name*/, const char * /*classname*/, const TQStringList & /*args*/) +TQObject *TestFactory::createObject (TQObject * /*tqparent*/, const char * /*name*/, const char * /*classname*/, const TQStringList & /*args*/) { return new TestObj; } Test::Test(TQCanvas *canvas) @@ -39,9 +39,9 @@ void Test::advance(int phase) if (count % m_switchEvery == 0) { // random color - const TQColor myColor((QRgb)(kapp->random() % 0x01000000)); + const TQColor myColor((TQRgb)(kapp->random() % 0x01000000)); - // set the brush, so our shape is drawn + // set the brush, so our tqshape is drawn // with the random color setBrush(TQBrush(myColor)); @@ -65,24 +65,24 @@ void Test::load(KConfig *cfg) setSwitchEvery(cfg->readNumEntry("switchEvery", 50)); } -TestConfig::TestConfig(Test *test, TQWidget *parent) - : Config(parent), m_test(test) +TestConfig::TestConfig(Test *test, TQWidget *tqparent) + : Config(tqparent), m_test(test) { - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); - layout->addStretch(); + tqlayout->addStretch(); - layout->addWidget(new TQLabel(i18n("Flash speed"), this)); + tqlayout->addWidget(new TQLabel(i18n("Flash speed"), this)); - TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); + TQHBoxLayout *htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); TQLabel *slow = new TQLabel(i18n("Slow"), this); - hlayout->addWidget(slow); + htqlayout->addWidget(slow); TQSlider *slider = new TQSlider(1, 100, 5, 101 - m_test->switchEvery(), Qt::Horizontal, this); - hlayout->addWidget(slider); + htqlayout->addWidget(slider); TQLabel *fast = new TQLabel(i18n("Fast"), this); - hlayout->addWidget(fast); + htqlayout->addWidget(fast); - layout->addStretch(); + tqlayout->addStretch(); connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(switchEveryChanged(int))); } @@ -96,9 +96,9 @@ void TestConfig::switchEveryChanged(int news) changed(); } -Config *Test::config(TQWidget *parent) +Config *Test::config(TQWidget *tqparent) { - return new TestConfig(this, parent); + return new TestConfig(this, tqparent); } #include "test.moc" diff --git a/kolf/objects/test/test.h b/kolf/objects/test/test.h index 06e9f30a..690a7e84 100644 --- a/kolf/objects/test/test.h +++ b/kolf/objects/test/test.h @@ -11,14 +11,14 @@ class KConfig; -class TestFactory : KLibFactory { Q_OBJECT public: TQObject *createObject(TQObject *, const char *, const char *, const TQStringList & = TQStringList()); }; +class TestFactory : KLibFactory { TQ_OBJECT public: TQObject *createObject(TQObject *, const char *, const char *, const TQStringList & = TQStringList()); }; class Test : public TQCanvasEllipse, public CanvasItem { public: Test(TQCanvas *canvas); - virtual Config *config(TQWidget *parent); + virtual Config *config(TQWidget *tqparent); virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); @@ -35,9 +35,10 @@ private: class TestConfig : public Config { Q_OBJECT + TQ_OBJECT public: - TestConfig(Test *test, TQWidget *parent); + TestConfig(Test *test, TQWidget *tqparent); private slots: void switchEveryChanged(int news); diff --git a/kolf/printdialogpage.cpp b/kolf/printdialogpage.cpp index e8733c81..dfec9c96 100644 --- a/kolf/printdialogpage.cpp +++ b/kolf/printdialogpage.cpp @@ -8,16 +8,16 @@ #include "printdialogpage.h" -PrintDialogPage::PrintDialogPage(TQWidget *parent, const char *name) - : KPrintDialogPage( parent, name ) +PrintDialogPage::PrintDialogPage(TQWidget *tqparent, const char *name) + : KPrintDialogPage( tqparent, name ) { setTitle(i18n("Kolf Options")); - TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); titleCheck = new TQCheckBox(i18n("Draw title text"), this); titleCheck->setChecked(true); - layout->addWidget(titleCheck); + tqlayout->addWidget(titleCheck); } void PrintDialogPage::getOptions(TQMap &opts, bool /*incldef*/) diff --git a/kolf/printdialogpage.h b/kolf/printdialogpage.h index 76b7c43a..4869ea53 100644 --- a/kolf/printdialogpage.h +++ b/kolf/printdialogpage.h @@ -11,9 +11,10 @@ class TQWidget; class PrintDialogPage : public KPrintDialogPage { Q_OBJECT + TQ_OBJECT public: - PrintDialogPage(TQWidget *parent = 0, const char *name = 0); + PrintDialogPage(TQWidget *tqparent = 0, const char *name = 0); //reimplement virtual functions void getOptions(TQMap &opts, bool incldef = false); diff --git a/kolf/scoreboard.cpp b/kolf/scoreboard.cpp index 61ff9926..cdd5759b 100644 --- a/kolf/scoreboard.cpp +++ b/kolf/scoreboard.cpp @@ -9,15 +9,15 @@ #include "scoreboard.h" -ScoreBoard::ScoreBoard(TQWidget *parent, const char *name) - : TQTable(1, 1, parent, name) +ScoreBoard::ScoreBoard(TQWidget *tqparent, const char *name) + : TQTable(1, 1, tqparent, name) { vh = verticalHeader(); hh = horizontalHeader(); vh->setLabel(numRows() - 1, i18n("Par")); hh->setLabel(numCols() - 1, i18n("Total")); - setFocusPolicy(TQWidget::NoFocus); + setFocusPolicy(TQ_NoFocus); setRowReadOnly(0, true); setRowReadOnly(1, true); } diff --git a/kolf/scoreboard.h b/kolf/scoreboard.h index b9caf652..f15a323a 100644 --- a/kolf/scoreboard.h +++ b/kolf/scoreboard.h @@ -6,12 +6,13 @@ class TQWidget; class TQHeader; -class ScoreBoard : public QTable +class ScoreBoard : public TQTable { Q_OBJECT + TQ_OBJECT public: - ScoreBoard(TQWidget *parent = 0, const char *name = 0); + ScoreBoard(TQWidget *tqparent = 0, const char *name = 0); int total(int id, TQString &name); public slots: diff --git a/kolf/slope.cpp b/kolf/slope.cpp index a6a1abf1..dd40cc49 100644 --- a/kolf/slope.cpp +++ b/kolf/slope.cpp @@ -34,7 +34,7 @@ Slope::Slope(TQRect rect, TQCanvas *canvas) setZ(-50); - if (!TQPixmapCache::find("grass", grass)) + if (!TQPixmapCache::tqfind("grass", grass)) { grass.load(locate("appdata", "pics/grass.png")); TQPixmapCache::insert("grass", grass); @@ -71,7 +71,7 @@ void Slope::showInfo() arrow->setZ(z() + .01); arrow->setVisible(true); } - text->setVisible(true); + text->tqsetVisible(true); } void Slope::hideInfo() @@ -80,7 +80,7 @@ void Slope::hideInfo() Arrow *arrow = 0; for (arrow = arrows.first(); arrow; arrow = arrows.next()) arrow->setVisible(false); - text->setVisible(false); + text->tqsetVisible(false); } void Slope::aboutToDie() @@ -179,7 +179,7 @@ void Slope::moveArrow() void Slope::editModeChanged(bool changed) { - point->setVisible(changed); + point->tqsetVisible(changed); moveBy(0, 0); } @@ -501,13 +501,13 @@ void Slope::updatePixmap() // shift all the points for (unsigned int i = 0; i < r.count(); ++i) { - TQPoint &p = r[i]; + QPoint &p = r[i]; p.setX(p.x() - x()); p.setY(p.y() - y()); } bpainter.drawPolygon(r); - // mask is drawn + // tqmask is drawn pixmap.setMask(bitmap); } @@ -517,11 +517,11 @@ void Slope::updatePixmap() ///////////////////////// -SlopeConfig::SlopeConfig(Slope *slope, TQWidget *parent) - : Config(parent) +SlopeConfig::SlopeConfig(Slope *slope, TQWidget *tqparent) + : Config(tqparent) { this->slope = slope; - TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *tqlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); KComboBox *gradient = new KComboBox(this); TQStringList items; TQString curText; @@ -533,28 +533,28 @@ SlopeConfig::SlopeConfig(Slope *slope, TQWidget *parent) } gradient->insertStringList(items); gradient->setCurrentText(curText); - layout->addWidget(gradient); + tqlayout->addWidget(gradient); connect(gradient, TQT_SIGNAL(activated(const TQString &)), this, TQT_SLOT(setGradient(const TQString &))); - layout->addStretch(); + tqlayout->addStretch(); TQCheckBox *reversed = new TQCheckBox(i18n("Reverse direction"), this); reversed->setChecked(slope->isReversed()); - layout->addWidget(reversed); + tqlayout->addWidget(reversed); connect(reversed, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setReversed(bool))); - TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new TQLabel(i18n("Grade:"), this)); + TQHBoxLayout *htqlayout = new TQHBoxLayout(tqlayout, spacingHint()); + htqlayout->addWidget(new TQLabel(i18n("Grade:"), this)); KDoubleNumInput *grade = new KDoubleNumInput(this); grade->setRange(0, 8, 1, true); grade->setValue(slope->curGrade()); - hlayout->addWidget(grade); + htqlayout->addWidget(grade); connect(grade, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(gradeChanged(double))); TQCheckBox *stuck = new TQCheckBox(i18n("Unmovable"), this); TQWhatsThis::add(stuck, i18n("Whether or not this slope can be moved by other objects, like floaters.")); stuck->setChecked(slope->isStuckOnGround()); - layout->addWidget(stuck); + tqlayout->addWidget(stuck); connect(stuck, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setStuckOnGround(bool))); } diff --git a/kolf/slope.h b/kolf/slope.h index 1bca5e5e..c829ad36 100644 --- a/kolf/slope.h +++ b/kolf/slope.h @@ -9,9 +9,10 @@ class Slope; class SlopeConfig : public Config { Q_OBJECT + TQ_OBJECT public: - SlopeConfig(Slope *slope, TQWidget *parent); + SlopeConfig(Slope *slope, TQWidget *tqparent); private slots: void setGradient(const TQString &text); @@ -35,7 +36,7 @@ public: virtual void editModeChanged(bool changed); virtual bool canBeMovedByOthers() const { return !stuckOnGround; } virtual TQPtrList moveableItems() const; - virtual Config *config(TQWidget *parent) { return new SlopeConfig(this, parent); } + virtual Config *config(TQWidget *tqparent) { return new SlopeConfig(this, tqparent); } void setSize(int, int); virtual void newSize(int width, int height); diff --git a/kolf/tutorial.kolf b/kolf/tutorial.kolf index cfc5f5af..eaddc8aa 100644 --- a/kolf/tutorial.kolf +++ b/kolf/tutorial.kolf @@ -188,7 +188,7 @@ Comment[pl]=Aby wycelować kij, wciśnij klawisz z lewą lub prawą strzałką ( Comment[pt]=Para apontar o taco, carregue nas teclas Esquerda (rodar no sentido contrário aos ponteiros do relógio) e Direita (rodar nos ponteiros do relógio) ou use o rato. Comment[pt_BR]=Para direcionar a mira, pressione a seta para Esquerda (rotação no sentido anti-horário) e Direita (sentido horário) ou use o mouse. Comment[ru]=Чтобы прицелиться, нажмите стрелку влево (поворот против часовой стрелки) или вправо (по часовой) или используйте мышь. -Comment[sk]=Smer určíte pomocou šipky vľavo (otočenie proti smeru hodinových ručičiek) a vpravo (otočenie po smere) alebo použite myš. +Comment[sk]=Smer určíte potqmocou šipky vľavo (otočenie proti smeru hodinových ručičiek) a vpravo (otočenie po smere) alebo použite myš. Comment[sl]=Da namerite palico, pritisnite puščici levo (zasuk v nasprotni smeri urinega kazalca) ali desno (zasuk v smeri urinega kazalca) ali uporabite miško. Comment[sr]=Да бисте нациљали путер притисните леву стрелицу (окреће супротно смеру казаљке на часовнику) или десну (у смеру казаљке на часовнику), или користите миша. Comment[sr@Latn]=Da biste naciljali puter pritisnite levu strelicu (okreće suprotno smeru kazaljke na časovniku) ili desnu (u smeru kazaljke na časovniku), ili koristite miša. -- cgit v1.2.1