From 576eb4299a00bc053db35414406f46372a0f70f2 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:42:31 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kolf/ball.cpp | 56 +-- kolf/ball.h | 22 +- kolf/canvasitem.cpp | 16 +- kolf/canvasitem.h | 20 +- kolf/config.cpp | 16 +- kolf/config.h | 8 +- kolf/editor.cpp | 28 +- kolf/editor.h | 8 +- kolf/floater.cpp | 54 +-- kolf/floater.h | 18 +- kolf/game.cpp | 790 ++++++++++++++++++------------------- kolf/game.h | 364 ++++++++--------- kolf/kcomboboxdialog.cpp | 36 +- kolf/kcomboboxdialog.h | 26 +- kolf/kolf.cpp | 246 ++++++------ kolf/kolf.h | 34 +- kolf/kvolumecontrol.cpp | 4 +- kolf/kvolumecontrol.h | 2 +- kolf/main.cpp | 10 +- kolf/newgame.cpp | 134 +++---- kolf/newgame.h | 68 ++-- kolf/object.h | 24 +- kolf/objects/poolball/poolball.cpp | 30 +- kolf/objects/poolball/poolball.h | 18 +- kolf/objects/test/test.cpp | 42 +- kolf/objects/test/test.h | 16 +- kolf/pluginloader.cpp | 24 +- kolf/pluginloader.h | 4 +- kolf/printdialogpage.cpp | 18 +- kolf/printdialogpage.h | 14 +- kolf/scoreboard.cpp | 36 +- kolf/scoreboard.h | 14 +- kolf/slope.cpp | 142 +++---- kolf/slope.h | 38 +- kolf/statedb.h | 16 +- kolf/vector.cpp | 6 +- kolf/vector.h | 8 +- 37 files changed, 1205 insertions(+), 1205 deletions(-) (limited to 'kolf') diff --git a/kolf/ball.cpp b/kolf/ball.cpp index 8adaa8cb..9ac849bc 100644 --- a/kolf/ball.cpp +++ b/kolf/ball.cpp @@ -1,6 +1,6 @@ -#include -#include -#include +#include +#include +#include #include #include @@ -15,8 +15,8 @@ #include "game.h" #include "ball.h" -Ball::Ball(QCanvas *canvas) - : QCanvasEllipse(canvas) +Ball::Ball(TQCanvas *canvas) + : TQCanvasEllipse(canvas) { m_doDetect = true; m_collisionLock = false; @@ -29,9 +29,9 @@ Ball::Ball(QCanvas *canvas) m_placeOnGround = false; m_forceStillGoing = false; frictionMultiplier = 1.0; - QFont font(kapp->font()); + TQFont font(kapp->font()); //font.setPixelSize(10); - label = new QCanvasText("", font, canvas); + label = new TQCanvasText("", font, canvas); label->setColor(white); label->setVisible(false); @@ -98,7 +98,7 @@ void Ball::friction() void Ball::setVelocity(double vx, double vy) { - QCanvasEllipse::setVelocity(vx, vy); + TQCanvasEllipse::setVelocity(vx, vy); if (vx == 0 && vy == 0) { @@ -123,7 +123,7 @@ void Ball::setVector(const Vector &newVector) return; } - QCanvasEllipse::setVelocity(cos(newVector.direction()) * newVector.magnitude(), -sin(newVector.direction()) * newVector.magnitude()); + TQCanvasEllipse::setVelocity(cos(newVector.direction()) * newVector.magnitude(), -sin(newVector.direction()) * newVector.magnitude()); } void Ball::moveBy(double dx, double dy) @@ -132,7 +132,7 @@ void Ball::moveBy(double dx, double dy) double oldy; oldx = x(); oldy = y(); - QCanvasEllipse::moveBy(dx, dy); + TQCanvasEllipse::moveBy(dx, dy); if (game && !game->isPaused()) collisionDetect(oldx, oldy); @@ -145,7 +145,7 @@ void Ball::moveBy(double dx, double dy) void Ball::doAdvance() { - QCanvasEllipse::advance(1); + TQCanvasEllipse::advance(1); } namespace Lines @@ -221,17 +221,17 @@ void Ball::collisionDetect(double oldx, double oldy) const double minSpeed = .06; - QCanvasItemList m_list = collisions(true); + TQCanvasItemList m_list = collisions(true); - // please don't ask why QCanvas doesn't actually sort its list; + // please don't ask why TQCanvas doesn't actually sort its list; // it just doesn't. m_list.sort(); this->m_list = m_list; - for (QCanvasItemList::Iterator it = m_list.begin(); it != m_list.end(); ++it) + for (TQCanvasItemList::Iterator it = m_list.begin(); it != m_list.end(); ++it) { - QCanvasItem *item = *it; + TQCanvasItem *item = *it; if (item->rtti() == Rtti_NoCollision || item->rtti() == Rtti_Putter) continue; @@ -258,7 +258,7 @@ void Ball::collisionDetect(double oldx, double oldy) Vector bvector = oball->curVector(); m_vector -= bvector; - Vector unit1 = Vector(QPoint(x(), y()), QPoint(oball->x(), oball->y())); + Vector unit1 = Vector(TQPoint(x(), y()), TQPoint(oball->x(), oball->y())); unit1 = unit1.unit(); Vector unit2 = m_vector.unit(); @@ -286,8 +286,8 @@ void Ball::collisionDetect(double oldx, double oldy) { //kdDebug(12007) << "collided with WallPoint\n"; // iterate through the rst - QPtrList points; - for (QCanvasItemList::Iterator pit = it; pit != m_list.end(); ++pit) + TQPtrList points; + for (TQCanvasItemList::Iterator pit = it; pit != m_list.end(); ++pit) { if ((*pit)->rtti() == Rtti_WallPoint) { @@ -309,9 +309,9 @@ void Ball::collisionDetect(double oldx, double oldy) { //kdDebug(12007) << "-----\n"; const Wall *parentWall = iterpoint->parentWall(); - const QPoint qp(iterpoint->x() + parentWall->x(), iterpoint->y() + parentWall->y()); + const TQPoint qp(iterpoint->x() + parentWall->x(), iterpoint->y() + parentWall->y()); const Point p(qp.x(), qp.y()); - const QPoint qother = QPoint(parentWall->startPoint() == qp? parentWall->endPoint() : parentWall->startPoint()) + QPoint(parentWall->x(), parentWall->y()); + const TQPoint qother = TQPoint(parentWall->startPoint() == qp? parentWall->endPoint() : parentWall->startPoint()) + TQPoint(parentWall->x(), parentWall->y()); const Point other(qother.x(), qother.y()); // vector of wall @@ -371,7 +371,7 @@ void Ball::collisionDetect(double oldx, double oldy) } } - for (QCanvasItemList::Iterator it = m_list.begin(); it != m_list.end(); ++it) + for (TQCanvasItemList::Iterator it = m_list.begin(); it != m_list.end(); ++it) { CanvasItem *citem = dynamic_cast(*it); if (citem && citem->terrainCollisions()) @@ -393,15 +393,15 @@ void Ball::collisionDetect(double oldx, double oldy) wallCheck: { // check if I went through a wall - QCanvasItemList items; + TQCanvasItemList items; if (game) items = game->canvas()->allItems(); - for (QCanvasItemList::Iterator i = items.begin(); i != items.end(); ++i) + for (TQCanvasItemList::Iterator i = items.begin(); i != items.end(); ++i) { if ((*i)->rtti() != Rtti_Wall) continue; - QCanvasItem *item = (*i); + TQCanvasItem *item = (*i); Wall *wall = dynamic_cast(item); if (!wall || !wall->isVisible()) continue; @@ -446,20 +446,20 @@ void Ball::hideInfo() label->setVisible(false); } -void Ball::setName(const QString &name) +void Ball::setName(const TQString &name) { label->setText(name); } -void Ball::setCanvas(QCanvas *c) +void Ball::setCanvas(TQCanvas *c) { - QCanvasEllipse::setCanvas(c); + TQCanvasEllipse::setCanvas(c); label->setCanvas(c); } void Ball::setVisible(bool yes) { - QCanvasEllipse::setVisible(yes); + TQCanvasEllipse::setVisible(yes); label->setVisible(yes && game && game->isInfoShowing()); } diff --git a/kolf/ball.h b/kolf/ball.h index 098d82ef..a4252ec5 100644 --- a/kolf/ball.h +++ b/kolf/ball.h @@ -1,8 +1,8 @@ #ifndef KOLF_BALL_H #define KOLF_BALL_H -#include -#include +#include +#include #include @@ -11,10 +11,10 @@ enum BallState { Rolling = 0, Stopped, Holed }; -class Ball : public QCanvasEllipse, public CanvasItem +class Ball : public TQCanvasEllipse, public CanvasItem { public: - Ball(QCanvas *canvas); + Ball(TQCanvas *canvas); virtual void aboutToDie(); BallState currentState(); @@ -32,8 +32,8 @@ public: BallState curState() const { return state; } void setState(BallState newState); - QColor color() const { return m_color; } - void setColor(QColor color) { m_color = color; setBrush(color); } + TQColor color() const { return m_color; } + void setColor(TQColor color) { m_color = color; setBrush(color); } void setMoved(bool yes) { m_moved = yes; } bool moved() const { return m_moved; } @@ -69,13 +69,13 @@ public: virtual void showInfo(); virtual void hideInfo(); - virtual void setName(const QString &); - virtual void setCanvas(QCanvas *c); + virtual void setName(const TQString &); + virtual void setCanvas(TQCanvas *c); virtual void setVisible(bool yes); private: BallState state; - QColor m_color; + TQColor m_color; long int collisionId; double frictionMultiplier; @@ -95,9 +95,9 @@ private: bool m_collisionLock; bool m_doDetect; - QCanvasItemList m_list; + TQCanvasItemList m_list; - QCanvasText *label; + TQCanvasText *label; }; diff --git a/kolf/canvasitem.cpp b/kolf/canvasitem.cpp index 5e39257c..e8f199e3 100644 --- a/kolf/canvasitem.cpp +++ b/kolf/canvasitem.cpp @@ -1,21 +1,21 @@ -#include +#include #include #include "game.h" #include "canvasitem.h" -QCanvasRectangle *CanvasItem::onVStrut() +TQCanvasRectangle *CanvasItem::onVStrut() { - QCanvasItem *qthis = dynamic_cast(this); + TQCanvasItem *qthis = dynamic_cast(this); if (!qthis) return 0; - QCanvasItemList l = qthis->collisions(true); + TQCanvasItemList l = qthis->collisions(true); l.sort(); bool aboveVStrut = false; CanvasItem *item = 0; - QCanvasItem *qitem = 0; - for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) + TQCanvasItem *qitem = 0; + for (TQCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) { item = dynamic_cast(*it); if (item) @@ -30,7 +30,7 @@ QCanvasRectangle *CanvasItem::onVStrut() } } - QCanvasRectangle *ritem = dynamic_cast(qitem); + TQCanvasRectangle *ritem = dynamic_cast(qitem); return aboveVStrut && ritem? ritem : 0; } @@ -40,7 +40,7 @@ void CanvasItem::save(KConfig *cfg) cfg->writeEntry("dummykey", true); } -void CanvasItem::playSound(QString file, double vol) +void CanvasItem::playSound(TQString file, double vol) { if (game) game->playSound(file, vol); diff --git a/kolf/canvasitem.h b/kolf/canvasitem.h index e7a37cb6..ed897d27 100644 --- a/kolf/canvasitem.h +++ b/kolf/canvasitem.h @@ -1,7 +1,7 @@ #ifndef KOLF_CANVASITEM_H #define KOLF_CANVASITEM_H -#include +#include #include "config.h" @@ -30,7 +30,7 @@ public: /** * called if the item is made by user while editing, with the item that was selected on the hole; */ - virtual void selectedItem(QCanvasItem * /*item*/) {} + virtual void selectedItem(TQCanvasItem * /*item*/) {} /** * called after the item is moved the very first time by the game */ @@ -107,7 +107,7 @@ public: /** * update your Z value (this is called by various things when perhaps the value should change) if this is called by a vStrut, it will pass 'this'. */ - virtual void updateZ(QCanvasRectangle * /*vStrut*/ = 0) {}; + virtual void updateZ(TQCanvasRectangle * /*vStrut*/ = 0) {}; /** * clean up for prettyness */ @@ -125,11 +125,11 @@ 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(QWidget *parent) { return new DefaultConfig(parent); } + virtual Config *config(TQWidget *parent) { return new DefaultConfig(parent); } /** * returns other items that should be moveable (besides this one of course). */ - virtual QPtrList moveableItems() const { return QPtrList(); } + virtual TQPtrList moveableItems() const { return TQPtrList(); } /** * returns whether this can be moved by the user while editing. */ @@ -142,7 +142,7 @@ public: * call to play sound (ie, playSound("wall") plays kdedir/share/apps/kolf/sounds/wall.wav). * optionally, specify vol to be between 0-1, for no sound to full volume, respectively. */ - void playSound(QString file, double vol = 1); + void playSound(TQString file, double vol = 1); /** * called on ball's collision. Return if terrain collisions should be processed. @@ -160,8 +160,8 @@ public: */ virtual bool cornerResize() const { return false; } - QString name() const { return m_name; } - void setName(const QString &newname) { m_name = newname; } + TQString name() const { return m_name; } + void setName(const TQString &newname) { m_name = newname; } protected: /** @@ -172,10 +172,10 @@ protected: /** * returns the highest vertical strut the item is on */ - QCanvasRectangle *onVStrut(); + TQCanvasRectangle *onVStrut(); private: - QString m_name; + TQString m_name; int id; }; diff --git a/kolf/config.cpp b/kolf/config.cpp index 7652cf40..7c333755 100644 --- a/kolf/config.cpp +++ b/kolf/config.cpp @@ -1,13 +1,13 @@ -#include -#include +#include +#include #include #include #include "config.h" -Config::Config(QWidget *parent, const char *name) - : QFrame(parent, name) +Config::Config(TQWidget *parent, const char *name) + : TQFrame(parent, name) { startedUp = false; } @@ -33,14 +33,14 @@ void Config::changed() emit modified(); } -MessageConfig::MessageConfig(QString text, QWidget *parent, const char *name) +MessageConfig::MessageConfig(TQString text, TQWidget *parent, const char *name) : Config(parent, name) { - QVBoxLayout *layout = new QVBoxLayout(this, marginHint(), spacingHint()); - layout->addWidget(new QLabel(text, this)); + TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); + layout->addWidget(new TQLabel(text, this)); } -DefaultConfig::DefaultConfig(QWidget *parent, const char *name) +DefaultConfig::DefaultConfig(TQWidget *parent, const char *name) : MessageConfig(i18n("No configuration options"), parent, name) { } diff --git a/kolf/config.h b/kolf/config.h index 07c68938..4e0f26a6 100644 --- a/kolf/config.h +++ b/kolf/config.h @@ -1,14 +1,14 @@ #ifndef KOLF_CONFIG_H #define KOLF_CONFIG_H -#include +#include class Config : public QFrame { Q_OBJECT public: - Config(QWidget *parent, const char *name = 0); + Config(TQWidget *parent, const char *name = 0); void ctorDone(); signals: @@ -27,7 +27,7 @@ class MessageConfig : public Config Q_OBJECT public: - MessageConfig(QString text, QWidget *parent, const char *name = 0); + MessageConfig(TQString text, TQWidget *parent, const char *name = 0); }; // internal @@ -36,7 +36,7 @@ class DefaultConfig : public MessageConfig Q_OBJECT public: - DefaultConfig(QWidget *parent, const char *name = 0); + DefaultConfig(TQWidget *parent, const char *name = 0); }; #endif diff --git a/kolf/editor.cpp b/kolf/editor.cpp index 4cf6e61a..ae9cde32 100644 --- a/kolf/editor.cpp +++ b/kolf/editor.cpp @@ -1,39 +1,39 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "editor.h" #include "game.h" -Editor::Editor(ObjectList *list, QWidget *parent, const char *name) - : QWidget(parent, name) +Editor::Editor(ObjectList *list, TQWidget *parent, const char *name) + : TQWidget(parent, name) { this->list = list; config = 0; - hlayout = new QHBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + hlayout = new TQHBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - QVBoxLayout *vlayout = new QVBoxLayout(hlayout, KDialog::spacingHint()); - vlayout->addWidget(new QLabel(i18n("Add object:"), this)); + TQVBoxLayout *vlayout = new TQVBoxLayout(hlayout, KDialog::spacingHint()); + vlayout->addWidget(new TQLabel(i18n("Add object:"), this)); listbox = new KListBox(this, "Listbox"); vlayout->addWidget(listbox); hlayout->setStretchFactor(vlayout, 2); - QStringList items; + TQStringList items; Object *obj = 0; for (obj = list->first(); obj; obj = list->next()) items.append(obj->name()); listbox->insertStringList(items); - connect(listbox, SIGNAL(executed(QListBoxItem *)), SLOT(listboxExecuted(QListBoxItem *))); + connect(listbox, TQT_SIGNAL(executed(TQListBoxItem *)), TQT_SLOT(listboxExecuted(TQListBoxItem *))); } -void Editor::listboxExecuted(QListBoxItem * /*item*/) +void Editor::listboxExecuted(TQListBoxItem * /*item*/) { int curItem = listbox->currentItem(); if (curItem < 0) @@ -51,10 +51,10 @@ void Editor::setItem(CanvasItem *item) config->ctorDone(); hlayout->addWidget(config); hlayout->setStretchFactor(config, 2); - config->setFrameStyle(QFrame::Box | QFrame::Raised); + config->setFrameStyle(TQFrame::Box | TQFrame::Raised); config->setLineWidth(1); config->show(); - connect(config, SIGNAL(modified()), this, SIGNAL(changed())); + connect(config, TQT_SIGNAL(modified()), this, TQT_SIGNAL(changed())); } #include "editor.moc" diff --git a/kolf/editor.h b/kolf/editor.h index 4d5a3ac5..cfe998e6 100644 --- a/kolf/editor.h +++ b/kolf/editor.h @@ -1,7 +1,7 @@ #ifndef EDITOR_H_INCLUDED #define EDITOR_H_INCLUDED -#include +#include #include "game.h" @@ -15,7 +15,7 @@ class Editor : public QWidget Q_OBJECT public: - Editor(ObjectList *list, QWidget * = 0, const char * = 0); + Editor(ObjectList *list, TQWidget * = 0, const char * = 0); signals: void changed(); @@ -25,11 +25,11 @@ public slots: void setItem(CanvasItem *); private slots: - void listboxExecuted(QListBoxItem *); + void listboxExecuted(TQListBoxItem *); private: ObjectList *list; - QHBoxLayout *hlayout; + TQHBoxLayout *hlayout; KListBox *listbox; Config *config; }; diff --git a/kolf/floater.cpp b/kolf/floater.cpp index 73612bc8..ff42398a 100644 --- a/kolf/floater.cpp +++ b/kolf/floater.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include @@ -39,14 +39,14 @@ void FloaterGuide::setPoints(int xa, int ya, int xb, int yb) } } -Config *FloaterGuide::config(QWidget *parent) +Config *FloaterGuide::config(TQWidget *parent) { return floater->config(parent); } ///////////////////////// -Floater::Floater(QRect rect, QCanvas *canvas) +Floater::Floater(TQRect rect, TQCanvas *canvas) : Bridge(rect, canvas), speedfactor(16) { wall = 0; @@ -55,7 +55,7 @@ Floater::Floater(QRect rect, QCanvas *canvas) haventMoved = true; wall = new FloaterGuide(this, canvas); wall->setPoints(100, 100, 200, 200); - wall->setPen(QPen(wall->pen().color().light(), wall->pen().width() - 1)); + wall->setPen(TQPen(wall->pen().color().light(), wall->pen().width() - 1)); move(wall->endPoint().x(), wall->endPoint().y()); setTopWallVisible(false); @@ -95,7 +95,7 @@ void Floater::advance(int phase) if (phase == 1 && (xVelocity() || yVelocity())) { - if (Vector(origin, QPoint(x(), y())).magnitude() > vector.magnitude()) + if (Vector(origin, TQPoint(x(), y())).magnitude() > vector.magnitude()) { vector.setDirection(vector.direction() + M_PI); origin = (origin == wall->startPoint()? wall->endPoint() : wall->startPoint()); @@ -107,8 +107,8 @@ void Floater::advance(int phase) void Floater::reset() { - QPoint start = wall->startPoint() + QPoint(wall->x(), wall->y()); - QPoint end = wall->endPoint() + QPoint(wall->x(), wall->y()); + TQPoint start = wall->startPoint() + TQPoint(wall->x(), wall->y()); + TQPoint end = wall->endPoint() + TQPoint(wall->x(), wall->y()); vector = Vector(end, start); origin = end; @@ -117,9 +117,9 @@ void Floater::reset() setSpeed(speed); } -QPtrList Floater::moveableItems() const +TQPtrList Floater::moveableItems() const { - QPtrList ret(wall->moveableItems()); + TQPtrList ret(wall->moveableItems()); ret.append(wall); ret.append(point); return ret; @@ -167,8 +167,8 @@ void Floater::moveBy(double dx, double dy) if (!isEnabled()) return; - QCanvasItemList l = collisions(false); - for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) + TQCanvasItemList l = collisions(false); + for (TQCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) { CanvasItem *item = dynamic_cast(*it); @@ -197,7 +197,7 @@ void Floater::moveBy(double dx, double dy) // this call must come after we have tested for collisions, otherwise we skip them when saving! // that's a bad thing - QCanvasRectangle::moveBy(dx, dy); + TQCanvasRectangle::moveBy(dx, dy); // because we don't do Bridge::moveBy(); topWall->move(x(), y()); @@ -211,20 +211,20 @@ void Floater::moveBy(double dx, double dy) void Floater::saveState(StateDB *db) { - db->setPoint(QPoint(x(), y())); + db->setPoint(TQPoint(x(), y())); } void Floater::loadState(StateDB *db) { - const QPoint moveTo = db->point(); + const TQPoint moveTo = db->point(); move(moveTo.x(), moveTo.y()); } void Floater::save(KConfig *cfg) { cfg->writeEntry("speed", speed); - cfg->writeEntry("startPoint", QPoint(wall->startPoint().x() + wall->x(), wall->startPoint().y() + wall->y())); - cfg->writeEntry("endPoint", QPoint(wall->endPoint().x() + wall->x(), wall->endPoint().y() + wall->y())); + cfg->writeEntry("startPoint", TQPoint(wall->startPoint().x() + wall->x(), wall->startPoint().y() + wall->y())); + cfg->writeEntry("endPoint", TQPoint(wall->endPoint().x() + wall->x(), wall->endPoint().y() + wall->y())); doSave(cfg); } @@ -233,9 +233,9 @@ void Floater::load(KConfig *cfg) { move(firstPoint.x(), firstPoint.y()); - QPoint start(wall->startPoint() + QPoint(wall->x(), wall->y())); + TQPoint start(wall->startPoint() + TQPoint(wall->x(), wall->y())); start = cfg->readPointEntry("startPoint", &start); - QPoint end(wall->endPoint() + QPoint(wall->x(), wall->y())); + TQPoint end(wall->endPoint() + TQPoint(wall->x(), wall->y())); end = cfg->readPointEntry("endPoint", &end); wall->setPoints(start.x(), start.y(), end.x(), end.y()); wall->move(0, 0); @@ -248,24 +248,24 @@ void Floater::load(KConfig *cfg) void Floater::firstMove(int x, int y) { - firstPoint = QPoint(x, y); + firstPoint = TQPoint(x, y); } ///////////////////////// -FloaterConfig::FloaterConfig(Floater *floater, QWidget *parent) +FloaterConfig::FloaterConfig(Floater *floater, TQWidget *parent) : BridgeConfig(floater, parent) { this->floater = floater; m_vlayout->addStretch(); - m_vlayout->addWidget(new QLabel(i18n("Moving speed"), this)); - QHBoxLayout *hlayout = new QHBoxLayout(m_vlayout, spacingHint()); - hlayout->addWidget(new QLabel(i18n("Slow"), this)); - QSlider *slider = new QSlider(0, 20, 2, floater->curSpeed(), Qt::Horizontal, this); + m_vlayout->addWidget(new TQLabel(i18n("Moving speed"), this)); + TQHBoxLayout *hlayout = new TQHBoxLayout(m_vlayout, spacingHint()); + hlayout->addWidget(new TQLabel(i18n("Slow"), this)); + TQSlider *slider = new TQSlider(0, 20, 2, floater->curSpeed(), Qt::Horizontal, this); hlayout->addWidget(slider); - hlayout->addWidget(new QLabel(i18n("Fast"), this)); - connect(slider, SIGNAL(valueChanged(int)), this, SLOT(speedChanged(int))); + hlayout->addWidget(new TQLabel(i18n("Fast"), this)); + connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(speedChanged(int))); } void FloaterConfig::speedChanged(int news) diff --git a/kolf/floater.h b/kolf/floater.h index 486f3bc0..c22a8084 100644 --- a/kolf/floater.h +++ b/kolf/floater.h @@ -9,7 +9,7 @@ class FloaterConfig : public BridgeConfig Q_OBJECT public: - FloaterConfig(Floater *floater, QWidget *parent); + FloaterConfig(Floater *floater, TQWidget *parent); private slots: void speedChanged(int news); @@ -21,10 +21,10 @@ private: class FloaterGuide : public Wall { public: - FloaterGuide(Floater *floater, QCanvas *canvas) : Wall(canvas) { this->floater = floater; almostDead = false; } + 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(QWidget *parent); + virtual Config *config(TQWidget *parent); virtual void aboutToDelete(); virtual void aboutToDie(); @@ -36,7 +36,7 @@ private: class Floater : public Bridge { public: - Floater(QRect rect, QCanvas *canvas); + Floater(TQRect rect, TQCanvas *canvas); virtual bool collision(Ball *ball, long int id) { Bridge::collision(ball, id); return false; } virtual void saveState(StateDB *db); virtual void loadState(StateDB *db); @@ -51,8 +51,8 @@ public: virtual void editModeChanged(bool changed); virtual bool moveable() const { return false; } virtual void moveBy(double dx, double dy); - virtual Config *config(QWidget *parent) { return new FloaterConfig(this, parent); } - virtual QPtrList moveableItems() const; + virtual Config *config(TQWidget *parent) { return new FloaterConfig(this, parent); } + virtual TQPtrList moveableItems() const; virtual void advance(int phase); void setSpeed(int news); int curSpeed() const { return speed; } @@ -64,18 +64,18 @@ private: int speedfactor; int speed; FloaterGuide *wall; - QPoint origin; + TQPoint origin; Vector vector; bool noUpdateZ; bool haventMoved; - QPoint firstPoint; + TQPoint firstPoint; }; class FloaterObj : public Object { public: FloaterObj() { m_name = i18n("Floater"); m__name = "floater"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Floater(QRect(0, 0, 80, 40), canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Floater(TQRect(0, 0, 80, 40), canvas); } }; #endif diff --git a/kolf/game.cpp b/kolf/game.cpp index 55b324ce..d76ec2bc 100644 --- a/kolf/game.cpp +++ b/kolf/game.cpp @@ -15,36 +15,36 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -56,32 +56,32 @@ #include "game.h" -inline QString makeGroup(int id, int hole, QString name, int x, int y) +inline TQString makeGroup(int id, int hole, TQString name, int x, int y) { - return QString("%1-%2@%3,%4|%5").arg(hole).arg(name).arg(x).arg(y).arg(id); + return TQString("%1-%2@%3,%4|%5").arg(hole).arg(name).arg(x).arg(y).arg(id); } -inline QString makeStateGroup(int id, const QString &name) +inline TQString makeStateGroup(int id, const TQString &name) { - return QString("%1|%2").arg(name).arg(id); + return TQString("%1|%2").arg(name).arg(id); } ///////////////////////// -RectPoint::RectPoint(QColor color, RectItem *rect, QCanvas *canvas) - : QCanvasEllipse(canvas) +RectPoint::RectPoint(TQColor color, RectItem *rect, TQCanvas *canvas) + : TQCanvasEllipse(canvas) { setZ(9999); setSize(10, 10); this->rect = rect; - setBrush(QBrush(color)); + setBrush(TQBrush(color)); setSizeFactor(1.0); dontmove = false; } void RectPoint::moveBy(double dx, double dy) { - QCanvasEllipse::moveBy(dx, dy); + TQCanvasEllipse::moveBy(dx, dy); if (dontmove) { @@ -89,7 +89,7 @@ void RectPoint::moveBy(double dx, double dy) return; } - QCanvasItem *qitem = dynamic_cast(rect); + TQCanvasItem *qitem = dynamic_cast(rect); if (!qitem) return; @@ -101,7 +101,7 @@ void RectPoint::moveBy(double dx, double dy) rect->newSize(nw, nh); } -Config *RectPoint::config(QWidget *parent) +Config *RectPoint::config(TQWidget *parent) { CanvasItem *citem = dynamic_cast(rect); if (citem) @@ -112,11 +112,11 @@ Config *RectPoint::config(QWidget *parent) ///////////////////////// -Arrow::Arrow(QCanvas *canvas) - : QCanvasLine(canvas) +Arrow::Arrow(TQCanvas *canvas) + : TQCanvasLine(canvas) { - line1 = new QCanvasLine(canvas); - line2 = new QCanvasLine(canvas); + line1 = new TQCanvasLine(canvas); + line2 = new TQCanvasLine(canvas); m_angle = 0; m_length = 20; @@ -128,30 +128,30 @@ Arrow::Arrow(QCanvas *canvas) setVisible(false); } -void Arrow::setPen(QPen p) +void Arrow::setPen(TQPen p) { - QCanvasLine::setPen(p); + TQCanvasLine::setPen(p); line1->setPen(p); line2->setPen(p); } void Arrow::setZ(double newz) { - QCanvasLine::setZ(newz); + TQCanvasLine::setZ(newz); line1->setZ(newz); line2->setZ(newz); } void Arrow::setVisible(bool yes) { - QCanvasLine::setVisible(yes); + TQCanvasLine::setVisible(yes); line1->setVisible(yes); line2->setVisible(yes); } void Arrow::moveBy(double dx, double dy) { - QCanvasLine::moveBy(dx, dy); + TQCanvasLine::moveBy(dx, dy); line1->moveBy(dx, dy); line2->moveBy(dx, dy); } @@ -164,12 +164,12 @@ void Arrow::aboutToDie() void Arrow::updateSelf() { - QPoint start = startPoint(); - QPoint end(m_length * cos(m_angle), m_length * sin(m_angle)); + TQPoint start = startPoint(); + TQPoint end(m_length * cos(m_angle), m_length * sin(m_angle)); if (m_reversed) { - QPoint tmp(start); + TQPoint tmp(start); start = end; end = tmp; } @@ -181,40 +181,40 @@ void Arrow::updateSelf() const double angle1 = m_angle - M_PI / 2 - 1; line1->move(end.x() + x(), end.y() + y()); start = end; - end = QPoint(lineLen * cos(angle1), lineLen * sin(angle1)); + end = TQPoint(lineLen * cos(angle1), lineLen * sin(angle1)); line1->setPoints(0, 0, end.x(), end.y()); const double angle2 = m_angle + M_PI / 2 + 1; line2->move(start.x() + x(), start.y() + y()); - end = QPoint(lineLen * cos(angle2), lineLen * sin(angle2)); + end = TQPoint(lineLen * cos(angle2), lineLen * sin(angle2)); line2->setPoints(0, 0, end.x(), end.y()); } ///////////////////////// -BridgeConfig::BridgeConfig(Bridge *bridge, QWidget *parent) +BridgeConfig::BridgeConfig(Bridge *bridge, TQWidget *parent) : Config(parent) { this->bridge = bridge; - m_vlayout = new QVBoxLayout(this, marginHint(), spacingHint()); - QGridLayout *layout = new QGridLayout(m_vlayout, 2, 3, spacingHint()); - layout->addWidget(new QLabel(i18n("Walls on:"), this), 0, 0); - top = new QCheckBox(i18n("&Top"), this); + 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); + top = new TQCheckBox(i18n("&Top"), this); layout->addWidget(top, 0, 1); - connect(top, SIGNAL(toggled(bool)), this, SLOT(topWallChanged(bool))); + connect(top, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(topWallChanged(bool))); top->setChecked(bridge->topWallVisible()); - bot = new QCheckBox(i18n("&Bottom"), this); + bot = new TQCheckBox(i18n("&Bottom"), this); layout->addWidget(bot, 1, 1); - connect(bot, SIGNAL(toggled(bool)), this, SLOT(botWallChanged(bool))); + connect(bot, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(botWallChanged(bool))); bot->setChecked(bridge->botWallVisible()); - left = new QCheckBox(i18n("&Left"), this); + left = new TQCheckBox(i18n("&Left"), this); layout->addWidget(left, 1, 0); - connect(left, SIGNAL(toggled(bool)), this, SLOT(leftWallChanged(bool))); + connect(left, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(leftWallChanged(bool))); left->setChecked(bridge->leftWallVisible()); - right = new QCheckBox(i18n("&Right"), this); + right = new TQCheckBox(i18n("&Right"), this); layout->addWidget(right, 1, 2); - connect(right, SIGNAL(toggled(bool)), this, SLOT(rightWallChanged(bool))); + connect(right, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(rightWallChanged(bool))); right->setChecked(bridge->rightWallVisible()); } @@ -244,11 +244,11 @@ void BridgeConfig::rightWallChanged(bool yes) ///////////////////////// -Bridge::Bridge(QRect rect, QCanvas *canvas) - : QCanvasRectangle(rect, canvas) +Bridge::Bridge(TQRect rect, TQCanvas *canvas) + : TQCanvasRectangle(rect, canvas) { - QColor color("#92772D"); - setBrush(QBrush(color)); + TQColor color("#92772D"); + setBrush(TQBrush(color)); setPen(NoPen); setZ(998); @@ -298,9 +298,9 @@ void Bridge::setGame(KolfGame *game) rightWall->setGame(game); } -void Bridge::setWallColor(QColor color) +void Bridge::setWallColor(TQColor color) { - topWall->setPen(QPen(color.dark(), 3)); + topWall->setPen(TQPen(color.dark(), 3)); botWall->setPen(topWall->pen()); leftWall->setPen(topWall->pen()); rightWall->setPen(topWall->pen()); @@ -327,7 +327,7 @@ void Bridge::editModeChanged(bool changed) void Bridge::moveBy(double dx, double dy) { - QCanvasRectangle::moveBy(dx, dy); + TQCanvasRectangle::moveBy(dx, dy); point->dontMove(); point->move(x() + width(), y() + height()); @@ -337,8 +337,8 @@ void Bridge::moveBy(double dx, double dy) leftWall->move(x(), y()); rightWall->move(x(), y()); - QCanvasItemList list = collisions(true); - for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) + TQCanvasItemList list = collisions(true); + for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) { CanvasItem *citem = dynamic_cast(*it); if (citem) @@ -375,9 +375,9 @@ void Bridge::doSave(KConfig *cfg) cfg->writeEntry("rightWallVisible", rightWallVisible()); } -QPtrList Bridge::moveableItems() const +TQPtrList Bridge::moveableItems() const { - QPtrList ret; + TQPtrList ret; ret.append(point); return ret; } @@ -389,7 +389,7 @@ void Bridge::newSize(int width, int height) void Bridge::setSize(int width, int height) { - QCanvasRectangle::setSize(width, height); + TQCanvasRectangle::setSize(width, height); topWall->setPoints(0, 0, width, 0); botWall->setPoints(0, height, width, height); @@ -401,23 +401,23 @@ void Bridge::setSize(int width, int height) ///////////////////////// -WindmillConfig::WindmillConfig(Windmill *windmill, QWidget *parent) +WindmillConfig::WindmillConfig(Windmill *windmill, TQWidget *parent) : BridgeConfig(windmill, parent) { this->windmill = windmill; m_vlayout->addStretch(); - QCheckBox *check = new QCheckBox(i18n("Windmill on bottom"), this); + TQCheckBox *check = new TQCheckBox(i18n("Windmill on bottom"), this); check->setChecked(windmill->bottom()); - connect(check, SIGNAL(toggled(bool)), this, SLOT(endChanged(bool))); + connect(check, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(endChanged(bool))); m_vlayout->addWidget(check); - QHBoxLayout *hlayout = new QHBoxLayout(m_vlayout, spacingHint()); - hlayout->addWidget(new QLabel(i18n("Slow"), this)); - QSlider *slider = new QSlider(1, 10, 1, windmill->curSpeed(), Qt::Horizontal, this); + TQHBoxLayout *hlayout = new TQHBoxLayout(m_vlayout, spacingHint()); + hlayout->addWidget(new TQLabel(i18n("Slow"), this)); + TQSlider *slider = new TQSlider(1, 10, 1, windmill->curSpeed(), Qt::Horizontal, this); hlayout->addWidget(slider); - hlayout->addWidget(new QLabel(i18n("Fast"), this)); - connect(slider, SIGNAL(valueChanged(int)), this, SLOT(speedChanged(int))); + hlayout->addWidget(new TQLabel(i18n("Fast"), this)); + connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(speedChanged(int))); endChanged(check->isChecked()); } @@ -449,11 +449,11 @@ void WindmillConfig::endChanged(bool bottom) ///////////////////////// -Windmill::Windmill(QRect rect, QCanvas *canvas) +Windmill::Windmill(TQRect rect, TQCanvas *canvas) : Bridge(rect, canvas), speedfactor(16), m_bottom(true) { guard = new WindmillGuard(canvas); - guard->setPen(QPen(black, 5)); + guard->setPen(TQPen(black, 5)); guard->setVisible(true); guard->setAlwaysShow(true); setSpeed(5); @@ -583,12 +583,12 @@ void WindmillGuard::advance(int phase) ///////////////////////// -Sign::Sign(QCanvas *canvas) - : Bridge(QRect(0, 0, 110, 40), canvas) +Sign::Sign(TQCanvas *canvas) + : Bridge(TQRect(0, 0, 110, 40), canvas) { setZ(998.8); m_text = m_untranslatedText = i18n("New Text"); - setBrush(QBrush(white)); + setBrush(TQBrush(white)); setWallColor(black); setWallZ(z() + .01); @@ -613,7 +613,7 @@ void Sign::save(KConfig *cfg) doSave(cfg); } -void Sign::setText(const QString &text) +void Sign::setText(const TQString &text) { m_text = text; m_untranslatedText = text; @@ -621,36 +621,36 @@ void Sign::setText(const QString &text) update(); } -void Sign::draw(QPainter &painter) +void Sign::draw(TQPainter &painter) { Bridge::draw(painter); - painter.setPen(QPen(black, 1)); - QSimpleRichText txt(m_text, kapp->font()); + painter.setPen(TQPen(black, 1)); + TQSimpleRichText txt(m_text, kapp->font()); const int indent = wallPen().width() + 3; txt.setWidth(width() - 2*indent); - QColorGroup colorGroup; - colorGroup.setColor(QColorGroup::Foreground, black); - colorGroup.setColor(QColorGroup::Text, black); - colorGroup.setColor(QColorGroup::Background, black); - colorGroup.setColor(QColorGroup::Base, black); - txt.draw(&painter, x() + indent, y(), QRect(x() + indent, y(), width() - indent, height() - indent), colorGroup); + 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); } ///////////////////////// -SignConfig::SignConfig(Sign *sign, QWidget *parent) +SignConfig::SignConfig(Sign *sign, TQWidget *parent) : BridgeConfig(sign, parent) { this->sign = sign; m_vlayout->addStretch(); - m_vlayout->addWidget(new QLabel(i18n("Sign HTML:"), this)); + m_vlayout->addWidget(new TQLabel(i18n("Sign HTML:"), this)); KLineEdit *name = new KLineEdit(sign->text(), this); m_vlayout->addWidget(name); - connect(name, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged(const QString &))); + connect(name, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(textChanged(const TQString &))); } -void SignConfig::textChanged(const QString &text) +void SignConfig::textChanged(const TQString &text) { sign->setText(text); changed(); @@ -658,27 +658,27 @@ void SignConfig::textChanged(const QString &text) ///////////////////////// -EllipseConfig::EllipseConfig(Ellipse *ellipse, QWidget *parent) +EllipseConfig::EllipseConfig(Ellipse *ellipse, TQWidget *parent) : Config(parent), slow1(0), fast1(0), slow2(0), fast2(0), slider1(0), slider2(0) { this->ellipse = ellipse; - m_vlayout = new QVBoxLayout(this, marginHint(), spacingHint()); + m_vlayout = new TQVBoxLayout(this, marginHint(), spacingHint()); - QCheckBox *check = new QCheckBox(i18n("Enable show/hide"), this); + TQCheckBox *check = new TQCheckBox(i18n("Enable show/hide"), this); m_vlayout->addWidget(check); - connect(check, SIGNAL(toggled(bool)), this, SLOT(check1Changed(bool))); + connect(check, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(check1Changed(bool))); check->setChecked(ellipse->changeEnabled()); - QHBoxLayout *hlayout = new QHBoxLayout(m_vlayout, spacingHint()); - slow1 = new QLabel(i18n("Slow"), this); + TQHBoxLayout *hlayout = new TQHBoxLayout(m_vlayout, spacingHint()); + slow1 = new TQLabel(i18n("Slow"), this); hlayout->addWidget(slow1); - slider1 = new QSlider(1, 100, 5, 100 - ellipse->changeEvery(), Qt::Horizontal, this); + slider1 = new TQSlider(1, 100, 5, 100 - ellipse->changeEvery(), Qt::Horizontal, this); hlayout->addWidget(slider1); - fast1 = new QLabel(i18n("Fast"), this); + fast1 = new TQLabel(i18n("Fast"), this); hlayout->addWidget(fast1); - connect(slider1, SIGNAL(valueChanged(int)), this, SLOT(value1Changed(int))); + connect(slider1, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(value1Changed(int))); check1Changed(ellipse->changeEnabled()); @@ -726,8 +726,8 @@ void EllipseConfig::check2Changed(bool on) ///////////////////////// -Ellipse::Ellipse(QCanvas *canvas) - : QCanvasEllipse(canvas) +Ellipse::Ellipse(TQCanvas *canvas) + : TQCanvasEllipse(canvas) { savingDone(); setChangeEnabled(false); @@ -753,21 +753,21 @@ void Ellipse::setChangeEnabled(bool changeEnabled) setVisible(true); } -QPtrList Ellipse::moveableItems() const +TQPtrList Ellipse::moveableItems() const { - QPtrList ret; + TQPtrList ret; ret.append(point); return ret; } void Ellipse::newSize(int width, int height) { - QCanvasEllipse::setSize(width, height); + TQCanvasEllipse::setSize(width, height); } void Ellipse::moveBy(double dx, double dy) { - QCanvasEllipse::moveBy(dx, dy); + TQCanvasEllipse::moveBy(dx, dy); point->dontMove(); point->move(x() + width() / 2, y() + height() / 2); @@ -781,7 +781,7 @@ void Ellipse::editModeChanged(bool changed) void Ellipse::advance(int phase) { - QCanvasEllipse::advance(phase); + TQCanvasEllipse::advance(phase); if (phase == 1 && m_changeEnabled && !dontHide) { @@ -812,7 +812,7 @@ void Ellipse::save(KConfig *cfg) cfg->writeEntry("height", height()); } -Config *Ellipse::config(QWidget *parent) +Config *Ellipse::config(TQWidget *parent) { return new EllipseConfig(this, parent); } @@ -830,18 +830,18 @@ void Ellipse::savingDone() ///////////////////////// -Puddle::Puddle(QCanvas *canvas) +Puddle::Puddle(TQCanvas *canvas) : Ellipse(canvas) { setSize(45, 30); - QBrush brush; - QPixmap pic; + TQBrush brush; + TQPixmap pic; - if (!QPixmapCache::find("puddle", pic)) + if (!TQPixmapCache::find("puddle", pic)) { pic.load(locate("appdata", "pics/puddle.png")); - QPixmapCache::insert("puddle", pic); + TQPixmapCache::insert("puddle", pic); } brush.setPixmap(pic); @@ -859,7 +859,7 @@ bool Puddle::collision(Ball *ball, long int /*id*/) { if (ball->isVisible()) { - QCanvasRectangle i(QRect(ball->x(), ball->y(), 1, 1), canvas()); + TQCanvasRectangle i(TQRect(ball->x(), ball->y(), 1, 1), canvas()); i.setVisible(true); // is center of ball in? @@ -883,18 +883,18 @@ bool Puddle::collision(Ball *ball, long int /*id*/) ///////////////////////// -Sand::Sand(QCanvas *canvas) +Sand::Sand(TQCanvas *canvas) : Ellipse(canvas) { setSize(45, 40); - QBrush brush; - QPixmap pic; + TQBrush brush; + TQPixmap pic; - if (!QPixmapCache::find("sand", pic)) + if (!TQPixmapCache::find("sand", pic)) { pic.load(locate("appdata", "pics/sand.png")); - QPixmapCache::insert("sand", pic); + TQPixmapCache::insert("sand", pic); } brush.setPixmap(pic); @@ -910,7 +910,7 @@ Sand::Sand(QCanvas *canvas) bool Sand::collision(Ball *ball, long int /*id*/) { - QCanvasRectangle i(QRect(ball->x(), ball->y(), 1, 1), canvas()); + TQCanvasRectangle i(TQRect(ball->x(), ball->y(), 1, 1), canvas()); i.setVisible(true); // is center of ball in? @@ -930,19 +930,19 @@ bool Sand::collision(Ball *ball, long int /*id*/) ///////////////////////// -Putter::Putter(QCanvas *canvas) - : QCanvasLine(canvas) +Putter::Putter(TQCanvas *canvas) + : TQCanvasLine(canvas) { m_showGuideLine = true; oneDegree = M_PI / 180; len = 9; angle = 0; - guideLine = new QCanvasLine(canvas); - guideLine->setPen(QPen(white, 1, QPen::DotLine)); + guideLine = new TQCanvasLine(canvas); + guideLine->setPen(TQPen(white, 1, TQPen::DotLine)); guideLine->setZ(998.8); - setPen(QPen(black, 4)); + setPen(TQPen(black, 4)); putterWidth = 11; maxAngle = 2 * M_PI; @@ -964,7 +964,7 @@ void Putter::hideInfo() void Putter::moveBy(double dx, double dy) { - QCanvasLine::moveBy(dx, dy); + TQCanvasLine::moveBy(dx, dy); guideLine->move(x(), y()); } @@ -976,7 +976,7 @@ void Putter::setShowGuideLine(bool yes) void Putter::setVisible(bool yes) { - QCanvasLine::setVisible(yes); + TQCanvasLine::setVisible(yes); guideLine->setVisible(m_showGuideLine? yes : false); } @@ -1028,8 +1028,8 @@ void Putter::finishMe() midPoint.setX(cos(angle) * len); midPoint.setY(-sin(angle) * len); - QPoint start; - QPoint end; + TQPoint start; + TQPoint end; if (midPoint.y() || !midPoint.x()) { @@ -1053,12 +1053,12 @@ void Putter::finishMe() ///////////////////////// -Bumper::Bumper(QCanvas *canvas) - : QCanvasEllipse(20, 20, canvas) +Bumper::Bumper(TQCanvas *canvas) + : TQCanvasEllipse(20, 20, canvas) { setZ(-25); - firstColor = QColor("#E74804"); + firstColor = TQColor("#E74804"); secondColor = firstColor.light(); count = 0; @@ -1078,7 +1078,7 @@ void Bumper::aboutToDie() void Bumper::moveBy(double dx, double dy) { - QCanvasEllipse::moveBy(dx, dy); + TQCanvasEllipse::moveBy(dx, dy); //const double insideLen = (double)(width() - inside->width()) / 2.0; inside->move(x(), y()); } @@ -1090,7 +1090,7 @@ void Bumper::editModeChanged(bool changed) void Bumper::advance(int phase) { - QCanvasEllipse::advance(phase); + TQCanvasEllipse::advance(phase); if (phase == 1) { @@ -1113,8 +1113,8 @@ bool Bumper::collision(Ball *ball, long int /*id*/) if (speed > 8) speed = 8; - const QPoint start(x(), y()); - const QPoint end(ball->x(), ball->y()); + const TQPoint start(x(), y()); + const TQPoint end(ball->x(), ball->y()); Vector betweenVector(start, end); betweenVector.setMagnitude(speed); @@ -1134,8 +1134,8 @@ bool Bumper::collision(Ball *ball, long int /*id*/) ///////////////////////// -Hole::Hole(QColor color, QCanvas *canvas) - : QCanvasEllipse(15, 15, canvas) +Hole::Hole(TQColor color, TQCanvas *canvas) + : TQCanvasEllipse(15, 15, canvas) { setZ(998.1); setPen(black); @@ -1146,7 +1146,7 @@ bool Hole::collision(Ball *ball, long int /*id*/) { bool wasCenter = false; - switch (result(QPoint(ball->x(), ball->y()), ball->curVector().magnitude(), &wasCenter)) + switch (result(TQPoint(ball->x(), ball->y()), ball->curVector().magnitude(), &wasCenter)) { case Result_Holed: place(ball, wasCenter); @@ -1159,13 +1159,13 @@ bool Hole::collision(Ball *ball, long int /*id*/) return true; } -HoleResult Hole::result(QPoint p, double s, bool * /*wasCenter*/) +HoleResult Hole::result(TQPoint p, double s, bool * /*wasCenter*/) { const double longestRadius = width() > height()? width() : height(); if (s > longestRadius / 5.0) return Result_Miss; - QCanvasRectangle i(QRect(p, QSize(1, 1)), canvas()); + TQCanvasRectangle i(TQRect(p, TQSize(1, 1)), canvas()); i.setVisible(true); // is center of ball in cup? @@ -1179,19 +1179,19 @@ HoleResult Hole::result(QPoint p, double s, bool * /*wasCenter*/) ///////////////////////// -Cup::Cup(QCanvas *canvas) - : Hole(QColor("#808080"), canvas) +Cup::Cup(TQCanvas *canvas) + : Hole(TQColor("#808080"), canvas) { - if (!QPixmapCache::find("cup", pixmap)) + if (!TQPixmapCache::find("cup", pixmap)) { pixmap.load(locate("appdata", "pics/cup.png")); - QPixmapCache::insert("cup", pixmap); + TQPixmapCache::insert("cup", pixmap); } } -void Cup::draw(QPainter &p) +void Cup::draw(TQPainter &p) { - p.drawPixmap(QPoint(x() - width() / 2, y() - height() / 2), pixmap); + p.drawPixmap(TQPoint(x() - width() / 2, y() - height() / 2), pixmap); } bool Cup::place(Ball *ball, bool /*wasCenter*/) @@ -1214,7 +1214,7 @@ void Cup::save(KConfig *cfg) ///////////////////////// -BlackHole::BlackHole(QCanvas *canvas) +BlackHole::BlackHole(TQCanvas *canvas) : Hole(black, canvas), exitDeg(0) { infoLine = 0; @@ -1222,16 +1222,16 @@ BlackHole::BlackHole(QCanvas *canvas) m_maxSpeed = 5.0; runs = 0; - const QColor myColor((QRgb)(kapp->random() % 0x01000000)); + const TQColor myColor((QRgb)(kapp->random() % 0x01000000)); - outside = new QCanvasEllipse(canvas); + outside = new TQCanvasEllipse(canvas); outside->setZ(z() - .001); - outside->setBrush(QBrush(myColor)); + outside->setBrush(TQBrush(myColor)); setBrush(black); exitItem = new BlackHoleExit(this, canvas); - exitItem->setPen(QPen(myColor, 6)); + exitItem->setPen(TQPen(myColor, 6)); exitItem->setX(300); exitItem->setY(100); @@ -1248,9 +1248,9 @@ BlackHole::BlackHole(QCanvas *canvas) void BlackHole::showInfo() { delete infoLine; - infoLine = new QCanvasLine(canvas()); + infoLine = new TQCanvasLine(canvas()); infoLine->setVisible(true); - infoLine->setPen(QPen(exitItem->pen().color(), 2)); + infoLine->setPen(TQPen(exitItem->pen().color(), 2)); infoLine->setZ(10000); infoLine->setPoints(x(), y(), exitItem->x(), exitItem->y()); @@ -1285,7 +1285,7 @@ void BlackHole::updateInfo() void BlackHole::moveBy(double dx, double dy) { - QCanvasEllipse::moveBy(dx, dy); + TQCanvasEllipse::moveBy(dx, dy); outside->move(x(), y()); updateInfo(); } @@ -1300,9 +1300,9 @@ void BlackHole::setExitDeg(int newdeg) finishMe(); } -QPtrList BlackHole::moveableItems() const +TQPtrList BlackHole::moveableItems() const { - QPtrList ret; + TQPtrList ret; ret.append(exitItem); return ret; } @@ -1310,8 +1310,8 @@ QPtrList BlackHole::moveableItems() const BlackHoleTimer::BlackHoleTimer(Ball *ball, double speed, int msec) : m_speed(speed), m_ball(ball) { - QTimer::singleShot(msec, this, SLOT(mySlot())); - QTimer::singleShot(msec / 2, this, SLOT(myMidSlot())); + TQTimer::singleShot(msec, this, TQT_SLOT(mySlot())); + TQTimer::singleShot(msec / 2, this, TQT_SLOT(myMidSlot())); } void BlackHoleTimer::mySlot() @@ -1341,11 +1341,11 @@ bool BlackHole::place(Ball *ball, bool /*wasCenter*/) ball->setVisible(false); ball->setForceStillGoing(true); - double magnitude = Vector(QPoint(x(), y()), QPoint(exitItem->x(), exitItem->y())).magnitude(); + double magnitude = Vector(TQPoint(x(), y()), TQPoint(exitItem->x(), exitItem->y())).magnitude(); BlackHoleTimer *timer = new BlackHoleTimer(ball, speed, magnitude * 2.5 - speed * 35 + 500); - connect(timer, SIGNAL(eject(Ball *, double)), this, SLOT(eject(Ball *, double))); - connect(timer, SIGNAL(halfway()), this, SLOT(halfway())); + connect(timer, TQT_SIGNAL(eject(Ball *, double)), this, TQT_SLOT(eject(Ball *, double))); + connect(timer, TQT_SIGNAL(halfway()), this, TQT_SLOT(halfway())); playSound("blackhole"); return false; @@ -1382,7 +1382,7 @@ void BlackHole::halfway() void BlackHole::load(KConfig *cfg) { - QPoint exit = cfg->readPointEntry("exit", &exit); + TQPoint exit = cfg->readPointEntry("exit", &exit); exitItem->setX(exit.x()); exitItem->setY(exit.y()); exitDeg = cfg->readNumEntry("exitDeg", exitDeg); @@ -1397,9 +1397,9 @@ void BlackHole::load(KConfig *cfg) void BlackHole::finishMe() { double radians = deg2rad(exitDeg); - QPoint midPoint(0, 0); - QPoint start; - QPoint end; + TQPoint midPoint(0, 0); + TQPoint start; + TQPoint end; const int width = 15; if (midPoint.y() || !midPoint.x()) @@ -1423,7 +1423,7 @@ void BlackHole::finishMe() void BlackHole::save(KConfig *cfg) { - cfg->writeEntry("exit", QPoint(exitItem->x(), exitItem->y())); + cfg->writeEntry("exit", TQPoint(exitItem->x(), exitItem->y())); cfg->writeEntry("exitDeg", exitDeg); cfg->writeEntry("minspeed", m_minSpeed); cfg->writeEntry("maxspeed", m_maxSpeed); @@ -1431,8 +1431,8 @@ void BlackHole::save(KConfig *cfg) ///////////////////////// -BlackHoleExit::BlackHoleExit(BlackHole *blackHole, QCanvas *canvas) - : QCanvasLine(canvas) +BlackHoleExit::BlackHoleExit(BlackHole *blackHole, TQCanvas *canvas) + : TQCanvasLine(canvas) { this->blackHole = blackHole; arrow = new Arrow(canvas); @@ -1450,15 +1450,15 @@ void BlackHoleExit::aboutToDie() void BlackHoleExit::moveBy(double dx, double dy) { - QCanvasLine::moveBy(dx, dy); + TQCanvasLine::moveBy(dx, dy); arrow->move(x(), y()); blackHole->updateInfo(); } -void BlackHoleExit::setPen(QPen p) +void BlackHoleExit::setPen(TQPen p) { - QCanvasLine::setPen(p); - arrow->setPen(QPen(p.color(), 1)); + TQCanvasLine::setPen(p); + arrow->setPen(TQPen(p.color(), 1)); } void BlackHoleExit::updateArrowAngle() @@ -1492,42 +1492,42 @@ void BlackHoleExit::hideInfo() arrow->setVisible(false); } -Config *BlackHoleExit::config(QWidget *parent) +Config *BlackHoleExit::config(TQWidget *parent) { return blackHole->config(parent); } ///////////////////////// -BlackHoleConfig::BlackHoleConfig(BlackHole *blackHole, QWidget *parent) +BlackHoleConfig::BlackHoleConfig(BlackHole *blackHole, TQWidget *parent) : Config(parent) { this->blackHole = blackHole; - QVBoxLayout *layout = new QVBoxLayout(this, marginHint(), spacingHint()); - layout->addWidget(new QLabel(i18n("Exiting ball angle:"), this)); - QSpinBox *deg = new QSpinBox(0, 359, 10, this); - deg->setSuffix(QString(" ") + i18n("degrees")); + TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); + layout->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); - connect(deg, SIGNAL(valueChanged(int)), this, SLOT(degChanged(int))); + connect(deg, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(degChanged(int))); layout->addStretch(); - QHBoxLayout *hlayout = new QHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new QLabel(i18n("Minimum exit speed:"), this)); + TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); + hlayout->addWidget(new TQLabel(i18n("Minimum exit speed:"), this)); KDoubleNumInput *min = new KDoubleNumInput(this); min->setRange(0, 8, 1, true); hlayout->addWidget(min); - connect(min, SIGNAL(valueChanged(double)), this, SLOT(minChanged(double))); + connect(min, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(minChanged(double))); min->setValue(blackHole->minSpeed()); - hlayout = new QHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new QLabel(i18n("Maximum:"), this)); + hlayout = new TQHBoxLayout(layout, spacingHint()); + hlayout->addWidget(new TQLabel(i18n("Maximum:"), this)); KDoubleNumInput *max = new KDoubleNumInput(this); max->setRange(1, 10, 1, true); hlayout->addWidget(max); - connect(max, SIGNAL(valueChanged(double)), this, SLOT(maxChanged(double))); + connect(max, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(maxChanged(double))); max->setValue(blackHole->maxSpeed()); } @@ -1551,8 +1551,8 @@ void BlackHoleConfig::maxChanged(double news) ///////////////////////// -WallPoint::WallPoint(bool start, Wall *wall, QCanvas *canvas) - : QCanvasEllipse(canvas) +WallPoint::WallPoint(bool start, Wall *wall, TQCanvas *canvas) + : TQCanvasEllipse(canvas) { this->wall = wall; this->start = start; @@ -1563,7 +1563,7 @@ WallPoint::WallPoint(bool start, Wall *wall, QCanvas *canvas) dontmove = false; move(0, 0); - QPoint p; + TQPoint p; if (start) p = wall->startPoint(); else @@ -1578,9 +1578,9 @@ void WallPoint::clean() setSize(7, 7); update(); - QCanvasItem *onPoint = 0; - QCanvasItemList l = collisions(true); - for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) + TQCanvasItem *onPoint = 0; + TQCanvasItemList l = collisions(true); + for (TQCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) if ((*it)->rtti() == rtti()) onPoint = (*it); @@ -1592,7 +1592,7 @@ void WallPoint::clean() void WallPoint::moveBy(double dx, double dy) { - QCanvasEllipse::moveBy(dx, dy); + TQCanvasEllipse::moveBy(dx, dy); if (!editing) updateVisible(); @@ -1629,8 +1629,8 @@ void WallPoint::updateVisible() else { visible = true; - QCanvasItemList l = collisions(true); - for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) + TQCanvasItemList l = collisions(true); + for (TQCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) if ((*it)->rtti() == rtti()) visible = false; } @@ -1651,8 +1651,8 @@ bool WallPoint::collision(Ball *ball, long int id) long int tempLastId = lastId; lastId = id; - QCanvasItemList l = collisions(true); - for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) + TQCanvasItemList l = collisions(true); + for (TQCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) { if ((*it)->rtti() == rtti()) { @@ -1683,8 +1683,8 @@ bool WallPoint::collision(Ball *ball, long int id) { bool weirdBounce = visible; - QPoint relStart(start? wall->startPoint() : wall->endPoint()); - QPoint relEnd(start? wall->endPoint() : wall->startPoint()); + TQPoint relStart(start? wall->startPoint() : wall->endPoint()); + TQPoint relEnd(start? wall->endPoint() : wall->startPoint()); Vector wallVector(relStart, relEnd); wallVector.setDirection(-wallVector.direction()); @@ -1725,8 +1725,8 @@ bool WallPoint::collision(Ball *ball, long int id) ///////////////////////// -Wall::Wall(QCanvas *canvas) - : QCanvasLine(canvas) +Wall::Wall(TQCanvas *canvas) + : TQCanvasLine(canvas) { editing = false; lastId = INT_MAX - 10; @@ -1743,7 +1743,7 @@ Wall::Wall(QCanvas *canvas) endItem = new WallPoint(false, this, canvas); startItem->setVisible(true); endItem->setVisible(true); - setPen(QPen(darkRed, 3)); + setPen(TQPen(darkRed, 3)); setPoints(-15, 10, 15, -5); @@ -1752,7 +1752,7 @@ Wall::Wall(QCanvas *canvas) editModeChanged(false); } -void Wall::selectedItem(QCanvasItem *item) +void Wall::selectedItem(TQCanvasItem *item) { if (item->rtti() == Rtti_WallPoint) { @@ -1777,7 +1777,7 @@ void Wall::setAlwaysShow(bool yes) void Wall::setVisible(bool yes) { - QCanvasLine::setVisible(yes); + TQCanvasLine::setVisible(yes); startItem->setVisible(yes); endItem->setVisible(yes); @@ -1787,21 +1787,21 @@ void Wall::setVisible(bool yes) void Wall::setZ(double newz) { - QCanvasLine::setZ(newz); + TQCanvasLine::setZ(newz); if (startItem) startItem->setZ(newz + .002); if (endItem) endItem->setZ(newz + .001); } -void Wall::setPen(QPen p) +void Wall::setPen(TQPen p) { - QCanvasLine::setPen(p); + TQCanvasLine::setPen(p); if (startItem) - startItem->setBrush(QBrush(p.color())); + startItem->setBrush(TQBrush(p.color())); if (endItem) - endItem->setBrush(QBrush(p.color())); + endItem->setBrush(TQBrush(p.color())); } void Wall::aboutToDie() @@ -1817,9 +1817,9 @@ void Wall::setGame(KolfGame *game) endItem->setGame(game); } -QPtrList Wall::moveableItems() const +TQPtrList Wall::moveableItems() const { - QPtrList ret; + TQPtrList ret; ret.append(startItem); ret.append(endItem); return ret; @@ -1827,7 +1827,7 @@ QPtrList Wall::moveableItems() const void Wall::moveBy(double dx, double dy) { - QCanvasLine::moveBy(dx, dy); + TQCanvasLine::moveBy(dx, dy); if (!startItem || !endItem) return; @@ -1840,26 +1840,26 @@ void Wall::moveBy(double dx, double dy) void Wall::setVelocity(double vx, double vy) { - QCanvasLine::setVelocity(vx, vy); + TQCanvasLine::setVelocity(vx, vy); /* startItem->setVelocity(vx, vy); endItem->setVelocity(vx, vy); */ } -QPointArray Wall::areaPoints() const +TQPointArray Wall::areaPoints() const { // editing we want full width for easy moving if (editing) - return QCanvasLine::areaPoints(); + return TQCanvasLine::areaPoints(); - // lessen width, for QCanvasLine::areaPoints() likes + // lessen width, for TQCanvasLine::areaPoints() likes // to make lines _very_ fat :( // from qcanvas.cpp, only the stuff for a line width of 1 taken // it's all squished because I don't want my // line counts to count code I didn't write! - QPointArray p(4); const int xi = int(x()); const int yi = int(y()); const QPoint start = startPoint(); const QPoint 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] = QPoint(x1+xi,y1+yi-1); p[1] = QPoint(x2+xi,y2+yi-1); p[2] = QPoint(x2+xi,y2+yi+1); p[3] = QPoint(x1+xi,y1+yi+1); } else { p[0] = QPoint(x1+xi-1,y1+yi); p[1] = QPoint(x2+xi-1,y2+yi); p[2] = QPoint(x2+xi+1,y2+yi); p[3] = QPoint(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 = 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; } void Wall::editModeChanged(bool changed) @@ -1934,9 +1934,9 @@ bool Wall::collision(Ball *ball, long int id) void Wall::load(KConfig *cfg) { - QPoint start(startPoint()); + TQPoint start(startPoint()); start = cfg->readPointEntry("startPoint", &start); - QPoint end(endPoint()); + TQPoint end(endPoint()); end = cfg->readPointEntry("endPoint", &end); setPoints(start.x(), start.y(), end.x(), end.y()); @@ -1948,63 +1948,63 @@ void Wall::load(KConfig *cfg) void Wall::save(KConfig *cfg) { - cfg->writeEntry("startPoint", QPoint(startItem->x(), startItem->y())); - cfg->writeEntry("endPoint", QPoint(endItem->x(), endItem->y())); + cfg->writeEntry("startPoint", TQPoint(startItem->x(), startItem->y())); + cfg->writeEntry("endPoint", TQPoint(endItem->x(), endItem->y())); } ///////////////////////// -HoleConfig::HoleConfig(HoleInfo *holeInfo, QWidget *parent) +HoleConfig::HoleConfig(HoleInfo *holeInfo, TQWidget *parent) : Config(parent) { this->holeInfo = holeInfo; - QVBoxLayout *layout = new QVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); - QHBoxLayout *hlayout = new QHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new QLabel(i18n("Course name: "), this)); + TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); + hlayout->addWidget(new TQLabel(i18n("Course name: "), this)); KLineEdit *nameEdit = new KLineEdit(holeInfo->untranslatedName(), this); hlayout->addWidget(nameEdit); - connect(nameEdit, SIGNAL(textChanged(const QString &)), this, SLOT(nameChanged(const QString &))); + connect(nameEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(nameChanged(const TQString &))); - hlayout = new QHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new QLabel(i18n("Course author: "), this)); + hlayout = new TQHBoxLayout(layout, spacingHint()); + hlayout->addWidget(new TQLabel(i18n("Course author: "), this)); KLineEdit *authorEdit = new KLineEdit(holeInfo->author(), this); hlayout->addWidget(authorEdit); - connect(authorEdit, SIGNAL(textChanged(const QString &)), this, SLOT(authorChanged(const QString &))); + connect(authorEdit, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(authorChanged(const TQString &))); layout->addStretch(); - hlayout = new QHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new QLabel(i18n("Par:"), this)); - QSpinBox *par = new QSpinBox(1, 15, 1, this); + hlayout = new TQHBoxLayout(layout, spacingHint()); + hlayout->addWidget(new TQLabel(i18n("Par:"), this)); + TQSpinBox *par = new TQSpinBox(1, 15, 1, this); par->setValue(holeInfo->par()); hlayout->addWidget(par); - connect(par, SIGNAL(valueChanged(int)), this, SLOT(parChanged(int))); + connect(par, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(parChanged(int))); hlayout->addStretch(); - hlayout->addWidget(new QLabel(i18n("Maximum:"), this)); - QSpinBox *maxstrokes = new QSpinBox(holeInfo->lowestMaxStrokes(), 30, 1, this); - QWhatsThis::add(maxstrokes, i18n("Maximum number of strokes player can take on this hole.")); - QToolTip::add(maxstrokes, i18n("Maximum number of strokes")); + hlayout->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); - connect(maxstrokes, SIGNAL(valueChanged(int)), this, SLOT(maxStrokesChanged(int))); + connect(maxstrokes, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(maxStrokesChanged(int))); - QCheckBox *check = new QCheckBox(i18n("Show border walls"), this); + TQCheckBox *check = new TQCheckBox(i18n("Show border walls"), this); check->setChecked(holeInfo->borderWalls()); layout->addWidget(check); - connect(check, SIGNAL(toggled(bool)), this, SLOT(borderWallsChanged(bool))); + connect(check, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(borderWallsChanged(bool))); } -void HoleConfig::authorChanged(const QString &newauthor) +void HoleConfig::authorChanged(const TQString &newauthor) { holeInfo->setAuthor(newauthor); changed(); } -void HoleConfig::nameChanged(const QString &newname) +void HoleConfig::nameChanged(const TQString &newname) { holeInfo->setName(newname); holeInfo->setUntranslatedName(newname); @@ -2031,8 +2031,8 @@ void HoleConfig::borderWallsChanged(bool yes) ///////////////////////// -StrokeCircle::StrokeCircle(QCanvas *canvas) - : QCanvasItem(canvas) +StrokeCircle::StrokeCircle(TQCanvas *canvas) + : TQCanvasItem(canvas) { dvalue = 0; dmax = 360; @@ -2056,11 +2056,11 @@ double StrokeCircle::value() return dvalue; } -bool StrokeCircle::collidesWith(const QCanvasItem*) const { return false; } +bool StrokeCircle::collidesWith(const TQCanvasItem*) const { return false; } -bool StrokeCircle::collidesWith(const QCanvasSprite*, const QCanvasPolygonalItem*, const QCanvasRectangle*, const QCanvasEllipse*, const QCanvasText*) const { return false; } +bool StrokeCircle::collidesWith(const TQCanvasSprite*, const TQCanvasPolygonalItem*, const TQCanvasRectangle*, const TQCanvasEllipse*, const TQCanvasText*) const { return false; } -QRect StrokeCircle::boundingRect() const { return QRect(x(), y(), iwidth, iheight); } +TQRect StrokeCircle::boundingRect() const { return TQRect(x(), y(), iwidth, iheight); } void StrokeCircle::setMaxValue(double m) { @@ -2102,7 +2102,7 @@ int StrokeCircle::height() const return iheight; } -void StrokeCircle::draw(QPainter &p) +void StrokeCircle::draw(TQPainter &p) { int al = (int)((dvalue * 360 * 16) / dmax); int length, deg; @@ -2122,16 +2122,16 @@ void StrokeCircle::draw(QPainter &p) length = al; } - p.setBrush(QBrush(black, Qt::NoBrush)); - p.setPen(QPen(white, ithickness / 2)); + p.setBrush(TQBrush(black, Qt::NoBrush)); + p.setPen(TQPen(white, ithickness / 2)); p.drawEllipse(x() + ithickness / 2, y() + ithickness / 2, iwidth - ithickness, iheight - ithickness); - p.setPen(QPen(QColor((int)(0xff * dvalue) / dmax, 0, 0xff - (int)(0xff * dvalue) / dmax), ithickness)); + p.setPen(TQPen(TQColor((int)(0xff * dvalue) / dmax, 0, 0xff - (int)(0xff * dvalue) / dmax), ithickness)); p.drawArc(x() + ithickness / 2, y() + ithickness / 2, iwidth - ithickness, iheight - ithickness, deg, length); - p.setPen(QPen(white, 1)); + p.setPen(TQPen(white, 1)); p.drawEllipse(x(), y(), iwidth, iheight); p.drawEllipse(x() + ithickness, y() + ithickness, iwidth - ithickness * 2, iheight - ithickness * 2); - p.setPen(QPen(white, 3)); + p.setPen(TQPen(white, 3)); p.drawLine(x() + iwidth / 2, y() + iheight - ithickness * 1.5, x() + iwidth / 2, y() + iheight); p.drawLine(x() + iwidth / 4 - iwidth / 20, y() + iheight - iheight / 4 + iheight / 20, x() + iwidth / 4 + iwidth / 20, y() + iheight - iheight / 4 - iheight / 20); p.drawLine(x() + iwidth - iwidth / 4 + iwidth / 20, y() + iheight - iheight / 4 + iheight / 20, x() + iwidth - iwidth / 4 - iwidth / 20, y() + iheight - iheight / 4 - iheight / 20); @@ -2139,8 +2139,8 @@ void StrokeCircle::draw(QPainter &p) ///////////////////////////////////////// -KolfGame::KolfGame(ObjectList *obj, PlayerList *players, QString filename, QWidget *parent, const char *name ) - : QCanvasView(parent, name) +KolfGame::KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWidget *parent, const char *name ) + : TQCanvasView(parent, name) { // for mouse control setMouseTracking(true); @@ -2193,24 +2193,24 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, QString filename, QWidg // in easy storage width = 400; height = 400; - grass = QColor("#35760D"); + grass = TQColor("#35760D"); margin = 10; - setFocusPolicy(QWidget::StrongFocus); + setFocusPolicy(TQWidget::StrongFocus); setFixedSize(width + 2 * margin, height + 2 * margin); setMargins(margin, margin, margin, margin); - course = new QCanvas(this); + course = new TQCanvas(this); course->setBackgroundColor(white); course->resize(width, height); - QPixmap pic; - if (!QPixmapCache::find("grass", pic)) + TQPixmap pic; + if (!TQPixmapCache::find("grass", pic)) { pic.load(locate("appdata", "pics/grass.png")); - QPixmapCache::insert("grass", pic); + TQPixmapCache::insert("grass", pic); } course->setBackgroundPixmap(pic); @@ -2222,17 +2222,17 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, QString filename, QWidg (*it).ball()->setCanvas(course); // highlighter shows current item - highlighter = new QCanvasRectangle(course); - highlighter->setPen(QPen(yellow, 1)); - highlighter->setBrush(QBrush(NoBrush)); + highlighter = new TQCanvasRectangle(course); + highlighter->setPen(TQPen(yellow, 1)); + highlighter->setBrush(TQBrush(NoBrush)); highlighter->setVisible(false); highlighter->setZ(10000); // shows some info about hole - infoText = new QCanvasText(course); + infoText = new TQCanvasText(course); infoText->setText(""); infoText->setColor(white); - QFont font = kapp->font(); + TQFont font = kapp->font(); font.setPixelSize(12); infoText->move(15, width/2); infoText->setZ(10001); @@ -2276,31 +2276,31 @@ KolfGame::KolfGame(ObjectList *obj, PlayerList *players, QString filename, QWidg // border walls: // horiz - addBorderWall(QPoint(margin, margin), QPoint(width - margin, margin)); - addBorderWall(QPoint(margin, height - margin - 1), QPoint(width - margin, height - margin - 1)); + addBorderWall(TQPoint(margin, margin), TQPoint(width - margin, margin)); + addBorderWall(TQPoint(margin, height - margin - 1), TQPoint(width - margin, height - margin - 1)); // vert - addBorderWall(QPoint(margin, margin), QPoint(margin, height - margin)); - addBorderWall(QPoint(width - margin - 1, margin), QPoint(width - margin - 1, height - margin)); + addBorderWall(TQPoint(margin, margin), TQPoint(margin, height - margin)); + addBorderWall(TQPoint(width - margin - 1, margin), TQPoint(width - margin - 1, height - margin)); - timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(timeout())); + timer = new TQTimer(this); + connect(timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeout())); timerMsec = 300; - fastTimer = new QTimer(this); - connect(fastTimer, SIGNAL(timeout()), this, SLOT(fastTimeout())); + fastTimer = new TQTimer(this); + connect(fastTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(fastTimeout())); fastTimerMsec = 11; - autoSaveTimer = new QTimer(this); - connect(autoSaveTimer, SIGNAL(timeout()), this, SLOT(autoSaveTimeout())); + autoSaveTimer = new TQTimer(this); + connect(autoSaveTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(autoSaveTimeout())); autoSaveMsec = 5 * 1000 * 60; // 5 min autosave // setUseAdvancedPutting() sets maxStrength! setUseAdvancedPutting(false); putting = false; - putterTimer = new QTimer(this); - connect(putterTimer, SIGNAL(timeout()), this, SLOT(putterTimeout())); + putterTimer = new TQTimer(this); + connect(putterTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(putterTimeout())); putterTimerMsec = 20; } @@ -2311,7 +2311,7 @@ void KolfGame::startFirstHole(int hole) { for (; scoreboardHoles < curHole; ++scoreboardHoles) { - cfg->setGroup(QString("%1-hole@-50,-50|0").arg(scoreboardHoles + 1)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(scoreboardHoles + 1)); emit newHole(cfg->readNumEntry("par", 3)); } @@ -2330,7 +2330,7 @@ void KolfGame::startFirstHole(int hole) unPause(); } -void KolfGame::setFilename(const QString &filename) +void KolfGame::setFilename(const TQString &filename) { this->filename = filename; delete cfg; @@ -2378,7 +2378,7 @@ void KolfGame::unPause() putterTimer->start(putterTimerMsec); } -void KolfGame::addBorderWall(QPoint start, QPoint end) +void KolfGame::addBorderWall(TQPoint start, TQPoint end) { Wall *wall = new Wall(course); wall->setPoints(start.x(), start.y(), end.x(), end.y()); @@ -2392,18 +2392,18 @@ void KolfGame::updateHighlighter() { if (!selectedItem) return; - QRect rect = selectedItem->boundingRect(); + TQRect rect = selectedItem->boundingRect(); highlighter->move(rect.x() + 1, rect.y() + 1); highlighter->setSize(rect.width(), rect.height()); } -void KolfGame::handleMouseDoubleClickEvent(QMouseEvent *e) +void KolfGame::handleMouseDoubleClickEvent(TQMouseEvent *e) { // allow two fast single clicks handleMousePressEvent(e); } -void KolfGame::handleMousePressEvent(QMouseEvent *e) +void KolfGame::handleMousePressEvent(TQMouseEvent *e) { if (m_ignoreEvents) return; @@ -2415,7 +2415,7 @@ void KolfGame::handleMousePressEvent(QMouseEvent *e) storedMousePos = e->pos(); - QCanvasItemList list = course->collisions(e->pos()); + TQCanvasItemList list = course->collisions(e->pos()); if (list.first() == highlighter) list.pop_front(); @@ -2459,7 +2459,7 @@ void KolfGame::handleMousePressEvent(QMouseEvent *e) emit newSelectedItem(citem); highlighter->setVisible(true); - QRect rect = selectedItem->boundingRect(); + TQRect rect = selectedItem->boundingRect(); highlighter->move(rect.x() + 1, rect.y() + 1); highlighter->setSize(rect.width(), rect.height()); } @@ -2483,45 +2483,45 @@ void KolfGame::handleMousePressEvent(QMouseEvent *e) setFocus(); } -QPoint KolfGame::viewportToViewport(const QPoint &p) +TQPoint KolfGame::viewportToViewport(const TQPoint &p) { // for some reason viewportToContents doesn't work right - return p - QPoint(margin, margin); + return p - TQPoint(margin, margin); } // the following four functions are needed to handle both // border presses and regular in-course presses -void KolfGame::mouseReleaseEvent(QMouseEvent * e) +void KolfGame::mouseReleaseEvent(TQMouseEvent * e) { - QMouseEvent fixedEvent (QEvent::MouseButtonRelease, viewportToViewport(viewportToContents(e->pos())), e->button(), e->state()); + TQMouseEvent fixedEvent (TQEvent::MouseButtonRelease, viewportToViewport(viewportToContents(e->pos())), e->button(), e->state()); handleMouseReleaseEvent(&fixedEvent); } -void KolfGame::mousePressEvent(QMouseEvent * e) +void KolfGame::mousePressEvent(TQMouseEvent * e) { - QMouseEvent fixedEvent (QEvent::MouseButtonPress, viewportToViewport(viewportToContents(e->pos())), e->button(), e->state()); + TQMouseEvent fixedEvent (TQEvent::MouseButtonPress, viewportToViewport(viewportToContents(e->pos())), e->button(), e->state()); handleMousePressEvent(&fixedEvent); } -void KolfGame::mouseDoubleClickEvent(QMouseEvent * e) +void KolfGame::mouseDoubleClickEvent(TQMouseEvent * e) { - QMouseEvent fixedEvent (QEvent::MouseButtonDblClick, viewportToViewport(viewportToContents(e->pos())), e->button(), e->state()); + TQMouseEvent fixedEvent (TQEvent::MouseButtonDblClick, viewportToViewport(viewportToContents(e->pos())), e->button(), e->state()); handleMouseDoubleClickEvent(&fixedEvent); } -void KolfGame::mouseMoveEvent(QMouseEvent * e) +void KolfGame::mouseMoveEvent(TQMouseEvent * e) { - QMouseEvent fixedEvent (QEvent::MouseMove, viewportToViewport(viewportToContents(e->pos())), e->button(), e->state()); + TQMouseEvent fixedEvent (TQEvent::MouseMove, viewportToViewport(viewportToContents(e->pos())), e->button(), e->state()); handleMouseMoveEvent(&fixedEvent); } -void KolfGame::handleMouseMoveEvent(QMouseEvent *e) +void KolfGame::handleMouseMoveEvent(TQMouseEvent *e) { if (inPlay || !putter || m_ignoreEvents) return; - QPoint mouse = e->pos(); + TQPoint mouse = e->pos(); // mouse moving of putter if (!editing) @@ -2535,7 +2535,7 @@ void KolfGame::handleMouseMoveEvent(QMouseEvent *e) // lets change the cursor to a hand // if we're hovering over something - QCanvasItemList list = course->collisions(e->pos()); + TQCanvasItemList list = course->collisions(e->pos()); if (list.count() > 0) setCursor(KCursor::handCursor()); else @@ -2552,8 +2552,8 @@ void KolfGame::handleMouseMoveEvent(QMouseEvent *e) highlighter->moveBy(-(double)moveX, -(double)moveY); movingItem->moveBy(-(double)moveX, -(double)moveY); - QRect brect = movingItem->boundingRect(); - emit newStatusText(QString("%1x%2").arg(brect.x()).arg(brect.y())); + TQRect brect = movingItem->boundingRect(); + emit newStatusText(TQString("%1x%2").arg(brect.x()).arg(brect.y())); storedMousePos = mouse; } @@ -2563,18 +2563,18 @@ void KolfGame::updateMouse() if (!m_useMouse || ((stroking || putting) && m_useAdvancedPutting)) return; - const QPoint cursor = viewportToViewport(viewportToContents(mapFromGlobal(QCursor::pos()))); - const QPoint ball((*curPlayer).ball()->x(), (*curPlayer).ball()->y()); + const TQPoint cursor = viewportToViewport(viewportToContents(mapFromGlobal(TQCursor::pos()))); + const TQPoint ball((*curPlayer).ball()->x(), (*curPlayer).ball()->y()); putter->setAngle(-Vector(cursor, ball).direction()); } -void KolfGame::handleMouseReleaseEvent(QMouseEvent *e) +void KolfGame::handleMouseReleaseEvent(TQMouseEvent *e) { setCursor(KCursor::arrowCursor()); if (editing) { - emit newStatusText(QString::null); + emit newStatusText(TQString::null); moving = false; } @@ -2592,7 +2592,7 @@ void KolfGame::handleMouseReleaseEvent(QMouseEvent *e) setFocus(); } -void KolfGame::keyPressEvent(QKeyEvent *e) +void KolfGame::keyPressEvent(TQKeyEvent *e) { if (inPlay || editing || m_ignoreEvents) return; @@ -2645,7 +2645,7 @@ void KolfGame::setShowInfo(bool yes) if (m_showInfo) { - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { CanvasItem *citem = dynamic_cast(item); @@ -2660,7 +2660,7 @@ void KolfGame::setShowInfo(bool yes) } else { - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { CanvasItem *citem = dynamic_cast(item); @@ -2719,7 +2719,7 @@ void KolfGame::puttPress() } } -void KolfGame::keyReleaseEvent(QKeyEvent *e) +void KolfGame::keyReleaseEvent(TQKeyEvent *e) { if (e->isAutoRepeat() || m_ignoreEvents) return; @@ -2736,7 +2736,7 @@ void KolfGame::keyReleaseEvent(QKeyEvent *e) citem = citem->itemToDelete(); if (!citem) return; - QCanvasItem *item = dynamic_cast(citem); + TQCanvasItem *item = dynamic_cast(citem); if (citem && citem->deleteable()) { lastDelId = citem->curId(); @@ -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(QPoint((*it).ball()->x(), (*it).ball()->y()))) + if (!course->rect().contains(TQPoint((*it).ball()->x(), (*it).ball()->y()))) { (*it).ball()->setState(Stopped); @@ -2808,7 +2808,7 @@ void KolfGame::timeout() if (curState == Stopped && inPlay) { inPlay = false; - QTimer::singleShot(0, this, SLOT(shotDone())); + TQTimer::singleShot(0, this, TQT_SLOT(shotDone())); } if (curState == Holed && inPlay) @@ -2842,12 +2842,12 @@ void KolfGame::timeout() (*curPlayer).addStrokeToHole(curHole); emit scoreChanged((*curPlayer).id(), curHole, (*curPlayer).score(curHole)); } - QTimer::singleShot(600, this, SLOT(holeDone())); + TQTimer::singleShot(600, this, TQT_SLOT(holeDone())); } else { inPlay = false; - QTimer::singleShot(0, this, SLOT(shotDone())); + TQTimer::singleShot(0, this, TQT_SLOT(shotDone())); } } } @@ -3036,7 +3036,7 @@ void KolfGame::recreateStateList() { stateDB.clear(); - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { @@ -3063,7 +3063,7 @@ void KolfGame::undoShot() void KolfGame::loadStateList() { - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { @@ -3132,11 +3132,11 @@ void KolfGame::shotDone() { ball->setPlaceOnGround(false); - QStringList options; - const QString placeOutside = i18n("Drop Outside of Hazard"); - const QString rehit = i18n("Rehit From Last Location"); + TQStringList options; + const TQString placeOutside = i18n("Drop Outside of Hazard"); + const TQString rehit = i18n("Rehit From Last Location"); options << placeOutside << rehit; - const QString 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").arg((*it).name()), options, placeOutside, "hazardOptions"); if (choice == placeOutside) { @@ -3146,11 +3146,11 @@ void KolfGame::shotDone() while (1) { - QCanvasItemList list = ball->collisions(true); + TQCanvasItemList list = ball->collisions(true); bool keepMoving = false; while (!list.isEmpty()) { - QCanvasItem *item = list.first(); + TQCanvasItem *item = list.first(); if (item->rtti() == Rtti_DontPlaceOn) keepMoving = true; @@ -3216,11 +3216,11 @@ void KolfGame::shotDone() if (allPlayersDone()) { startNextHole(); - QTimer::singleShot(100, this, SLOT(emitMax())); + TQTimer::singleShot(100, this, TQT_SLOT(emitMax())); return; } - QTimer::singleShot(100, this, SLOT(emitMax())); + TQTimer::singleShot(100, this, TQT_SLOT(emitMax())); } } @@ -3261,7 +3261,7 @@ void KolfGame::startBall(const Vector &vector) (*curPlayer).ball()->setState(Rolling); (*curPlayer).ball()->setVector(vector); - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { CanvasItem *citem = dynamic_cast(item); @@ -3429,7 +3429,7 @@ void KolfGame::startNextHole() for (; scoreboardHoles < curHole; ++scoreboardHoles) { - cfg->setGroup(QString("%1-hole@-50,-50|0").arg(scoreboardHoles + 1)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(scoreboardHoles + 1)); emit newHole(cfg->readNumEntry("par", 3)); } @@ -3451,8 +3451,8 @@ void KolfGame::startNextHole() void KolfGame::showInfo() { - QString text = i18n("Hole %1: par %2, maximum %3 strokes").arg(curHole).arg(holeInfo.par()).arg(holeInfo.maxStrokes()); - infoText->move((width - QFontMetrics(infoText->font()).width(text)) / 2, infoText->y()); + TQString text = i18n("Hole %1: par %2, maximum %3 strokes").arg(curHole).arg(holeInfo.par()).arg(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); @@ -3463,11 +3463,11 @@ void KolfGame::showInfo() void KolfGame::showInfoDlg(bool addDontShowAgain) { KMessageBox::information(parentWidget(), - i18n("Course name: %1").arg(holeInfo.name()) + QString("\n") - + i18n("Created by %1").arg(holeInfo.author()) + QString("\n") + i18n("Course name: %1").arg(holeInfo.name()) + TQString("\n") + + i18n("Created by %1").arg(holeInfo.author()) + TQString("\n") + i18n("%1 holes").arg(highestHole), i18n("Course Information"), - addDontShowAgain? holeInfo.name() + QString(" ") + holeInfo.author() : QString::null); + addDontShowAgain? holeInfo.name() + TQString(" ") + holeInfo.author() : TQString::null); } void KolfGame::hideInfo() @@ -3475,14 +3475,14 @@ void KolfGame::hideInfo() infoText->setText(""); infoText->setVisible(false); - emit newStatusText(QString::null); + emit newStatusText(TQString::null); } void KolfGame::openFile() { Object *curObj = 0; - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { CanvasItem *citem = dynamic_cast(item); @@ -3514,20 +3514,20 @@ void KolfGame::openFile() holeInfo.setUntranslatedName(cfg->readEntryUntranslated("Name", holeInfo.untranslatedName())); emit titleChanged(holeInfo.name()); - cfg->setGroup(QString("%1-hole@-50,-50|0").arg(curHole)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(curHole)); curPar = cfg->readNumEntry("par", 3); holeInfo.setPar(curPar); holeInfo.borderWallsChanged(cfg->readBoolEntry("borderWalls", holeInfo.borderWalls())); holeInfo.setMaxStrokes(cfg->readNumEntry("maxstrokes", 10)); bool hasFinalLoad = cfg->readBoolEntry("hasFinalLoad", true); - QStringList missingPlugins; - QStringList groups = cfg->groupList(); + TQStringList missingPlugins; + TQStringList groups = cfg->groupList(); int numItems = 0; int _highestHole = 0; - for (QStringList::Iterator it = groups.begin(); it != groups.end(); ++it) + for (TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it) { // [-@,|] cfg->setGroup(*it); @@ -3539,7 +3539,7 @@ void KolfGame::openFile() _highestHole = holeNum; const int atIndex = (*it).find("@"); - const QString name = (*it).mid(dashIndex + 1, atIndex - (dashIndex + 1)); + const TQString name = (*it).mid(dashIndex + 1, atIndex - (dashIndex + 1)); if (holeNum != curHole) { @@ -3575,7 +3575,7 @@ void KolfGame::openFile() if (name != curObj->_name()) continue; - QCanvasItem *newItem = curObj->newObject(course); + TQCanvasItem *newItem = curObj->newObject(course); items.append(newItem); CanvasItem *canvasItem = dynamic_cast(newItem); @@ -3616,7 +3616,7 @@ void KolfGame::openFile() if (!missingPlugins.empty()) { - KMessageBox::informationList(this, QString("

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

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

"), missingPlugins, QString::null, QString("%1 warning").arg(holeInfo.untranslatedName() + QString::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::null, TQString("%1 warning").arg(holeInfo.untranslatedName() + TQString::number(curHole))); } lastDelId = -1; @@ -3640,9 +3640,9 @@ void KolfGame::openFile() } // do it down here; if !hasFinalLoad, do it up there! - QCanvasItem *qcanvasItem = 0; - QPtrList todo; - QPtrList qtodo; + TQCanvasItem *qcanvasItem = 0; + TQPtrList todo; + TQPtrList qtodo; if (hasFinalLoad) { for (qcanvasItem = items.first(); qcanvasItem; qcanvasItem = items.next()) @@ -3657,7 +3657,7 @@ void KolfGame::openFile() } else { - QString group = makeGroup(item->curId(), curHole, item->name(), (int)qcanvasItem->x(), (int)qcanvasItem->y()); + TQString group = makeGroup(item->curId(), curHole, item->name(), (int)qcanvasItem->x(), (int)qcanvasItem->y()); cfg->setGroup(group); item->load(cfg); } @@ -3702,9 +3702,9 @@ void KolfGame::openFile() setModified(false); } -void KolfGame::addItemsToMoveableList(QPtrList list) +void KolfGame::addItemsToMoveableList(TQPtrList list) { - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = list.first(); item; item = list.next()) extraMoveable.append(item); } @@ -3717,7 +3717,7 @@ void KolfGame::addItemToFastAdvancersList(CanvasItem *item) void KolfGame::addNewObject(Object *newObj) { - QCanvasItem *newItem = newObj->newObject(course); + TQCanvasItem *newItem = newObj->newObject(course); items.append(newItem); newItem->setVisible(true); @@ -3733,7 +3733,7 @@ void KolfGame::addNewObject(Object *newObj) for (;; ++i) { bool found = false; - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { CanvasItem *citem = dynamic_cast(item); @@ -3864,7 +3864,7 @@ void KolfGame::resetHoleScores() void KolfGame::clearHole() { - QCanvasItem *qcanvasItem = 0; + TQCanvasItem *qcanvasItem = 0; for (qcanvasItem = items.first(); qcanvasItem; qcanvasItem = items.next()) { CanvasItem *citem = dynamic_cast(qcanvasItem); @@ -3907,7 +3907,7 @@ void KolfGame::switchHole(int hole) toggleEditMode(); } -void KolfGame::switchHole(const QString &holestring) +void KolfGame::switchHole(const TQString &holestring) { bool ok; int hole = holestring.toInt(&ok); @@ -3946,7 +3946,7 @@ void KolfGame::save() { if (filename.isNull()) { - QString newfilename = KFileDialog::getSaveFileName(":kourses", "application/x-kourse", this, i18n("Pick Kolf Course to Save To")); + TQString newfilename = KFileDialog::getSaveFileName(":kourses", "application/x-kourse", this, i18n("Pick Kolf Course to Save To")); if (newfilename.isNull()) return; @@ -3961,7 +3961,7 @@ void KolfGame::save() bool hasFinalLoad = false; fastAdvancedExist = false; - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { CanvasItem *citem = dynamic_cast(item); @@ -3973,10 +3973,10 @@ void KolfGame::save() } } - QStringList groups = cfg->groupList(); + TQStringList groups = cfg->groupList(); // wipe out all groups from this hole - for (QStringList::Iterator it = groups.begin(); it != groups.end(); ++it) + for (TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it) { int holeNum = (*it).left((*it).find("-")).toInt(); if (holeNum == curHole) @@ -3995,7 +3995,7 @@ void KolfGame::save() } // save where ball starts (whiteBall tells all) - cfg->setGroup(QString("%1-ball@%2,%3").arg(curHole).arg((int)whiteBall->x()).arg((int)whiteBall->y())); + cfg->setGroup(TQString("%1-ball@%2,%3").arg(curHole).arg((int)whiteBall->x()).arg((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(QString("%1-hole@-50,-50|0").arg(curHole)); + cfg->setGroup(TQString("%1-hole@-50,-50|0").arg(curHole)); cfg->writeEntry("par", holeInfo.par()); cfg->writeEntry("maxstrokes", holeInfo.maxStrokes()); cfg->writeEntry("borderWalls", holeInfo.borderWalls()); @@ -4054,7 +4054,7 @@ void KolfGame::toggleEditMode() } // alert our items - QCanvasItem *item = 0; + TQCanvasItem *item = 0; for (item = items.first(); item; item = items.next()) { CanvasItem *citem = dynamic_cast(item); @@ -4085,7 +4085,7 @@ void KolfGame::toggleEditMode() inPlay = false; } -void KolfGame::playSound(QString file, double vol) +void KolfGame::playSound(TQString file, double vol) { if (m_sound) { @@ -4103,10 +4103,10 @@ void KolfGame::playSound(QString file, double vol) } } - file = soundDir + file + QString::fromLatin1(".wav"); + file = soundDir + file + TQString::fromLatin1(".wav"); // not needed when all of the files are in the distribution - //if (!QFile::exists(file)) + //if (!TQFile::exists(file)) //return; KPlayObjectFactory factory(artsServer.server()); @@ -4141,29 +4141,29 @@ void HoleInfo::borderWallsChanged(bool yes) void KolfGame::print(KPrinter &pr) { - QPainter p(&pr); + TQPainter p(&pr); - QPaintDeviceMetrics metrics(&pr); + TQPaintDeviceMetrics metrics(&pr); // translate to center p.translate(metrics.width() / 2 - course->rect().width() / 2, metrics.height() / 2 - course->rect().height() / 2); - QPixmap pix(width, height); - QPainter pixp(&pix); + TQPixmap pix(width, height); + TQPainter pixp(&pix); course->drawArea(course->rect(), &pixp); p.drawPixmap(0, 0, pix); - p.setPen(QPen(black, 2)); + p.setPen(TQPen(black, 2)); p.drawRect(course->rect()); p.resetXForm(); if (pr.option("kde-kolf-title") == "true") { - QString text = i18n("%1 - Hole %2; by %3").arg(holeInfo.name()).arg(curHole).arg(holeInfo.author()); - QFont font(kapp->font()); + TQString text = i18n("%1 - Hole %2; by %3").arg(holeInfo.name()).arg(curHole).arg(holeInfo.author()); + TQFont font(kapp->font()); font.setPointSize(18); - QRect rect = QFontMetrics(font).boundingRect(text); + TQRect rect = TQFontMetrics(font).boundingRect(text); p.setFont(font); p.drawText(metrics.width() / 2 - rect.width() / 2, metrics.height() / 2 - course->rect().height() / 2 -20 - rect.height(), text); @@ -4207,7 +4207,7 @@ void KolfGame::setSound(bool yes) m_sound = yes; } -void KolfGame::courseInfo(CourseInfo &info, const QString& filename) +void KolfGame::courseInfo(CourseInfo &info, const TQString& filename) { KConfig cfg(filename); cfg.setGroup("0-course@-50,-50"); @@ -4219,7 +4219,7 @@ void KolfGame::courseInfo(CourseInfo &info, const QString& filename) unsigned int par= 0; while (1) { - QString group = QString("%1-hole@-50,-50|0").arg(hole); + TQString group = TQString("%1-hole@-50,-50|0").arg(hole); if (!cfg.hasGroup(group)) { hole--; @@ -4246,15 +4246,15 @@ void KolfGame::scoresFromSaved(KConfig *config, PlayerList &players) for (int i = 1; i <= numPlayers; ++i) { // this is same as in kolf.cpp, but we use saved game values - config->setGroup(QString::number(i)); + config->setGroup(TQString::number(i)); players.append(Player()); players.last().ball()->setColor(config->readEntry("Color", "#ffffff")); players.last().setName(config->readEntry("Name")); players.last().setId(i); - QStringList scores(config->readListEntry("Scores")); - QValueList intscores; - for (QStringList::Iterator it = scores.begin(); it != scores.end(); ++it) + TQStringList scores(config->readListEntry("Scores")); + TQValueList intscores; + for (TQStringList::Iterator it = scores.begin(); it != scores.end(); ++it) intscores.append((*it).toInt()); players.last().setScores(intscores); @@ -4264,8 +4264,8 @@ void KolfGame::scoresFromSaved(KConfig *config, PlayerList &players) void KolfGame::saveScores(KConfig *config) { // wipe out old player info - QStringList groups = config->groupList(); - for (QStringList::Iterator it = groups.begin(); it != groups.end(); ++it) + TQStringList groups = config->groupList(); + for (TQStringList::Iterator it = groups.begin(); it != groups.end(); ++it) { // this deletes all int groups, ie, the player info groups bool ok = false; @@ -4281,14 +4281,14 @@ void KolfGame::saveScores(KConfig *config) for (PlayerList::Iterator it = players->begin(); it != players->end(); ++it) { - config->setGroup(QString::number((*it).id())); + config->setGroup(TQString::number((*it).id())); config->writeEntry("Name", (*it).name()); config->writeEntry("Color", (*it).ball()->color().name()); - QStringList scores; - QValueList intscores = (*it).scores(); - for (QValueList::Iterator it = intscores.begin(); it != intscores.end(); ++it) - scores.append(QString::number(*it)); + TQStringList scores; + TQValueList intscores = (*it).scores(); + for (TQValueList::Iterator it = intscores.begin(); it != intscores.end(); ++it) + scores.append(TQString::number(*it)); config->writeEntry("Scores", scores); } diff --git a/kolf/game.h b/kolf/game.h index afb13b3c..71698e34 100644 --- a/kolf/game.h +++ b/kolf/game.h @@ -10,18 +10,18 @@ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "object.h" #include "config.h" @@ -55,12 +55,12 @@ public: void loadState(KConfig *cfg); int id; - QPoint spot; + TQPoint spot; BallState state; bool beginningOfHole; int score; }; -class BallStateList : public QValueList +class BallStateList : public TQValueList { public: int hole; @@ -75,10 +75,10 @@ public: Player() : m_ball(new Ball(0)) {}; Ball *ball() const { return m_ball; } void setBall(Ball *ball) { m_ball = ball; } - BallStateInfo stateInfo(int hole) const { BallStateInfo ret; ret.spot = QPoint(m_ball->x(), m_ball->y()); ret.state = m_ball->curState(); ret.score = score(hole); ret.beginningOfHole = m_ball->beginningOfHole(); ret.id = m_id; return ret; } + BallStateInfo stateInfo(int hole) const { BallStateInfo ret; ret.spot = TQPoint(m_ball->x(), m_ball->y()); ret.state = m_ball->curState(); ret.score = score(hole); ret.beginningOfHole = m_ball->beginningOfHole(); ret.id = m_id; return ret; } - QValueList scores() const { return m_scores; } - void setScores(const QValueList &newScores) { m_scores = newScores; } + TQValueList scores() const { return m_scores; } + void setScores(const TQValueList &newScores) { m_scores = newScores; } int score(int hole) const { return (*m_scores.at(hole - 1)); } int lastScore() const { return m_scores.last(); } int firstScore() const { return m_scores.first(); } @@ -90,24 +90,24 @@ public: void addHole() { m_scores.append(0); } unsigned int numHoles() const { return m_scores.count(); } - QString name() const { return m_name; } - void setName(const QString &name) { m_name = name; m_ball->setName(name); } + TQString name() const { return m_name; } + void setName(const TQString &name) { m_name = name; m_ball->setName(name); } void setId(int id) { m_id = id; } int id() const { return m_id; } private: Ball *m_ball; - QValueList m_scores; - QString m_name; + TQValueList m_scores; + TQString m_name; int m_id; }; -typedef QValueList PlayerList; +typedef TQValueList PlayerList; class Arrow : public QCanvasLine { public: - Arrow(QCanvas *canvas); + Arrow(TQCanvas *canvas); void setAngle(double newAngle) { m_angle = newAngle; } double angle() const { return m_angle; } void setLength(double newLength) { m_length = newLength; } @@ -115,7 +115,7 @@ public: void setReversed(bool yes) { m_reversed = yes; } bool reversed() const { return m_reversed; } virtual void setVisible(bool); - virtual void setPen(QPen p); + virtual void setPen(TQPen p); void aboutToDie(); virtual void moveBy(double, double); void updateSelf(); @@ -125,8 +125,8 @@ private: double m_angle; double m_length; bool m_reversed; - QCanvasLine *line1; - QCanvasLine *line2; + TQCanvasLine *line1; + TQCanvasLine *line2; }; class RectPoint; @@ -136,13 +136,13 @@ public: virtual void newSize(int /*width*/, int /*height*/) {}; }; -class RectPoint : public QCanvasEllipse, public CanvasItem +class RectPoint : public TQCanvasEllipse, public CanvasItem { public: - RectPoint(QColor color, RectItem *, QCanvas *canvas); + RectPoint(TQColor color, RectItem *, TQCanvas *canvas); void dontMove() { dontmove = true; } virtual void moveBy(double dx, double dy); - virtual Config *config(QWidget *parent); + virtual Config *config(TQWidget *parent); virtual bool deleteable() const { return false; } virtual bool cornerResize() const { return true; } virtual CanvasItem *itemToDelete() { return dynamic_cast(rect); } @@ -156,10 +156,10 @@ private: bool dontmove; }; -class Ellipse : public QCanvasEllipse, public CanvasItem, public RectItem +class Ellipse : public TQCanvasEllipse, public CanvasItem, public RectItem { public: - Ellipse(QCanvas *canvas); + Ellipse(TQCanvas *canvas); virtual void advance(int phase); int changeEvery() const { return m_changeEvery; } @@ -171,7 +171,7 @@ public: virtual void aboutToSave(); virtual void savingDone(); - virtual QPtrList moveableItems() const; + virtual TQPtrList moveableItems() const; virtual void newSize(int width, int height); virtual void moveBy(double dx, double dy); @@ -181,7 +181,7 @@ public: virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); - virtual Config *config(QWidget *parent); + virtual Config *config(TQWidget *parent); protected: RectPoint *point; @@ -197,7 +197,7 @@ class EllipseConfig : public Config Q_OBJECT public: - EllipseConfig(Ellipse *ellipse, QWidget *); + EllipseConfig(Ellipse *ellipse, TQWidget *); private slots: void value1Changed(int news); @@ -206,22 +206,22 @@ private slots: void check2Changed(bool on); protected: - QVBoxLayout *m_vlayout; + TQVBoxLayout *m_vlayout; private: - QLabel *slow1; - QLabel *fast1; - QLabel *slow2; - QLabel *fast2; - QSlider *slider1; - QSlider *slider2; + TQLabel *slow1; + TQLabel *fast1; + TQLabel *slow2; + TQLabel *fast2; + TQSlider *slider1; + TQSlider *slider2; Ellipse *ellipse; }; class Puddle : public Ellipse { public: - Puddle(QCanvas *canvas); + Puddle(TQCanvas *canvas); virtual bool collision(Ball *ball, long int id); virtual int rtti() const { return Rtti_DontPlaceOn; } }; @@ -229,36 +229,36 @@ class PuddleObj : public Object { public: PuddleObj() { m_name = i18n("Puddle"); m__name = "puddle"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Puddle(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Puddle(canvas); } }; class Sand : public Ellipse { public: - Sand(QCanvas *canvas); + Sand(TQCanvas *canvas); virtual bool collision(Ball *ball, long int id); }; class SandObj : public Object { public: SandObj() { m_name = i18n("Sand"); m__name = "sand"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Sand(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Sand(canvas); } }; -class Inside : public QCanvasEllipse, public CanvasItem +class Inside : public TQCanvasEllipse, public CanvasItem { public: - Inside(CanvasItem *item, QCanvas *canvas) : QCanvasEllipse(canvas) { this->item = item; } + Inside(CanvasItem *item, TQCanvas *canvas) : TQCanvasEllipse(canvas) { this->item = item; } virtual bool collision(Ball *ball, long int id) { return item->collision(ball, id); } protected: CanvasItem *item; }; -class Bumper : public QCanvasEllipse, public CanvasItem +class Bumper : public TQCanvasEllipse, public CanvasItem { public: - Bumper(QCanvas *canvas); + Bumper(TQCanvas *canvas); virtual void advance(int phase); virtual void aboutToDie(); @@ -268,8 +268,8 @@ public: virtual bool collision(Ball *ball, long int id); protected: - QColor firstColor; - QColor secondColor; + TQColor firstColor; + TQColor secondColor; Inside *inside; private: @@ -279,38 +279,38 @@ class BumperObj : public Object { public: BumperObj() { m_name = i18n("Bumper"); m__name = "bumper"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Bumper(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Bumper(canvas); } }; -class Hole : public QCanvasEllipse, public CanvasItem +class Hole : public TQCanvasEllipse, public CanvasItem { public: - Hole(QColor color, QCanvas *canvas); + Hole(TQColor color, TQCanvas *canvas); virtual bool place(Ball * /*ball*/, bool /*wasCenter*/) { return true; }; virtual bool collision(Ball *ball, long int id); protected: - virtual HoleResult result(const QPoint, double, bool *wasCenter); + virtual HoleResult result(const TQPoint, double, bool *wasCenter); }; class Cup : public Hole { public: - Cup(QCanvas *canvas); + Cup(TQCanvas *canvas); virtual bool place(Ball *ball, bool wasCenter); virtual void save(KConfig *cfg); virtual bool canBeMovedByOthers() const { return true; } - virtual void draw(QPainter &painter); + virtual void draw(TQPainter &painter); protected: - QPixmap pixmap; + TQPixmap pixmap; }; class CupObj : public Object { public: CupObj() { m_name = i18n("Cup"); m__name = "cup"; m_addOnNewHole = true; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Cup(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Cup(canvas); } }; class BlackHole; @@ -319,7 +319,7 @@ class BlackHoleConfig : public Config Q_OBJECT public: - BlackHoleConfig(BlackHole *blackHole, QWidget *parent); + BlackHoleConfig(BlackHole *blackHole, TQWidget *parent); private slots: void degChanged(int); @@ -329,22 +329,22 @@ private slots: private: BlackHole *blackHole; }; -class BlackHoleExit : public QCanvasLine, public CanvasItem +class BlackHoleExit : public TQCanvasLine, public CanvasItem { public: - BlackHoleExit(BlackHole *blackHole, QCanvas *canvas); + BlackHoleExit(BlackHole *blackHole, TQCanvas *canvas); virtual int rtti() const { return Rtti_NoCollision; } virtual void aboutToDie(); virtual void moveBy(double dx, double dy); virtual bool deleteable() const { return false; } virtual bool canBeMovedByOthers() const { return true; } virtual void editModeChanged(bool editing); - virtual void setPen(QPen p); + virtual void setPen(TQPen p); virtual void showInfo(); virtual void hideInfo(); void updateArrowAngle(); void updateArrowLength(); - virtual Config *config(QWidget *parent); + virtual Config *config(TQWidget *parent); BlackHole *blackHole; protected: @@ -369,12 +369,12 @@ protected: double m_speed; Ball *m_ball; }; -class BlackHole : public QObject, public Hole +class BlackHole : public TQObject, public Hole { Q_OBJECT public: - BlackHole(QCanvas *canvas); + BlackHole(TQCanvas *canvas); virtual bool canBeMovedByOthers() const { return true; } virtual void aboutToDie(); virtual void showInfo(); @@ -382,8 +382,8 @@ public: virtual bool place(Ball *ball, bool wasCenter); virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); - virtual Config *config(QWidget *parent) { return new BlackHoleConfig(this, parent); } - virtual QPtrList moveableItems() const; + virtual Config *config(TQWidget *parent) { return new BlackHoleConfig(this, parent); } + virtual TQPtrList moveableItems() const; double minSpeed() const { return m_minSpeed; } double maxSpeed() const { return m_maxSpeed; } void setMinSpeed(double news) { m_minSpeed = news; exitItem->updateArrowLength(); } @@ -411,32 +411,32 @@ protected: private: int runs; - QCanvasLine *infoLine; - QCanvasEllipse *outside; + TQCanvasLine *infoLine; + TQCanvasEllipse *outside; void finishMe(); }; class BlackHoleObj : public Object { public: BlackHoleObj() { m_name = i18n("Black Hole"); m__name = "blackhole"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new BlackHole(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new BlackHole(canvas); } }; class WallPoint; -class Wall : public QCanvasLine, public CanvasItem +class Wall : public TQCanvasLine, public CanvasItem { public: - Wall(QCanvas *canvas); + Wall(TQCanvas *canvas); virtual void aboutToDie(); double dampening; void setAlwaysShow(bool yes); virtual void setZ(double newz); - virtual void setPen(QPen p); + virtual void setPen(TQPen p); virtual bool collision(Ball *ball, long int id); virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); - virtual void selectedItem(QCanvasItem *item); + virtual void selectedItem(TQCanvasItem *item); virtual void editModeChanged(bool changed); virtual void moveBy(double dx, double dy); virtual void setVelocity(double vx, double vy); @@ -444,14 +444,14 @@ public: // must reimp because we gotta move the end items, // and we do that in moveBy() - virtual void setPoints(int xa, int ya, int xb, int yb) { QCanvasLine::setPoints(xa, ya, xb, yb); moveBy(0, 0); } + virtual void setPoints(int xa, int ya, int xb, int yb) { TQCanvasLine::setPoints(xa, ya, xb, yb); moveBy(0, 0); } virtual int rtti() const { return Rtti_Wall; } - virtual QPtrList moveableItems() const; + virtual TQPtrList moveableItems() const; virtual void setGame(KolfGame *game); virtual void setVisible(bool); - virtual QPointArray areaPoints() const; + virtual TQPointArray areaPoints() const; protected: WallPoint *startItem; @@ -463,10 +463,10 @@ private: friend class WallPoint; }; -class WallPoint : public QCanvasEllipse, public CanvasItem +class WallPoint : public TQCanvasEllipse, public CanvasItem { public: - WallPoint(bool start, Wall *wall, QCanvas *canvas); + WallPoint(bool start, Wall *wall, TQCanvas *canvas); void setAlwaysShow(bool yes) { alwaysShow = yes; updateVisible(); } virtual void editModeChanged(bool changed); virtual void moveBy(double dx, double dy); @@ -475,7 +475,7 @@ public: virtual bool collision(Ball *ball, long int id); virtual CanvasItem *itemToDelete() { return wall; } virtual void clean(); - virtual Config *config(QWidget *parent) { return wall->config(parent); } + virtual Config *config(TQWidget *parent) { return wall->config(parent); } void dontMove() { dontmove = true; }; void updateVisible(); @@ -498,13 +498,13 @@ class WallObj : public Object { public: WallObj() { m_name = i18n("Wall"); m__name = "wall"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Wall(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Wall(canvas); } }; -class Putter : public QCanvasLine, public CanvasItem +class Putter : public TQCanvasLine, public CanvasItem { public: - Putter(QCanvas *canvas); + Putter(TQCanvas *canvas); void go(Direction, Amount amount = Amount_Normal); void setOrigin(int x, int y); int curLen() const { return len; } @@ -525,15 +525,15 @@ public: void setShowGuideLine(bool yes); private: - QPoint midPoint; + TQPoint midPoint; double maxAngle; double angle; double oneDegree; - QMap angleMap; + TQMap angleMap; int len; void finishMe(); int putterWidth; - QCanvasLine *guideLine; + TQCanvasLine *guideLine; bool m_showGuideLine; }; @@ -543,7 +543,7 @@ class BridgeConfig : public Config Q_OBJECT public: - BridgeConfig(Bridge *bridge, QWidget *); + BridgeConfig(Bridge *bridge, TQWidget *); protected slots: void topWallChanged(bool); @@ -552,19 +552,19 @@ protected slots: void rightWallChanged(bool); protected: - QVBoxLayout *m_vlayout; - QCheckBox *top; - QCheckBox *bot; - QCheckBox *left; - QCheckBox *right; + TQVBoxLayout *m_vlayout; + TQCheckBox *top; + TQCheckBox *bot; + TQCheckBox *left; + TQCheckBox *right; private: Bridge *bridge; }; -class Bridge : public QCanvasRectangle, public CanvasItem, public RectItem +class Bridge : public TQCanvasRectangle, public CanvasItem, public RectItem { public: - Bridge(QRect rect, QCanvas *canvas); + Bridge(TQRect rect, TQCanvas *canvas); virtual bool collision(Ball *ball, long int id); virtual void aboutToDie(); virtual void editModeChanged(bool changed); @@ -576,12 +576,12 @@ public: void doSave(KConfig *cfg); virtual void newSize(int width, int height); virtual void setGame(KolfGame *game); - virtual Config *config(QWidget *parent) { return new BridgeConfig(this, parent); } + virtual Config *config(TQWidget *parent) { return new BridgeConfig(this, parent); } void setSize(int width, int height); - virtual QPtrList moveableItems() const; + virtual TQPtrList moveableItems() const; - void setWallColor(QColor color); - QPen wallPen() const { return topWall->pen(); } + void setWallColor(TQColor color); + TQPen wallPen() const { return topWall->pen(); } double wallZ() const { return topWall->z(); } void setWallZ(double); @@ -606,7 +606,7 @@ class BridgeObj : public Object { public: BridgeObj() { m_name = i18n("Bridge"); m__name = "bridge"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Bridge(QRect(0, 0, 80, 40), canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Bridge(TQRect(0, 0, 80, 40), canvas); } }; class Sign; @@ -615,10 +615,10 @@ class SignConfig : public BridgeConfig Q_OBJECT public: - SignConfig(Sign *sign, QWidget *parent); + SignConfig(Sign *sign, TQWidget *parent); private slots: - void textChanged(const QString &); + void textChanged(const TQString &); private: Sign *sign; @@ -626,31 +626,31 @@ private: class Sign : public Bridge { public: - Sign(QCanvas *canvas); - void setText(const QString &text); - QString text() const { return m_text; } - virtual void draw(QPainter &painter); + Sign(TQCanvas *canvas); + void setText(const TQString &text); + TQString text() const { return m_text; } + virtual void draw(TQPainter &painter); virtual bool vStrut() const { return false; } - virtual Config *config(QWidget *parent) { return new SignConfig(this, parent); } + virtual Config *config(TQWidget *parent) { return new SignConfig(this, parent); } virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); protected: - QString m_text; - QString m_untranslatedText; + TQString m_text; + TQString m_untranslatedText; }; class SignObj : public Object { public: SignObj() { m_name = i18n("Sign"); m__name = "sign"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Sign(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Sign(canvas); } }; class Windmill; class WindmillGuard : public Wall { public: - WindmillGuard(QCanvas *canvas) : Wall(canvas) {}; + WindmillGuard(TQCanvas *canvas) : Wall(canvas) {}; void setBetween(int newmin, int newmax) { max = newmax; min = newmin; } virtual void advance(int phase); @@ -663,7 +663,7 @@ class WindmillConfig : public BridgeConfig Q_OBJECT public: - WindmillConfig(Windmill *windmill, QWidget *parent); + WindmillConfig(Windmill *windmill, TQWidget *parent); private slots: void speedChanged(int news); @@ -675,13 +675,13 @@ private: class Windmill : public Bridge { public: - Windmill(QRect rect, QCanvas *canvas); + Windmill(TQRect rect, TQCanvas *canvas); virtual void aboutToDie(); virtual void newSize(int width, int height); virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); virtual void setGame(KolfGame *game); - virtual Config *config(QWidget *parent) { return new WindmillConfig(this, parent); } + virtual Config *config(TQWidget *parent) { return new WindmillConfig(this, parent); } void setSize(int width, int height); virtual void moveBy(double dx, double dy); void setSpeed(int news); @@ -701,7 +701,7 @@ class WindmillObj : public Object { public: WindmillObj() { m_name = i18n("Windmill"); m__name = "windmill"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Windmill(QRect(0, 0, 80, 40), canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Windmill(TQRect(0, 0, 80, 40), canvas); } }; class HoleInfo; @@ -710,13 +710,13 @@ class HoleConfig : public Config Q_OBJECT public: - HoleConfig(HoleInfo *holeInfo, QWidget *); + HoleConfig(HoleInfo *holeInfo, TQWidget *); private slots: - void authorChanged(const QString &); + void authorChanged(const TQString &); void parChanged(int); void maxStrokesChanged(int); - void nameChanged(const QString &); + void nameChanged(const TQString &); void borderWallsChanged(bool); private: @@ -733,22 +733,22 @@ public: int lowestMaxStrokes() const { return m_lowestMaxStrokes; } int maxStrokes() const { return m_maxStrokes; } bool hasMaxStrokes() const { return m_maxStrokes != m_lowestMaxStrokes; } - void setAuthor(QString newauthor) { m_author = newauthor; } - QString author() const { return m_author; } + void setAuthor(TQString newauthor) { m_author = newauthor; } + TQString author() const { return m_author; } - void setName(QString newname) { m_name = newname; } - void setUntranslatedName(QString newname) { m_untranslatedName = newname; } - QString name() const { return m_name; } - QString untranslatedName() const { return m_untranslatedName; } + void setName(TQString newname) { m_name = newname; } + void setUntranslatedName(TQString newname) { m_untranslatedName = newname; } + TQString name() const { return m_name; } + TQString untranslatedName() const { return m_untranslatedName; } - virtual Config *config(QWidget *parent) { return new HoleConfig(this, parent); } + virtual Config *config(TQWidget *parent) { return new HoleConfig(this, parent); } void borderWallsChanged(bool yes); bool borderWalls() const { return m_borderWalls; } private: - QString m_author; - QString m_name; - QString m_untranslatedName; + TQString m_author; + TQString m_name; + TQString m_untranslatedName; bool m_borderWalls; int m_par; int m_maxStrokes; @@ -758,7 +758,7 @@ private: class StrokeCircle : public QCanvasItem { public: - StrokeCircle(QCanvas *canvas); + StrokeCircle(TQCanvas *canvas); void setValue(double v); double value(); @@ -768,10 +768,10 @@ public: int thickness() const; int width() const; int height() const; - virtual void draw(QPainter &p); - virtual QRect boundingRect() const; - virtual bool collidesWith(const QCanvasItem*) const; - virtual bool collidesWith(const QCanvasSprite*, const QCanvasPolygonalItem*, const QCanvasRectangle*, const QCanvasEllipse*, const QCanvasText*) const; + virtual void draw(TQPainter &p); + virtual TQRect boundingRect() const; + virtual bool collidesWith(const TQCanvasItem*) const; + virtual bool collidesWith(const TQCanvasSprite*, const TQCanvasPolygonalItem*, const TQCanvasRectangle*, const TQCanvasEllipse*, const TQCanvasText*) const; private: double dvalue, dmax; @@ -780,12 +780,12 @@ private: struct KDE_EXPORT CourseInfo { - CourseInfo(const QString &_name, const QString &_untranslatedName, const QString &_author, unsigned int _holes, unsigned int _par) { name = _name; untranslatedName = _untranslatedName, author = _author; holes = _holes; par = _par; } + CourseInfo(const TQString &_name, const TQString &_untranslatedName, const TQString &_author, unsigned int _holes, unsigned int _par) { name = _name; untranslatedName = _untranslatedName, author = _author; holes = _holes; par = _par; } CourseInfo(); - QString name; - QString untranslatedName; - QString author; + TQString name; + TQString untranslatedName; + TQString author; unsigned int holes; unsigned int par; }; @@ -795,14 +795,14 @@ class KDE_EXPORT KolfGame : public QCanvasView Q_OBJECT public: - KolfGame(ObjectList *obj, PlayerList *players, QString filename, QWidget *parent=0, const char *name=0 ); + KolfGame(ObjectList *obj, PlayerList *players, TQString filename, TQWidget *parent=0, const char *name=0 ); ~KolfGame(); void setObjects(ObjectList *obj) { this->obj = obj; } - void setFilename(const QString &filename); - QString curFilename() const { return filename; } + void setFilename(const TQString &filename); + TQString curFilename() const { return filename; } void emitLargestHole() { emit largestHole(highestHole); } - QCanvas *canvas() const { return course; } - void removeItem(QCanvasItem *item) { items.setAutoDelete(false); items.removeRef(item); } + TQCanvas *canvas() const { return course; } + void removeItem(TQCanvasItem *item) { items.setAutoDelete(false); items.removeRef(item); } // returns whether it was a cancel bool askSave(bool); bool isEditing() const { return editing; } @@ -815,18 +815,18 @@ public: void ballMoved(); void updateHighlighter(); void updateCourse() { course->update(); } - QCanvasItem *curSelectedItem() const { return selectedItem; } + TQCanvasItem *curSelectedItem() const { return selectedItem; } void setBorderWalls(bool); void setInPlay(bool yes) { inPlay = yes; } bool isInPlay() { return inPlay; } bool isInfoShowing() { return m_showInfo; } void stoppedBall(); - QString courseName() const { return holeInfo.name(); } + TQString courseName() const { return holeInfo.name(); } void hidePutter() { putter->setVisible(false); } void ignoreEvents(bool ignore) { m_ignoreEvents = ignore; } static void scoresFromSaved(KConfig *, PlayerList &players); - static void courseInfo(CourseInfo &info, const QString &filename); + static void courseInfo(CourseInfo &info, const TQString &filename); public slots: void pause(); @@ -837,13 +837,13 @@ public slots: void addNewObject(Object *newObj); void addNewHole(); void switchHole(int); - void switchHole(const QString &); + void switchHole(const TQString &); void nextHole(); void prevHole(); void firstHole(); void lastHole(); void randHole(); - void playSound(QString file, double vol = 1); + void playSound(TQString file, double vol = 1); void showInfoDlg(bool = false); void resetHole(); void clearHole(); @@ -865,7 +865,7 @@ signals: void holesDone(); void newHole(int); void parChanged(int, int); - void titleChanged(const QString &); + void titleChanged(const TQString &); void largestHole(int); void scoreChanged(int, int, int); void newPlayersTurn(Player *); @@ -876,10 +876,10 @@ signals: void editingEnded(); void inPlayStart(); void inPlayEnd(); - void maxStrokesReached(const QString &); + void maxStrokesReached(const TQString &); void currentHole(int); void modifiedChanged(bool); - void newStatusText(const QString &); + void newStatusText(const TQString &); private slots: void shotDone(); @@ -888,45 +888,45 @@ private slots: void fastTimeout(); void putterTimeout(); void autoSaveTimeout(); - void addItemsToMoveableList(QPtrList); + void addItemsToMoveableList(TQPtrList); void addItemToFastAdvancersList(CanvasItem *); void hideInfo(); void emitMax(); protected: - void mouseMoveEvent(QMouseEvent *e); - void mousePressEvent(QMouseEvent *e); - void mouseReleaseEvent(QMouseEvent *e); - void mouseDoubleClickEvent(QMouseEvent *e); + void mouseMoveEvent(TQMouseEvent *e); + void mousePressEvent(TQMouseEvent *e); + void mouseReleaseEvent(TQMouseEvent *e); + void mouseDoubleClickEvent(TQMouseEvent *e); - void handleMousePressEvent(QMouseEvent *e); - void handleMouseDoubleClickEvent(QMouseEvent *e); - void handleMouseMoveEvent(QMouseEvent *e); - void handleMouseReleaseEvent(QMouseEvent *e); - void keyPressEvent(QKeyEvent *e); - void keyReleaseEvent(QKeyEvent *e); + void handleMousePressEvent(TQMouseEvent *e); + void handleMouseDoubleClickEvent(TQMouseEvent *e); + void handleMouseMoveEvent(TQMouseEvent *e); + void handleMouseReleaseEvent(TQMouseEvent *e); + void keyPressEvent(TQKeyEvent *e); + void keyReleaseEvent(TQKeyEvent *e); - QPoint viewportToViewport(const QPoint &p); + TQPoint viewportToViewport(const TQPoint &p); private: - QCanvas *course; + TQCanvas *course; Putter *putter; PlayerList *players; PlayerList::Iterator curPlayer; Ball *whiteBall; StrokeCircle *strokeCircle; - QTimer *timer; - QTimer *autoSaveTimer; - QTimer *fastTimer; - QTimer *putterTimer; + TQTimer *timer; + TQTimer *autoSaveTimer; + TQTimer *fastTimer; + TQTimer *putterTimer; bool regAdv; ObjectList *obj; - QPtrList items; - QPtrList extraMoveable; - QPtrList borderWalls; + TQPtrList items; + TQPtrList extraMoveable; + TQPtrList borderWalls; int timerMsec; int autoSaveMsec; @@ -952,7 +952,7 @@ private: int height; int width; int margin; - QColor grass; + TQColor grass; int advancePeriod; @@ -960,32 +960,32 @@ private: bool paused; - QString filename; + TQString filename; bool recalcHighestHole; void openFile(); bool strict; bool editing; - QPoint storedMousePos; + TQPoint storedMousePos; bool moving; bool dragging; - QCanvasItem *movingItem; - QCanvasItem *selectedItem; - QCanvasRectangle *highlighter; + TQCanvasItem *movingItem; + TQCanvasItem *selectedItem; + TQCanvasRectangle *highlighter; // sound KArtsDispatcher artsDispatcher; KArtsServer artsServer; - QPtrList oldPlayObjects; + TQPtrList oldPlayObjects; bool m_sound; bool soundedOnce; - QString soundDir; + TQString soundDir; bool m_ignoreEvents; HoleInfo holeInfo; - QCanvasText *infoText; + TQCanvasText *infoText; void showInfo(); StateDB stateDB; @@ -1006,7 +1006,7 @@ private: KConfig *cfg; - inline void addBorderWall(QPoint start, QPoint end); + inline void addBorderWall(TQPoint start, TQPoint end); void shotStart(); void startBall(const Vector &vector); @@ -1017,10 +1017,10 @@ private: bool m_useMouse; bool m_useAdvancedPutting; - QPtrList fastAdvancers; + TQPtrList fastAdvancers; bool fastAdvancedExist; - QString playerWhoMaxed; + TQString playerWhoMaxed; }; #endif diff --git a/kolf/kcomboboxdialog.cpp b/kolf/kcomboboxdialog.cpp index 03e0701b..1e18e0b2 100644 --- a/kolf/kcomboboxdialog.cpp +++ b/kolf/kcomboboxdialog.cpp @@ -22,9 +22,9 @@ // used in advertising or otherwise to promote the sale, use or other dealings // in this Software without prior written authorization from the author(s). -#include -#include -#include +#include +#include +#include #include #include @@ -34,11 +34,11 @@ #include "kcomboboxdialog.h" -KComboBoxDialog::KComboBoxDialog( const QString &_text, const QStringList &_items, const QString& _value, bool showDontAskAgain, QWidget *parent ) - : KDialogBase( Plain, QString::null, Ok, Ok, parent, 0L, true, true ) +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 ) { - QVBoxLayout *topLayout = new QVBoxLayout( plainPage(), marginHint(), spacingHint() ); - QLabel *label = new QLabel(_text, plainPage() ); + TQVBoxLayout *topLayout = new TQVBoxLayout( plainPage(), marginHint(), spacingHint() ); + TQLabel *label = new TQLabel(_text, plainPage() ); topLayout->addWidget( label, 1 ); combo = new KHistoryCombo( plainPage() ); @@ -48,7 +48,7 @@ KComboBoxDialog::KComboBoxDialog( const QString &_text, const QStringList &_item if (showDontAskAgain) { - dontAskAgainCheckBox = new QCheckBox( i18n("&Do not ask again"), plainPage() ); + dontAskAgainCheckBox = new TQCheckBox( i18n("&Do not ask again"), plainPage() ); topLayout->addWidget( dontAskAgainCheckBox, 1 ); } else @@ -63,7 +63,7 @@ KComboBoxDialog::~KComboBoxDialog() { } -QString KComboBoxDialog::text() const +TQString KComboBoxDialog::text() const { return combo->currentText(); } @@ -76,14 +76,14 @@ bool KComboBoxDialog::dontAskAgainChecked() return false; } -QString KComboBoxDialog::getItem( const QString &_text, const QStringList &_items, const QString& _value, const QString &dontAskAgainName, QWidget *parent ) +TQString KComboBoxDialog::getItem( const TQString &_text, const TQStringList &_items, const TQString& _value, const TQString &dontAskAgainName, TQWidget *parent ) { - return getItem( _text, QString::null, _items, _value, dontAskAgainName, parent ); + return getItem( _text, TQString::null, _items, _value, dontAskAgainName, parent ); } -QString KComboBoxDialog::getItem( const QString &_text, const QString &_caption, const QStringList &_items, const QString& _value, const QString &dontAskAgainName, QWidget *parent ) +TQString KComboBoxDialog::getItem( const TQString &_text, const TQString &_caption, const TQStringList &_items, const TQString& _value, const TQString &dontAskAgainName, TQWidget *parent ) { - QString prevAnswer; + TQString prevAnswer; if ( !dontAskAgainName.isEmpty() ) { KConfig *config = KGlobal::config(); @@ -100,7 +100,7 @@ QString KComboBoxDialog::getItem( const QString &_text, const QString &_caption, dlg.exec(); - const QString text = dlg.text(); + const TQString text = dlg.text(); if (dlg.dontAskAgainChecked()) { @@ -115,17 +115,17 @@ QString KComboBoxDialog::getItem( const QString &_text, const QString &_caption, return text; } -QString KComboBoxDialog::getText(const QString &_caption, const QString &_text, const QString &_value, bool *ok, QWidget *parent, const QString &configName, KConfig *config) +TQString KComboBoxDialog::getText(const TQString &_caption, const TQString &_text, const TQString &_value, bool *ok, TQWidget *parent, const TQString &configName, KConfig *config) { - KComboBoxDialog dlg(_text, QStringList(), _value, false, parent); + KComboBoxDialog dlg(_text, TQStringList(), _value, false, parent); if ( !_caption.isNull() ) dlg.setCaption( _caption ); KHistoryCombo * const box = dlg.comboBox(); box->setEditable(true); - const QString historyItem = QString("%1History").arg(configName); - const QString completionItem = QString("%1Completion").arg(configName); + const TQString historyItem = TQString("%1History").arg(configName); + const TQString completionItem = TQString("%1Completion").arg(configName); if(!configName.isNull()) { diff --git a/kolf/kcomboboxdialog.h b/kolf/kcomboboxdialog.h index e835c0aa..fdd74840 100644 --- a/kolf/kcomboboxdialog.h +++ b/kolf/kcomboboxdialog.h @@ -25,7 +25,7 @@ #ifndef KCOMBOBOX_DIALOG_H #define KCOMBOBOX_DIALOG_H -#include +#include #include #include @@ -34,7 +34,7 @@ class QCheckBox; class KHistoryCombo; /** - * Dialog for user to choose an item from a QStringList. + * Dialog for user to choose an item from a TQStringList. */ class KComboBoxDialog : public KDialogBase @@ -51,13 +51,13 @@ public: * @param _text Text of the label * @param _value Initial value of the combobox */ - KComboBoxDialog( const QString &_text, const QStringList& _items, const QString& _value = QString::null, bool showDontAskAgain = false, QWidget *parent = 0 ); + KComboBoxDialog( const TQString &_text, const TQStringList& _items, const TQString& _value = TQString::null, bool showDontAskAgain = false, TQWidget *parent = 0 ); virtual ~KComboBoxDialog(); /** * @return the value the user chose */ - QString text() const; + TQString text() const; /** * @return the line edit widget @@ -70,9 +70,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 QString::null to disable + * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use TQString::null to disable */ - static QString getItem( const QString &_text, const QStringList &_items, const QString& _value = QString::null, const QString &dontAskAgainName = QString::null, QWidget *parent = 0 ); + static TQString getItem( const TQString &_text, const TQStringList &_items, const TQString& _value = TQString::null, const TQString &dontAskAgainName = TQString::null, TQWidget *parent = 0 ); /** * Static convenience function to get input from the user. @@ -82,9 +82,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 QString::null to disable + * @param dontAskAgainName Name for saving whether the user doesn't want to be asked again; use TQString::null to disable */ - static QString getItem( const QString &_text, const QString &_caption, const QStringList &_items, const QString& _value = QString::null, const QString &dontAskAgainName = QString::null, QWidget *parent = 0 ); + 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 convenience method. @@ -99,15 +99,15 @@ public: * @param configName Name of the dialog for saving the completion and history * @parma config KConfig for saving the completion and history */ - static QString getText(const QString &_caption, const QString &_text, - const QString &_value = QString::null, - bool *ok = 0, QWidget *parent = 0, - const QString &configName = QString::null, + 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, KConfig *config = KGlobal::config()); protected: KHistoryCombo *combo; - QCheckBox *dontAskAgainCheckBox; + TQCheckBox *dontAskAgainCheckBox; bool dontAskAgainChecked(); }; diff --git a/kolf/kolf.cpp b/kolf/kolf.cpp index 33155b6a..696ddc72 100644 --- a/kolf/kolf.cpp +++ b/kolf/kolf.cpp @@ -19,21 +19,21 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include @@ -62,10 +62,10 @@ Kolf::Kolf() obj = new ObjectList; initPlugins(); - filename = QString::null; - dummy = new QWidget(this); + filename = TQString::null; + dummy = new TQWidget(this); setCentralWidget(dummy); - layout = new QGridLayout(dummy, 3, 1); + layout = new TQGridLayout(dummy, 3, 1); resize(420, 480); } @@ -79,75 +79,75 @@ Kolf::~Kolf() void Kolf::initGUI() { - newAction = KStdGameAction::gameNew(this, SLOT(newGame()), actionCollection()); - newAction->setText(newAction->text() + QString("...")); + newAction = KStdGameAction::gameNew(this, TQT_SLOT(newGame()), actionCollection()); + newAction->setText(newAction->text() + TQString("...")); - endAction = KStdGameAction::end(this, SLOT(closeGame()), actionCollection()); - printAction = KStdGameAction::print(this, SLOT(print()), actionCollection()); + endAction = KStdGameAction::end(this, TQT_SLOT(closeGame()), actionCollection()); + printAction = KStdGameAction::print(this, TQT_SLOT(print()), actionCollection()); - (void) KStdGameAction::quit(this, SLOT(close()), actionCollection()); - saveAction = KStdAction::save(this, SLOT(save()), actionCollection(), "game_save"); + (void) KStdGameAction::quit(this, TQT_SLOT(close()), actionCollection()); + saveAction = KStdAction::save(this, TQT_SLOT(save()), actionCollection(), "game_save"); saveAction->setText(i18n("Save &Course")); - saveAsAction = KStdAction::saveAs(this, SLOT(saveAs()), actionCollection(), "game_save_as"); + saveAsAction = KStdAction::saveAs(this, TQT_SLOT(saveAs()), actionCollection(), "game_save_as"); saveAsAction->setText(i18n("Save &Course As...")); - saveGameAction = new KAction(i18n("&Save Game"), 0, this, SLOT(saveGame()), actionCollection(), "savegame"); - saveGameAsAction = new KAction(i18n("&Save Game As..."), 0, this, SLOT(saveGameAs()), actionCollection(), "savegameas"); + 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"); - loadGameAction = KStdGameAction::load(this, SLOT(loadGame()), actionCollection()); + loadGameAction = KStdGameAction::load(this, TQT_SLOT(loadGame()), actionCollection()); loadGameAction->setText(i18n("Load Saved Game...")); - highScoreAction = KStdGameAction::highscores(this, SLOT(showHighScores()), actionCollection()); + highScoreAction = KStdGameAction::highscores(this, TQT_SLOT(showHighScores()), actionCollection()); - editingAction = new KToggleAction(i18n("&Edit"), "pencil", CTRL+Key_E, this, SLOT(emptySlot()), actionCollection(), "editing"); - newHoleAction = new KAction(i18n("&New"), "filenew", CTRL+SHIFT+Key_N, this, SLOT(emptySlot()), actionCollection(), "newhole"); - clearHoleAction = new KAction(KStdGuiItem::clear().text(), "locationbar_erase", CTRL+Key_Delete, this, SLOT(emptySlot()), actionCollection(), "clearhole"); - resetHoleAction = new KAction(i18n("&Reset"), CTRL+Key_R, this, SLOT(emptySlot()), actionCollection(), "resethole"); - undoShotAction = KStdAction::undo(this, SLOT(emptySlot()), actionCollection(), "undoshot"); + 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"); undoShotAction->setText(i18n("&Undo Shot")); - //replayShotAction = new KAction(i18n("&Replay Shot"), 0, this, SLOT(emptySlot()), actionCollection(), "replay"); + //replayShotAction = new KAction(i18n("&Replay Shot"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "replay"); - holeAction = new KListAction(i18n("Switch to Hole"), 0, this, SLOT(emptySlot()), actionCollection(), "switchhole"); - nextAction = new KAction(i18n("&Next Hole"), "forward", KStdAccel::shortcut(KStdAccel::Forward), this, SLOT(emptySlot()), actionCollection(), "nexthole"); - prevAction = new KAction(i18n("&Previous Hole"), "back", KStdAccel::shortcut(KStdAccel::Back), this, SLOT(emptySlot()), actionCollection(), "prevhole"); - firstAction = new KAction(i18n("&First Hole"), "gohome", KStdAccel::shortcut(KStdAccel::Home), this, SLOT(emptySlot()), actionCollection(), "firsthole"); - lastAction = new KAction(i18n("&Last Hole"), CTRL+SHIFT+Key_End, this, SLOT(emptySlot()), actionCollection(), "lasthole"); - randAction = new KAction(i18n("&Random Hole"), "goto", 0, this, SLOT(emptySlot()), actionCollection(), "randhole"); + 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"); - useMouseAction = new KToggleAction(i18n("Enable &Mouse for Moving Putter"), 0, this, SLOT(emptySlot()), actionCollection(), "usemouse"); + useMouseAction = new KToggleAction(i18n("Enable &Mouse for Moving Putter"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "usemouse"); useMouseAction->setCheckedState(i18n("Disable &Mouse for Moving Putter")); - connect(useMouseAction, SIGNAL(toggled(bool)), this, SLOT(useMouseChanged(bool))); + connect(useMouseAction, TQT_SIGNAL(toggled(bool)), 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, SLOT(emptySlot()), actionCollection(), "useadvancedputting"); + useAdvancedPuttingAction = new KToggleAction(i18n("Enable &Advanced Putting"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "useadvancedputting"); useAdvancedPuttingAction->setCheckedState(i18n("Disable &Advanced Putting")); - connect(useAdvancedPuttingAction, SIGNAL(toggled(bool)), this, SLOT(useAdvancedPuttingChanged(bool))); + connect(useAdvancedPuttingAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(useAdvancedPuttingChanged(bool))); useAdvancedPuttingAction->setChecked(config->readBoolEntry("useAdvancedPutting", false)); - showInfoAction = new KToggleAction(i18n("Show &Info"), "info", CTRL+Key_I, this, SLOT(emptySlot()), actionCollection(), "showinfo"); + showInfoAction = new KToggleAction(i18n("Show &Info"), "info", CTRL+Key_I, this, TQT_SLOT(emptySlot()), actionCollection(), "showinfo"); showInfoAction->setCheckedState(i18n("Hide &Info")); - connect(showInfoAction, SIGNAL(toggled(bool)), this, SLOT(showInfoChanged(bool))); + connect(showInfoAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showInfoChanged(bool))); showInfoAction->setChecked(config->readBoolEntry("showInfo", false)); - showGuideLineAction = new KToggleAction(i18n("Show Putter &Guideline"), 0, this, SLOT(emptySlot()), actionCollection(), "showguideline"); + showGuideLineAction = new KToggleAction(i18n("Show Putter &Guideline"), 0, this, TQT_SLOT(emptySlot()), actionCollection(), "showguideline"); showGuideLineAction->setCheckedState(i18n("Hide Putter &Guideline")); - connect(showGuideLineAction, SIGNAL(toggled(bool)), this, SLOT(showGuideLineChanged(bool))); + connect(showGuideLineAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(showGuideLineChanged(bool))); showGuideLineAction->setChecked(config->readBoolEntry("showGuideLine", true)); - KToggleAction *act=new KToggleAction(i18n("Enable All Dialog Boxes"), 0, this, SLOT(enableAllMessages()), actionCollection(), "enableAll"); + KToggleAction *act=new KToggleAction(i18n("Enable All Dialog Boxes"), 0, this, TQT_SLOT(enableAllMessages()), actionCollection(), "enableAll"); act->setCheckedState(i18n("Disable All Dialog Boxes")); - soundAction = new KToggleAction(i18n("Play &Sounds"), 0, this, SLOT(emptySlot()), actionCollection(), "sound"); - connect(soundAction, SIGNAL(toggled(bool)), this, SLOT(soundChanged(bool))); + 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->setChecked(config->readBoolEntry("sound", true)); - (void) new KAction(i18n("&Reload Plugins"), 0, this, SLOT(initPlugins()), actionCollection(), "reloadplugins"); - (void) new KAction(i18n("Show &Plugins"), 0, this, SLOT(showPlugins()), actionCollection(), "showplugins"); + (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"); - aboutAction = new KAction(i18n("&About Course"), 0, this, SLOT(emptySlot()), actionCollection(), "aboutcourse"); - tutorialAction = new KAction(i18n("&Tutorial"), 0, this, SLOT(tutorial()), actionCollection(), "tutorial"); + 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"); statusBar(); setupGUI(); @@ -169,7 +169,7 @@ void Kolf::startNewGame() if (loadedGame.isNull()) { dialog = new NewGameDialog(filename.isNull(), dummy, "New Game Dialog"); - if (dialog->exec() != QDialog::Accepted) + if (dialog->exec() != TQDialog::Accepted) goto end; } @@ -202,7 +202,7 @@ void Kolf::startNewGame() if (isTutorial) filename = KGlobal::dirs()->findResource("appdata", "tutorial.kolf"); else - filename = config.readEntry("Course", QString::null); + filename = config.readEntry("Course", TQString::null); if (filename.isNull()) return; @@ -223,40 +223,40 @@ void Kolf::startNewGame() game = new KolfGame(obj, &players, filename, dummy); game->setStrict(competition); - connect(game, SIGNAL(newHole(int)), scoreboard, SLOT(newHole(int))); - connect(game, SIGNAL(scoreChanged(int, int, int)), scoreboard, SLOT(setScore(int, int, int))); - connect(game, SIGNAL(parChanged(int, int)), scoreboard, SLOT(parChanged(int, int))); - connect(game, SIGNAL(modifiedChanged(bool)), this, SLOT(updateModified(bool))); - connect(game, SIGNAL(newPlayersTurn(Player *)), this, SLOT(newPlayersTurn(Player *))); - connect(game, SIGNAL(holesDone()), this, SLOT(gameOver())); - connect(game, SIGNAL(checkEditing()), this, SLOT(checkEditing())); - connect(game, SIGNAL(editingStarted()), this, SLOT(editingStarted())); - connect(game, SIGNAL(editingEnded()), this, SLOT(editingEnded())); - connect(game, SIGNAL(inPlayStart()), this, SLOT(inPlayStart())); - connect(game, SIGNAL(inPlayEnd()), this, SLOT(inPlayEnd())); - connect(game, SIGNAL(maxStrokesReached(const QString &)), this, SLOT(maxStrokesReached(const QString &))); - connect(game, SIGNAL(largestHole(int)), this, SLOT(updateHoleMenu(int))); - connect(game, SIGNAL(titleChanged(const QString &)), this, SLOT(titleChanged(const QString &))); - connect(game, SIGNAL(newStatusText(const QString &)), this, SLOT(newStatusText(const QString &))); - connect(game, SIGNAL(currentHole(int)), this, SLOT(setCurrentHole(int))); - connect(holeAction, SIGNAL(activated(const QString &)), game, SLOT(switchHole(const QString &))); - connect(nextAction, SIGNAL(activated()), game, SLOT(nextHole())); - connect(prevAction, SIGNAL(activated()), game, SLOT(prevHole())); - connect(firstAction, SIGNAL(activated()), game, SLOT(firstHole())); - connect(lastAction, SIGNAL(activated()), game, SLOT(lastHole())); - connect(randAction, SIGNAL(activated()), game, SLOT(randHole())); - connect(editingAction, SIGNAL(activated()), game, SLOT(toggleEditMode())); - connect(newHoleAction, SIGNAL(activated()), game, SLOT(addNewHole())); - connect(clearHoleAction, SIGNAL(activated()), game, SLOT(clearHole())); - connect(resetHoleAction, SIGNAL(activated()), game, SLOT(resetHole())); - connect(undoShotAction, SIGNAL(activated()), game, SLOT(undoShot())); - //connect(replayShotAction, SIGNAL(activated()), game, SLOT(replay())); - connect(aboutAction, SIGNAL(activated()), game, SLOT(showInfoDlg())); - connect(useMouseAction, SIGNAL(toggled(bool)), game, SLOT(setUseMouse(bool))); - connect(useAdvancedPuttingAction, SIGNAL(toggled(bool)), game, SLOT(setUseAdvancedPutting(bool))); - connect(soundAction, SIGNAL(toggled(bool)), game, SLOT(setSound(bool))); - connect(showGuideLineAction, SIGNAL(toggled(bool)), game, SLOT(setShowGuideLine(bool))); - connect(showInfoAction, SIGNAL(toggled(bool)), game, SLOT(setShowInfo(bool))); + 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(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())); + connect(firstAction, TQT_SIGNAL(activated()), game, TQT_SLOT(firstHole())); + connect(lastAction, TQT_SIGNAL(activated()), game, TQT_SLOT(lastHole())); + connect(randAction, TQT_SIGNAL(activated()), game, TQT_SLOT(randHole())); + connect(editingAction, TQT_SIGNAL(activated()), game, TQT_SLOT(toggleEditMode())); + connect(newHoleAction, TQT_SIGNAL(activated()), game, TQT_SLOT(addNewHole())); + connect(clearHoleAction, TQT_SIGNAL(activated()), game, TQT_SLOT(clearHole())); + connect(resetHoleAction, TQT_SIGNAL(activated()), game, TQT_SLOT(resetHole())); + connect(undoShotAction, TQT_SIGNAL(activated()), game, TQT_SLOT(undoShot())); + //connect(replayShotAction, TQT_SIGNAL(activated()), game, TQT_SLOT(replay())); + connect(aboutAction, TQT_SIGNAL(activated()), game, TQT_SLOT(showInfoDlg())); + connect(useMouseAction, TQT_SIGNAL(toggled(bool)), game, TQT_SLOT(setUseMouse(bool))); + connect(useAdvancedPuttingAction, TQT_SIGNAL(toggled(bool)), game, TQT_SLOT(setUseAdvancedPutting(bool))); + connect(soundAction, TQT_SIGNAL(toggled(bool)), game, TQT_SLOT(setSound(bool))); + connect(showGuideLineAction, TQT_SIGNAL(toggled(bool)), game, TQT_SLOT(setShowGuideLine(bool))); + connect(showInfoAction, TQT_SIGNAL(toggled(bool)), game, TQT_SLOT(setShowInfo(bool))); game->setUseMouse(useMouseAction->isChecked()); game->setUseAdvancedPutting(useAdvancedPuttingAction->isChecked()); @@ -299,23 +299,23 @@ void Kolf::startNewGame() void Kolf::newGame() { isTutorial = false; - filename = QString::null; + filename = TQString::null; startNewGame(); } void Kolf::tutorial() { - QString newfilename = KGlobal::dirs()->findResource("appdata", "tutorial.kolfgame"); + TQString newfilename = KGlobal::dirs()->findResource("appdata", "tutorial.kolfgame"); if (newfilename.isNull()) return; - filename = QString::null; + filename = TQString::null; loadedGame = newfilename; isTutorial = true; startNewGame(); - loadedGame = QString::null; + loadedGame = TQString::null; } void Kolf::closeGame() @@ -327,12 +327,12 @@ void Kolf::closeGame() game->pause(); } - filename = QString::null; + filename = TQString::null; editingEnded(); delete game; game = 0; - loadedGame = QString::null; + loadedGame = TQString::null; editingAction->setChecked(false); setEditingEnabled(false); @@ -353,10 +353,10 @@ void Kolf::closeGame() loadGameAction->setEnabled(true); tutorialAction->setEnabled(true); - titleChanged(QString::null); + titleChanged(TQString::null); updateModified(false); - QTimer::singleShot(100, this, SLOT(createSpacer())); + TQTimer::singleShot(100, this, TQT_SLOT(createSpacer())); } void Kolf::createSpacer() @@ -386,14 +386,14 @@ void Kolf::gameOver() int curScore = 1; // names of people who had the lowest score - QStringList names; + TQStringList names; HighScoreList highScores; int scoreBoardIndex = 1; while (curScore != 0) { - QString curName; + TQString curName; // name taken as a reference and filled out curScore = scoreboard->total(scoreBoardIndex, curName); @@ -430,7 +430,7 @@ void Kolf::gameOver() { if (names.count() > 1) { - QString winners = names.join(i18n(" and ")); + TQString winners = names.join(i18n(" and ")); KMessageBox::information(this, i18n("%1 tied").arg(winners)); } else @@ -448,13 +448,13 @@ void Kolf::gameOver() CourseInfo courseInfo; game->courseInfo(courseInfo, game->curFilename()); - scoreDialog->setConfigGroup(courseInfo.untranslatedName + QString(" Highscores")); + scoreDialog->setConfigGroup(courseInfo.untranslatedName + TQString(" Highscores")); for (HighScoreList::Iterator it = highScores.begin(); it != highScores.end(); ++it) { KScoreDialog::FieldInfo info; info[KScoreDialog::Name] = (*it).name; - info[KScoreDialog::Custom1] = QString::number(curPar); + info[KScoreDialog::Custom1] = TQString::number(curPar); scoreDialog->addScore((*it).score, info, false, true); } @@ -463,7 +463,7 @@ void Kolf::gameOver() scoreDialog->show(); } - QTimer::singleShot(700, this, SLOT(closeGame())); + TQTimer::singleShot(700, this, TQT_SLOT(closeGame())); } void Kolf::showHighScores() @@ -474,7 +474,7 @@ void Kolf::showHighScores() CourseInfo courseInfo; game->courseInfo(courseInfo, game->curFilename()); - scoreDialog->setConfigGroup(courseInfo.untranslatedName + QString(" Highscores")); + scoreDialog->setConfigGroup(courseInfo.untranslatedName + TQString(" Highscores")); scoreDialog->setComment(i18n("High Scores for %1").arg(courseInfo.name)); scoreDialog->show(); } @@ -495,7 +495,7 @@ void Kolf::save() void Kolf::saveAs() { - QString newfilename = KFileDialog::getSaveFileName(":kourses", "application/x-kourse", this, i18n("Pick Kolf Course to Save To")); + TQString newfilename = KFileDialog::getSaveFileName(":kourses", "application/x-kourse", this, i18n("Pick Kolf Course to Save To")); if (!newfilename.isNull()) { filename = newfilename; @@ -507,7 +507,7 @@ void Kolf::saveAs() void Kolf::saveGameAs() { - QString newfilename = KFileDialog::getSaveFileName(":savedkolf", "application/x-kolf", this, i18n("Pick Saved Game to Save To")); + TQString newfilename = KFileDialog::getSaveFileName(":savedkolf", "application/x-kolf", this, i18n("Pick Saved Game to Save To")); if (newfilename.isNull()) return; @@ -537,7 +537,7 @@ void Kolf::saveGame() void Kolf::loadGame() { - loadedGame = KFileDialog::getOpenFileName(":savedkolf", QString::fromLatin1("application/x-kolf"), this, i18n("Pick Kolf Saved Game")); + loadedGame = KFileDialog::getOpenFileName(":savedkolf", TQString::fromLatin1("application/x-kolf"), this, i18n("Pick Kolf Saved Game")); if (loadedGame.isNull()) return; @@ -549,11 +549,11 @@ void Kolf::loadGame() // called by main for commmand line files void Kolf::openURL(KURL url) { - QString target; + TQString target; if (KIO::NetAccess::download(url, target, this)) { isTutorial = false; - QString mimeType = KMimeType::findByPath(target)->name(); + TQString mimeType = KMimeType::findByPath(target)->name(); if (mimeType == "application/x-kourse") filename = target; else if (mimeType == "application/x-kolf") @@ -564,7 +564,7 @@ void Kolf::openURL(KURL url) return; } - QTimer::singleShot(10, this, SLOT(startNewGame())); + TQTimer::singleShot(10, this, TQT_SLOT(startNewGame())); } else closeGame(); @@ -582,7 +582,7 @@ void Kolf::newPlayersTurn(Player *player) scoreboard->setCurrentCell(player->id() - 1, game->currentHole() - 1); } -void Kolf::newStatusText(const QString &text) +void Kolf::newStatusText(const TQString &text) { if (text.isEmpty()) statusBar()->message(tempStatusBarText); @@ -594,10 +594,10 @@ void Kolf::editingStarted() { delete editor; editor = new Editor(obj, dummy, "Editor"); - connect(editor, SIGNAL(addNewItem(Object *)), game, SLOT(addNewObject(Object *))); - connect(editor, SIGNAL(changed()), game, SLOT(setModified())); - connect(editor, SIGNAL(addNewItem(Object *)), this, SLOT(setHoleFocus())); - connect(game, SIGNAL(newSelectedItem(CanvasItem *)), editor, SLOT(setItem(CanvasItem *))); + 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(game, TQT_SIGNAL(newSelectedItem(CanvasItem *)), editor, TQT_SLOT(setItem(CanvasItem *))); scoreboard->hide(); @@ -641,16 +641,16 @@ void Kolf::inPlayEnd() setHoleMovementEnabled(true); } -void Kolf::maxStrokesReached(const QString &name) +void Kolf::maxStrokesReached(const TQString &name) { KMessageBox::sorry(this, i18n("%1's score has reached the maximum for this hole.").arg(name)); } void Kolf::updateHoleMenu(int largest) { - QStringList items; + TQStringList items; for (int i = 1; i <= largest; ++i) - items.append(QString::number(i)); + items.append(TQString::number(i)); // setItems for some reason enables the action bool shouldbe = holeAction->isEnabled(); @@ -711,7 +711,7 @@ void Kolf::updateModified(bool mod) titleChanged(title); } -void Kolf::titleChanged(const QString &newTitle) +void Kolf::titleChanged(const TQString &newTitle) { title = newTitle; setCaption(title, courseModified); @@ -785,7 +785,7 @@ void Kolf::initPlugins() void Kolf::showPlugins() { - QString text = QString("

%1

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

    %1

      ").arg(i18n("Currently Loaded Plugins")); Object *object = 0; for (object = plugins.first(); object; object = plugins.next()) { diff --git a/kolf/kolf.h b/kolf/kolf.h index 8a2c6d78..035448ab 100644 --- a/kolf/kolf.h +++ b/kolf/kolf.h @@ -4,11 +4,11 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include "game.h" @@ -59,10 +59,10 @@ protected slots: void setHoleFocus() { game->setFocus(); } void inPlayStart(); void inPlayEnd(); - void maxStrokesReached(const QString &); + void maxStrokesReached(const TQString &); void updateHoleMenu(int); - void titleChanged(const QString &); - void newStatusText(const QString &); + void titleChanged(const TQString &); + void newStatusText(const TQString &); void showInfoChanged(bool); void useMouseChanged(bool); void useAdvancedPuttingChanged(bool); @@ -79,15 +79,15 @@ protected slots: void setCurrentHole(int); private: - QWidget *dummy; + TQWidget *dummy; KolfGame *game; Editor *editor; KolfGame *spacer; void initGUI(); - QString filename; + TQString filename; PlayerList players; PlayerList spacerPlayers; - QGridLayout *layout; + TQGridLayout *layout; ScoreBoard *scoreboard; KToggleAction *editingAction; KAction *newHoleAction; @@ -127,21 +127,21 @@ private: // contains subset of obj ObjectList plugins; - QString loadedGame; + TQString loadedGame; bool isTutorial; bool courseModified; - QString title; - QString tempStatusBarText; + TQString title; + TQString tempStatusBarText; }; struct HighScore { HighScore() {} - HighScore(const QString &name, int score) { this->name = name; this->score = score; } - QString name; + HighScore(const TQString &name, int score) { this->name = name; this->score = score; } + TQString name; int score; }; -typedef QValueList HighScoreList; +typedef TQValueList HighScoreList; #endif diff --git a/kolf/kvolumecontrol.cpp b/kolf/kvolumecontrol.cpp index 11d0be15..e2aaa464 100644 --- a/kolf/kvolumecontrol.cpp +++ b/kolf/kvolumecontrol.cpp @@ -6,13 +6,13 @@ #include "kvolumecontrol.h" KVolumeControl::KVolumeControl(Arts::SoundServerV2 server, KPlayObject *parent) - : QObject(parent) + : TQObject(parent) { init(server); } KVolumeControl::KVolumeControl(double vol, Arts::SoundServerV2 server, KPlayObject *parent) - : QObject(parent) + : TQObject(parent) { init(server); setVolume(vol); diff --git a/kolf/kvolumecontrol.h b/kolf/kvolumecontrol.h index 3f0306a8..ab7632f4 100644 --- a/kolf/kvolumecontrol.h +++ b/kolf/kvolumecontrol.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include class KVolumeControl : public QObject { diff --git a/kolf/main.cpp b/kolf/main.cpp index 3a63c1f1..e9e8498a 100644 --- a/kolf/main.cpp +++ b/kolf/main.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include #include @@ -50,8 +50,8 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) { KCmdLineArgs::enable_i18n(); - QString filename(QFile::decodeName(args->getOption("course-info"))); - if (QFile::exists(filename)) + TQString filename(TQFile::decodeName(args->getOption("course-info"))); + if (TQFile::exists(filename)) { CourseInfo info; KolfGame::courseInfo(info, filename); @@ -70,7 +70,7 @@ extern "C" KDE_EXPORT int kdemain(int argc, char **argv) } } - QApplication::setColorSpec(QApplication::ManyColor); + TQApplication::setColorSpec(TQApplication::ManyColor); KApplication a; KGlobal::locale()->insertCatalogue("libkdegames"); diff --git a/kolf/newgame.cpp b/kolf/newgame.cpp index d038185e..22c6b785 100644 --- a/kolf/newgame.cpp +++ b/kolf/newgame.cpp @@ -12,30 +12,30 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "newgame.h" #include "game.h" -NewGameDialog::NewGameDialog(bool enableCourses, QWidget *parent, const char *_name) +NewGameDialog::NewGameDialog(bool enableCourses, TQWidget *parent, const char *_name) : KDialogBase(KDialogBase::TreeList, i18n("New Game"), Ok | Cancel, Ok, parent, _name) { this->enableCourses = enableCourses; @@ -47,34 +47,34 @@ NewGameDialog::NewGameDialog(bool enableCourses, QWidget *parent, const char *_n startColors << yellow << blue << red << lightGray << cyan << darkBlue << magenta << darkGray << darkMagenta << darkYellow; playerPage = addPage(i18n("Players")); - QVBoxLayout *bigLayout = new QVBoxLayout(playerPage, marginHint(), spacingHint()); + TQVBoxLayout *bigLayout = new TQVBoxLayout(playerPage, marginHint(), spacingHint()); addButton = new KPushButton(i18n("&New Player"), playerPage); bigLayout->addWidget(addButton); - connect(addButton, SIGNAL(clicked()), this, SLOT(addPlayer())); + connect(addButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(addPlayer())); - scroller = new QScrollView(playerPage); + scroller = new TQScrollView(playerPage); bigLayout->addWidget(scroller); - layout = new QVBox(scroller->viewport()); - if (!QPixmapCache::find("grass", grass)) + layout = new TQVBox(scroller->viewport()); + if (!TQPixmapCache::find("grass", grass)) { grass.load(locate("appdata", "pics/grass.png")); - QPixmapCache::insert("grass", grass); + TQPixmapCache::insert("grass", grass); } scroller->viewport()->setBackgroundPixmap(grass); scroller->addChild(layout); - QMap entries = config->entryMap("New Game Dialog"); + TQMap entries = config->entryMap("New Game Dialog"); unsigned int i = 0; - for (QMap::Iterator it = entries.begin(); it != entries.end(); ++it) + for (TQMap::Iterator it = entries.begin(); it != entries.end(); ++it) { if (i > startColors.count()) return; addPlayer(); editors.last()->setName(it.key().right(it.key().length() - 1)); - editors.last()->setColor(QColor(it.data())); + editors.last()->setColor(TQColor(it.data())); ++i; } @@ -89,13 +89,13 @@ NewGameDialog::NewGameDialog(bool enableCourses, QWidget *parent, const char *_n if (enableCourses) { coursePage = addPage(i18n("Course"), i18n("Choose Course to Play")); - QVBoxLayout *coursePageLayout = new QVBoxLayout(coursePage, marginHint(), spacingHint()); + TQVBoxLayout *coursePageLayout = new TQVBoxLayout(coursePage, marginHint(), spacingHint()); KURLLabel *coursesLink = new KURLLabel("http://web.mit.edu/~jasonkb/www/kolf/", "http://web.mit.edu/~jasonkb/www/kolf/", coursePage); - connect(coursesLink, SIGNAL(leftClickedURL(const QString &)), kapp, SLOT(invokeBrowser(const QString &))); + connect(coursesLink, TQT_SIGNAL(leftClickedURL(const TQString &)), kapp, TQT_SLOT(invokeBrowser(const TQString &))); coursePageLayout->addWidget(coursesLink); - QHBoxLayout *hlayout = new QHBoxLayout(coursePageLayout, spacingHint()); + TQHBoxLayout *hlayout = new TQHBoxLayout(coursePageLayout, spacingHint()); // following use this group config->setGroup("New Game Dialog Mode"); @@ -104,14 +104,14 @@ NewGameDialog::NewGameDialog(bool enableCourses, QWidget *parent, const char *_n externCourses = config->readListEntry("extra"); /// course loading - QStringList items = externCourses + KGlobal::dirs()->findAllResources("appdata", "courses/*"); - QStringList nameList; - const QString lastCourse(config->readEntry("course", "")); + TQStringList items = externCourses + KGlobal::dirs()->findAllResources("appdata", "courses/*"); + TQStringList nameList; + const TQString lastCourse(config->readEntry("course", "")); int curItem = 0; i = 0; - for (QStringList::Iterator it = items.begin(); it != items.end(); ++it, ++i) + for (TQStringList::Iterator it = items.begin(); it != items.end(); ++it, ++i) { - QString file = *it; + TQString file = *it; CourseInfo curinfo; KolfGame::courseInfo(curinfo, file); info[file] = curinfo; @@ -122,47 +122,47 @@ NewGameDialog::NewGameDialog(bool enableCourses, QWidget *parent, const char *_n curItem = i; } - const QString newName(i18n("Create New")); - info[QString::null] = CourseInfo(newName, newName, i18n("You"), 0, 0); - names.append(QString::null); + const TQString newName(i18n("Create New")); + info[TQString::null] = CourseInfo(newName, newName, i18n("You"), 0, 0); + names.append(TQString::null); nameList.append(newName); courseList = new KListBox(coursePage); hlayout->addWidget(courseList); courseList->insertStringList(nameList); courseList->setCurrentItem(curItem); - connect(courseList, SIGNAL(highlighted(int)), this, SLOT(courseSelected(int))); - connect(courseList, SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); + connect(courseList, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(courseSelected(int))); + connect(courseList, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(selectionChanged())); - QVBoxLayout *detailLayout = new QVBoxLayout(hlayout, spacingHint()); - name = new QLabel(coursePage); + TQVBoxLayout *detailLayout = new TQVBoxLayout(hlayout, spacingHint()); + name = new TQLabel(coursePage); detailLayout->addWidget(name); - author = new QLabel(coursePage); + author = new TQLabel(coursePage); detailLayout->addWidget(author); - QHBoxLayout *minorLayout = new QHBoxLayout(detailLayout, spacingHint()); - par = new QLabel(coursePage); + TQHBoxLayout *minorLayout = new TQHBoxLayout(detailLayout, spacingHint()); + par = new TQLabel(coursePage); minorLayout->addWidget(par); - holes = new QLabel(coursePage); + holes = new TQLabel(coursePage); minorLayout->addWidget(holes); detailLayout->addStretch(); KPushButton *scores = new KPushButton(i18n("Highscores"), coursePage); - connect(scores, SIGNAL(clicked()), this, SLOT(showHighscores())); + connect(scores, TQT_SIGNAL(clicked()), this, TQT_SLOT(showHighscores())); detailLayout->addWidget(scores); detailLayout->addStretch(); detailLayout->addWidget(new KSeparator(coursePage)); - minorLayout = new QHBoxLayout(detailLayout, spacingHint()); + minorLayout = new TQHBoxLayout(detailLayout, spacingHint()); KPushButton *addCourseButton = new KPushButton(i18n("Add..."), coursePage); minorLayout->addWidget(addCourseButton); - connect(addCourseButton, SIGNAL(clicked()), this, SLOT(addCourse())); + connect(addCourseButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(addCourse())); remove = new KPushButton(i18n("Remove"), coursePage); minorLayout->addWidget(remove); - connect(remove, SIGNAL(clicked()), this, SLOT(removeCourse())); + connect(remove, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeCourse())); courseSelected(curItem); selectionChanged(); @@ -170,13 +170,13 @@ NewGameDialog::NewGameDialog(bool enableCourses, QWidget *parent, const char *_n // options page optionsPage = addPage(i18n("Options"), i18n("Game Options")); - QVBoxLayout *vlayout = new QVBoxLayout(optionsPage, marginHint(), spacingHint()); + TQVBoxLayout *vlayout = new TQVBoxLayout(optionsPage, marginHint(), spacingHint()); - mode = new QCheckBox(i18n("&Strict mode"), optionsPage); + mode = new TQCheckBox(i18n("&Strict mode"), optionsPage); vlayout->addWidget(mode); mode->setChecked(config->readBoolEntry("competition", false)); - QLabel *desc = new QLabel(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); + 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); } @@ -199,7 +199,7 @@ void NewGameDialog::slotOk() PlayerEditor *curEditor = 0; int i = 0; for (curEditor = editors.first(); curEditor; curEditor = editors.next(), ++i) - config->writeEntry(QString::number(i) + curEditor->name(), curEditor->color().name()); + config->writeEntry(TQString::number(i) + curEditor->name(), curEditor->color().name()); config->sync(); @@ -212,7 +212,7 @@ void NewGameDialog::courseSelected(int index) CourseInfo &curinfo = info[currentCourse]; - name->setText(QString("%1").arg(curinfo.name)); + name->setText(TQString("%1").arg(curinfo.name)); author->setText(i18n("By %1").arg(curinfo.author)); par->setText(i18n("Par %1").arg(curinfo.par)); @@ -223,7 +223,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 + QString(" Highscores")); + scoreDialog->setConfigGroup(info[currentCourse].untranslatedName + TQString(" Highscores")); scoreDialog->setComment(i18n("High Scores for %1").arg(info[currentCourse].name)); scoreDialog->show(); } @@ -234,7 +234,7 @@ void NewGameDialog::removeCourse() if (curItem < 0) return; - QString file = *names.at(curItem); + TQString file = *names.at(curItem); if (externCourses.contains(file) < 1) return; @@ -253,11 +253,11 @@ void NewGameDialog::selectionChanged() void NewGameDialog::addCourse() { - QStringList files = KFileDialog::getOpenFileNames(":kourses", QString::fromLatin1("application/x-kourse"), this, i18n("Pick Kolf Course")); + TQStringList files = KFileDialog::getOpenFileNames(":kourses", TQString::fromLatin1("application/x-kourse"), this, i18n("Pick Kolf Course")); bool hasDuplicates = false; - for (QStringList::Iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) + for (TQStringList::Iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) { if (names.contains(*fileIt) > 0) { @@ -289,7 +289,7 @@ void NewGameDialog::addPlayer() editors.append(new PlayerEditor(i18n("Player %1").arg(editors.count() + 1), *startColors.at(editors.count()), layout)); editors.last()->show(); - connect(editors.last(), SIGNAL(deleteEditor(PlayerEditor *)), this, SLOT(deleteEditor(PlayerEditor *))); + connect(editors.last(), TQT_SIGNAL(deleteEditor(PlayerEditor *)), this, TQT_SLOT(deleteEditor(PlayerEditor *))); enableButtons(); } @@ -311,15 +311,15 @@ void NewGameDialog::enableButtons() ///////////////////////// -PlayerEditor::PlayerEditor(QString startName, QColor startColor, QWidget *parent, const char *_name) - : QWidget(parent, _name) +PlayerEditor::PlayerEditor(TQString startName, TQColor startColor, TQWidget *parent, const char *_name) + : TQWidget(parent, _name) { - QHBoxLayout *layout = new QHBoxLayout(this, KDialogBase::spacingHint()); + TQHBoxLayout *layout = new TQHBoxLayout(this, KDialogBase::spacingHint()); - if (!QPixmapCache::find("grass", grass)) + if (!TQPixmapCache::find("grass", grass)) { grass.load(locate("appdata", "pics/grass.png")); - QPixmapCache::insert("grass", grass); + TQPixmapCache::insert("grass", grass); } setBackgroundPixmap(grass); @@ -336,7 +336,7 @@ PlayerEditor::PlayerEditor(QString startName, QColor startColor, QWidget *parent remove->setAutoMask(true); layout->addWidget(remove); remove->setBackgroundPixmap(grass); - connect(remove, SIGNAL(clicked()), this, SLOT(removeMe())); + connect(remove, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeMe())); } void PlayerEditor::removeMe() diff --git a/kolf/newgame.h b/kolf/newgame.h index b9770a80..3259846f 100644 --- a/kolf/newgame.h +++ b/kolf/newgame.h @@ -5,14 +5,14 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include "game.h" @@ -29,11 +29,11 @@ class PlayerEditor : public QWidget Q_OBJECT public: - PlayerEditor(QString name = QString::null, QColor = red, QWidget *parent = 0, const char *_name = 0); - QColor color() { return colorButton->color(); } - QString name() { return editor->text(); } - void setColor(QColor col) { colorButton->setColor(col); } - void setName(const QString &newname) { editor->setText(newname); } + PlayerEditor(TQString name = TQString::null, TQColor = red, TQWidget *parent = 0, const char *_name = 0); + TQColor color() { return colorButton->color(); } + TQString name() { return editor->text(); } + void setColor(TQColor col) { colorButton->setColor(col); } + void setName(const TQString &newname) { editor->setText(newname); } signals: void deleteEditor(PlayerEditor *editor); @@ -44,7 +44,7 @@ private slots: private: KLineEdit *editor; KColorButton *colorButton; - QPixmap grass; + TQPixmap grass; }; class NewGameDialog : public KDialogBase @@ -52,10 +52,10 @@ class NewGameDialog : public KDialogBase Q_OBJECT public: - NewGameDialog(bool enableCourses, QWidget *parent, const char *_name = 0); - QPtrList *players() { return &editors; } + NewGameDialog(bool enableCourses, TQWidget *parent, const char *_name = 0); + TQPtrList *players() { return &editors; } bool competition() { return mode->isChecked(); } - QString course() { return currentCourse; } + TQString course() { return currentCourse; } public slots: void deleteEditor(PlayerEditor *); @@ -72,32 +72,32 @@ private slots: void showHighscores(); private: - QVBox *layout; + TQVBox *layout; KPushButton *addButton; - QFrame *playerPage; - QScrollView *scroller; - QFrame *coursePage; - QFrame *optionsPage; - QValueList startColors; - QPtrList editors; + TQFrame *playerPage; + TQScrollView *scroller; + TQFrame *coursePage; + TQFrame *optionsPage; + TQValueList startColors; + TQPtrList editors; KPushButton *remove; - QCheckBox *mode; + TQCheckBox *mode; - QPixmap grass; + TQPixmap grass; - QStringList names; - QStringList externCourses; - QMap info; + TQStringList names; + TQStringList externCourses; + TQMap info; - QStringList extraCourses; + TQStringList extraCourses; KListBox *courseList; - QLabel *name; - QLabel *author; - QLabel *par; - QLabel *holes; + TQLabel *name; + TQLabel *author; + TQLabel *par; + TQLabel *holes; - QString currentCourse; + TQString currentCourse; void enableButtons(); bool enableCourses; diff --git a/kolf/object.h b/kolf/object.h index a2bf2ef1..1ef52c55 100644 --- a/kolf/object.h +++ b/kolf/object.h @@ -3,28 +3,28 @@ #ifndef KOLF_OBJECT_H #define KOLF_OBJECT_H -#include -#include -#include +#include +#include +#include class Object : public QObject { Q_OBJECT public: - Object(QObject *parent = 0, const char *name = 0) : QObject(parent, name) { m_addOnNewHole = false; } - virtual QCanvasItem *newObject(QCanvas * /*canvas*/) { return 0; } - QString name() { return m_name; } - QString _name() { return m__name; } - QString author() { return m_author; } + Object(TQObject *parent = 0, const char *name = 0) : TQObject(parent, name) { m_addOnNewHole = false; } + virtual TQCanvasItem *newObject(TQCanvas * /*canvas*/) { return 0; } + TQString name() { return m_name; } + TQString _name() { return m__name; } + TQString author() { return m_author; } bool addOnNewHole() { return m_addOnNewHole; } protected: - QString m_name; - QString m__name; - QString m_author; + TQString m_name; + TQString m__name; + TQString m_author; bool m_addOnNewHole; }; -typedef QPtrList ObjectList; +typedef TQPtrList ObjectList; #endif diff --git a/kolf/objects/poolball/poolball.cpp b/kolf/objects/poolball/poolball.cpp index a5ca80ec..c2fe0718 100644 --- a/kolf/objects/poolball/poolball.cpp +++ b/kolf/objects/poolball/poolball.cpp @@ -1,9 +1,9 @@ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -17,9 +17,9 @@ #include "poolball.h" K_EXPORT_COMPONENT_FACTORY(libkolfpoolball, PoolBallFactory) -QObject *PoolBallFactory::createObject (QObject *, const char *, const char *, const QStringList &) { return new PoolBallObj; } +TQObject *PoolBallFactory::createObject (TQObject *, const char *, const char *, const TQStringList &) { return new PoolBallObj; } -PoolBall::PoolBall(QCanvas *canvas) +PoolBall::PoolBall(TQCanvas *canvas) : Ball(canvas) { setBrush(black); @@ -33,7 +33,7 @@ void PoolBall::save(KConfig *cfg) void PoolBall::saveState(StateDB *db) { - db->setPoint(QPoint(x(), y())); + db->setPoint(TQPoint(x(), y())); } void PoolBall::load(KConfig *cfg) @@ -48,20 +48,20 @@ void PoolBall::loadState(StateDB *db) setState(Stopped); } -void PoolBall::draw(QPainter &p) +void PoolBall::draw(TQPainter &p) { // we should draw the number here Ball::draw(p); } -PoolBallConfig::PoolBallConfig(PoolBall *poolBall, QWidget *parent) +PoolBallConfig::PoolBallConfig(PoolBall *poolBall, TQWidget *parent) : Config(parent), m_poolBall(poolBall) { - QVBoxLayout *layout = new QVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); layout->addStretch(); - QLabel *num = new QLabel(i18n("Number:"), this); + TQLabel *num = new TQLabel(i18n("Number:"), this); layout->addWidget(num); KIntNumInput *slider = new KIntNumInput(m_poolBall->number(), this); slider->setRange(1, 15); @@ -69,7 +69,7 @@ PoolBallConfig::PoolBallConfig(PoolBall *poolBall, QWidget *parent) layout->addStretch(); - connect(slider, SIGNAL(valueChanged(int)), this, SLOT(numberChanged(int))); + connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(numberChanged(int))); } void PoolBallConfig::numberChanged(int newNumber) @@ -78,7 +78,7 @@ void PoolBallConfig::numberChanged(int newNumber) changed(); } -Config *PoolBall::config(QWidget *parent) +Config *PoolBall::config(TQWidget *parent) { return new PoolBallConfig(this, parent); } diff --git a/kolf/objects/poolball/poolball.h b/kolf/objects/poolball/poolball.h index eeb851b2..82b1dd68 100644 --- a/kolf/objects/poolball/poolball.h +++ b/kolf/objects/poolball/poolball.h @@ -1,9 +1,9 @@ #ifndef KOLFPOOLBALL_H #define KOLFPOOLBALL_H -#include -#include -#include +#include +#include +#include #include @@ -15,21 +15,21 @@ class StateDB; class KConfig; -class PoolBallFactory : KLibFactory { Q_OBJECT public: QObject *createObject(QObject *, const char *, const char *, const QStringList & = QStringList()); }; +class PoolBallFactory : KLibFactory { Q_OBJECT public: TQObject *createObject(TQObject *, const char *, const char *, const TQStringList & = TQStringList()); }; class PoolBall : public Ball { public: - PoolBall(QCanvas *canvas); + PoolBall(TQCanvas *canvas); virtual bool deleteable() const { return true; } - virtual Config *config(QWidget *parent); + virtual Config *config(TQWidget *parent); virtual void saveState(StateDB *); virtual void save(KConfig *cfg); virtual void loadState(StateDB *); virtual void load(KConfig *cfg); - virtual void draw(QPainter &); + virtual void draw(TQPainter &); virtual bool fastAdvance() const { return true; } int number() const { return m_number; } @@ -44,7 +44,7 @@ class PoolBallConfig : public Config Q_OBJECT public: - PoolBallConfig(PoolBall *poolBall, QWidget *parent); + PoolBallConfig(PoolBall *poolBall, TQWidget *parent); private slots: void numberChanged(int); @@ -57,7 +57,7 @@ class PoolBallObj : public Object { public: PoolBallObj() { m_name = i18n("Pool Ball"); m__name = "poolball"; m_author = "Jason Katz-Brown"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new PoolBall(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new PoolBall(canvas); } }; #endif diff --git a/kolf/objects/test/test.cpp b/kolf/objects/test/test.cpp index 2c3d564f..d417f552 100644 --- a/kolf/objects/test/test.cpp +++ b/kolf/objects/test/test.cpp @@ -1,9 +1,9 @@ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -14,11 +14,11 @@ #include "test.h" K_EXPORT_COMPONENT_FACTORY(libkolftest, TestFactory) -QObject *TestFactory::createObject (QObject * /*parent*/, const char * /*name*/, const char * /*classname*/, const QStringList & /*args*/) +TQObject *TestFactory::createObject (TQObject * /*parent*/, const char * /*name*/, const char * /*classname*/, const TQStringList & /*args*/) { return new TestObj; } -Test::Test(QCanvas *canvas) - : QCanvasEllipse(60, 40, canvas), count(0), m_switchEvery(20) +Test::Test(TQCanvas *canvas) + : TQCanvasEllipse(60, 40, canvas), count(0), m_switchEvery(20) { // force to the bottom of other objects setZ(-100000); @@ -29,7 +29,7 @@ Test::Test(QCanvas *canvas) void Test::advance(int phase) { - QCanvasEllipse::advance(phase); + TQCanvasEllipse::advance(phase); // phase is either 0 or 1, only calls with 1 should be handled if (phase == 1) @@ -39,11 +39,11 @@ void Test::advance(int phase) if (count % m_switchEvery == 0) { // random color - const QColor myColor((QRgb)(kapp->random() % 0x01000000)); + const TQColor myColor((QRgb)(kapp->random() % 0x01000000)); // set the brush, so our shape is drawn // with the random color - setBrush(QBrush(myColor)); + setBrush(TQBrush(myColor)); count = 0; } @@ -65,26 +65,26 @@ void Test::load(KConfig *cfg) setSwitchEvery(cfg->readNumEntry("switchEvery", 50)); } -TestConfig::TestConfig(Test *test, QWidget *parent) +TestConfig::TestConfig(Test *test, TQWidget *parent) : Config(parent), m_test(test) { - QVBoxLayout *layout = new QVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); layout->addStretch(); - layout->addWidget(new QLabel(i18n("Flash speed"), this)); + layout->addWidget(new TQLabel(i18n("Flash speed"), this)); - QHBoxLayout *hlayout = new QHBoxLayout(layout, spacingHint()); - QLabel *slow = new QLabel(i18n("Slow"), this); + TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); + TQLabel *slow = new TQLabel(i18n("Slow"), this); hlayout->addWidget(slow); - QSlider *slider = new QSlider(1, 100, 5, 101 - m_test->switchEvery(), Qt::Horizontal, this); + TQSlider *slider = new TQSlider(1, 100, 5, 101 - m_test->switchEvery(), Qt::Horizontal, this); hlayout->addWidget(slider); - QLabel *fast = new QLabel(i18n("Fast"), this); + TQLabel *fast = new TQLabel(i18n("Fast"), this); hlayout->addWidget(fast); layout->addStretch(); - connect(slider, SIGNAL(valueChanged(int)), this, SLOT(switchEveryChanged(int))); + connect(slider, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(switchEveryChanged(int))); } void TestConfig::switchEveryChanged(int news) @@ -96,7 +96,7 @@ void TestConfig::switchEveryChanged(int news) changed(); } -Config *Test::config(QWidget *parent) +Config *Test::config(TQWidget *parent) { return new TestConfig(this, parent); } diff --git a/kolf/objects/test/test.h b/kolf/objects/test/test.h index 3086a578..06e9f30a 100644 --- a/kolf/objects/test/test.h +++ b/kolf/objects/test/test.h @@ -1,8 +1,8 @@ #ifndef KOLFTEST_H #define KOLFTEST_H -#include -#include +#include +#include #include @@ -11,14 +11,14 @@ class KConfig; -class TestFactory : KLibFactory { Q_OBJECT public: QObject *createObject(QObject *, const char *, const char *, const QStringList & = QStringList()); }; +class TestFactory : KLibFactory { Q_OBJECT public: TQObject *createObject(TQObject *, const char *, const char *, const TQStringList & = TQStringList()); }; -class Test : public QCanvasEllipse, public CanvasItem +class Test : public TQCanvasEllipse, public CanvasItem { public: - Test(QCanvas *canvas); + Test(TQCanvas *canvas); - virtual Config *config(QWidget *parent); + virtual Config *config(TQWidget *parent); virtual void save(KConfig *cfg); virtual void load(KConfig *cfg); @@ -37,7 +37,7 @@ class TestConfig : public Config Q_OBJECT public: - TestConfig(Test *test, QWidget *parent); + TestConfig(Test *test, TQWidget *parent); private slots: void switchEveryChanged(int news); @@ -50,7 +50,7 @@ class TestObj : public Object { public: TestObj() { m_name = i18n("Flash"); m__name = "flash"; m_author = "Jason Katz-Brown"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Test(canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Test(canvas); } }; #endif diff --git a/kolf/pluginloader.cpp b/kolf/pluginloader.cpp index 23d1a494..8cf39d69 100644 --- a/kolf/pluginloader.cpp +++ b/kolf/pluginloader.cpp @@ -1,8 +1,8 @@ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -16,18 +16,18 @@ ObjectList *PluginLoader::loadAll() { ObjectList *ret = new ObjectList; - QStringList libs; - QStringList files = KGlobal::dirs()->findAllResources("appdata", "*.plugin", false, true); + TQStringList libs; + TQStringList files = KGlobal::dirs()->findAllResources("appdata", "*.plugin", false, true); - for (QStringList::Iterator it = files.begin(); it != files.end(); ++it) + for (TQStringList::Iterator it = files.begin(); it != files.end(); ++it) { KSimpleConfig cfg(*it); - QString filename(cfg.readEntry("Filename", "")); + TQString filename(cfg.readEntry("Filename", "")); libs.append(filename); } - for (QStringList::Iterator it = libs.begin(); it != libs.end(); ++it) + for (TQStringList::Iterator it = libs.begin(); it != libs.end(); ++it) { Object *newObject = load(*it); if (newObject) @@ -37,7 +37,7 @@ ObjectList *PluginLoader::loadAll() return ret; } -Object *PluginLoader::load(const QString &filename) +Object *PluginLoader::load(const TQString &filename) { KLibFactory *factory = KLibLoader::self()->factory(filename.latin1()); @@ -47,7 +47,7 @@ Object *PluginLoader::load(const QString &filename) return 0; } - QObject *newObject = factory->create(0, "objectInstance", "Object"); + TQObject *newObject = factory->create(0, "objectInstance", "Object"); if (!newObject) { diff --git a/kolf/pluginloader.h b/kolf/pluginloader.h index 8d43db66..bd9f52e1 100644 --- a/kolf/pluginloader.h +++ b/kolf/pluginloader.h @@ -2,12 +2,12 @@ #define PLUGINLOADER_H #include -#include +#include namespace PluginLoader { ObjectList *loadAll(); - Object *load(const QString &); + Object *load(const TQString &); } #endif diff --git a/kolf/printdialogpage.cpp b/kolf/printdialogpage.cpp index 1fc6ad37..e8733c81 100644 --- a/kolf/printdialogpage.cpp +++ b/kolf/printdialogpage.cpp @@ -1,6 +1,6 @@ -#include -#include -#include +#include +#include +#include #include #include @@ -8,26 +8,26 @@ #include "printdialogpage.h" -PrintDialogPage::PrintDialogPage(QWidget *parent, const char *name) +PrintDialogPage::PrintDialogPage(TQWidget *parent, const char *name) : KPrintDialogPage( parent, name ) { setTitle(i18n("Kolf Options")); - QVBoxLayout *layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); - titleCheck = new QCheckBox(i18n("Draw title text"), this); + titleCheck = new TQCheckBox(i18n("Draw title text"), this); titleCheck->setChecked(true); layout->addWidget(titleCheck); } -void PrintDialogPage::getOptions(QMap &opts, bool /*incldef*/) +void PrintDialogPage::getOptions(TQMap &opts, bool /*incldef*/) { opts["kde-kolf-title"] = titleCheck->isChecked()? "true" : "false"; } -void PrintDialogPage::setOptions(const QMap &opts) +void PrintDialogPage::setOptions(const TQMap &opts) { - QString setting = opts["kde-kolf-title"]; + TQString setting = opts["kde-kolf-title"]; if (!!setting) titleCheck->setChecked(setting == "true"); } diff --git a/kolf/printdialogpage.h b/kolf/printdialogpage.h index 047454a2..4376055c 100644 --- a/kolf/printdialogpage.h +++ b/kolf/printdialogpage.h @@ -2,8 +2,8 @@ #define PRINTDIALOGPAGE_H #include -#include -#include +#include +#include class QCheckBox; class QWidget; @@ -13,15 +13,15 @@ class PrintDialogPage : public KPrintDialogPage Q_OBJECT public: - PrintDialogPage(QWidget *parent = 0, const char *name = 0); + PrintDialogPage(TQWidget *parent = 0, const char *name = 0); //reimplement virtual functions - void getOptions(QMap &opts, bool incldef = false); - void setOptions(const QMap &opts); + void getOptions(TQMap &opts, bool incldef = false); + void setOptions(const TQMap &opts); private: - QCheckBox *bgCheck; - QCheckBox *titleCheck; + TQCheckBox *bgCheck; + TQCheckBox *titleCheck; }; #endif diff --git a/kolf/scoreboard.cpp b/kolf/scoreboard.cpp index a750156f..61ff9926 100644 --- a/kolf/scoreboard.cpp +++ b/kolf/scoreboard.cpp @@ -1,23 +1,23 @@ #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "scoreboard.h" -ScoreBoard::ScoreBoard(QWidget *parent, const char *name) - : QTable(1, 1, parent, name) +ScoreBoard::ScoreBoard(TQWidget *parent, const char *name) + : TQTable(1, 1, parent, name) { vh = verticalHeader(); hh = horizontalHeader(); vh->setLabel(numRows() - 1, i18n("Par")); hh->setLabel(numCols() - 1, i18n("Total")); - setFocusPolicy(QWidget::NoFocus); + setFocusPolicy(TQWidget::NoFocus); setRowReadOnly(0, true); setRowReadOnly(1, true); } @@ -26,15 +26,15 @@ void ScoreBoard::newHole(int par) { int _numCols = numCols(); insertColumns(_numCols - 1); - hh->setLabel(numCols() - 2, QString::number(numCols() - 1)); - setText(numRows() - 1, numCols() - 2, QString::number(par)); + hh->setLabel(numCols() - 2, TQString::number(numCols() - 1)); + setText(numRows() - 1, numCols() - 2, TQString::number(par)); setColumnWidth(numCols() - 2, 40); // update total int tot = 0; for (int i = 0; i < numCols() - 1; ++i) tot += text(numRows() - 1, i).toInt(); - setText(numRows() - 1, numCols() - 1, QString::number(tot)); + setText(numRows() - 1, numCols() - 1, TQString::number(tot)); // shrink cell... setColumnWidth(numCols() - 2, 3); @@ -42,7 +42,7 @@ void ScoreBoard::newHole(int par) adjustColumn(numCols() - 2); } -void ScoreBoard::newPlayer(const QString &name) +void ScoreBoard::newPlayer(const TQString &name) { //kdDebug(12007) << "name of new player is " << name << endl; insertRows(numRows() - 1); @@ -53,10 +53,10 @@ void ScoreBoard::newPlayer(const QString &name) void ScoreBoard::setScore(int id, int hole, int score) { //kdDebug(12007) << "set score\n"; - setText(id - 1, hole - 1, score > 0? QString::number(score) : QString("")); + setText(id - 1, hole - 1, score > 0? TQString::number(score) : TQString("")); - QString name; - setText(id - 1, numCols() - 1, QString::number(total(id, name))); + TQString name; + setText(id - 1, numCols() - 1, TQString::number(total(id, name))); if (hole >= numCols() - 2) ensureCellVisible(id - 1, numCols() - 1); else @@ -72,16 +72,16 @@ void ScoreBoard::setScore(int id, int hole, int score) void ScoreBoard::parChanged(int hole, int par) { - setText(numRows() - 1, hole - 1, QString::number(par)); + setText(numRows() - 1, hole - 1, TQString::number(par)); // update total int tot = 0; for (int i = 0; i < numCols() - 1; ++i) tot += text(numRows() - 1, i).toInt(); - setText(numRows() - 1, numCols() - 1, QString::number(tot)); + setText(numRows() - 1, numCols() - 1, TQString::number(tot)); } -int ScoreBoard::total(int id, QString &name) +int ScoreBoard::total(int id, TQString &name) { int tot = 0; for (int i = 0; i < numCols() - 1; i++) diff --git a/kolf/scoreboard.h b/kolf/scoreboard.h index b9dc78f4..618069dd 100644 --- a/kolf/scoreboard.h +++ b/kolf/scoreboard.h @@ -1,7 +1,7 @@ #ifndef SCOREBOARD_H #define SCOREBOARD_H -#include +#include class QWidget; class QHeader; @@ -11,19 +11,19 @@ class ScoreBoard : public QTable Q_OBJECT public: - ScoreBoard(QWidget *parent = 0, const char *name = 0); - int total(int id, QString &name); + ScoreBoard(TQWidget *parent = 0, const char *name = 0); + int total(int id, TQString &name); public slots: void newHole(int); - void newPlayer(const QString &name); + void newPlayer(const TQString &name); void setScore(int id, int hole, int score); void parChanged(int hole, int par); private: - QTable *table; - QHeader *vh; - QHeader *hh; + TQTable *table; + TQHeader *vh; + TQHeader *hh; }; #endif diff --git a/kolf/slope.cpp b/kolf/slope.cpp index e2becea1..a6a1abf1 100644 --- a/kolf/slope.cpp +++ b/kolf/slope.cpp @@ -1,9 +1,9 @@ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include @@ -14,8 +14,8 @@ #include "slope.h" -Slope::Slope(QRect rect, QCanvas *canvas) - : QCanvasRectangle(rect, canvas), type(KImageEffect::VerticalGradient), grade(4), reversed(false), color(QColor("#327501")) +Slope::Slope(TQRect rect, TQCanvas *canvas) + : TQCanvasRectangle(rect, canvas), type(KImageEffect::VerticalGradient), grade(4), reversed(false), color(TQColor("#327501")) { stuckOnGround = false; showingInfo = false; @@ -34,17 +34,17 @@ Slope::Slope(QRect rect, QCanvas *canvas) setZ(-50); - if (!QPixmapCache::find("grass", grass)) + if (!TQPixmapCache::find("grass", grass)) { grass.load(locate("appdata", "pics/grass.png")); - QPixmapCache::insert("grass", grass); + TQPixmapCache::insert("grass", grass); } point = new RectPoint(color.light(), this, canvas); - QFont font(kapp->font()); + TQFont font(kapp->font()); font.setPixelSize(18); - text = new QCanvasText(canvas); + text = new TQCanvasText(canvas); text->setZ(99999.99); text->setFont(font); text->setColor(white); @@ -103,9 +103,9 @@ void Slope::clearArrows() arrows.setAutoDelete(false); } -QPtrList Slope::moveableItems() const +TQPtrList Slope::moveableItems() const { - QPtrList ret; + TQPtrList ret; ret.append(point); return ret; } @@ -128,7 +128,7 @@ void Slope::newSize(int width, int height) { if (type == KImageEffect::EllipticGradient) { - QCanvasRectangle::setSize(width, width); + TQCanvasRectangle::setSize(width, width); // move point back to good spot moveBy(0, 0); @@ -136,7 +136,7 @@ void Slope::newSize(int width, int height) game->updateHighlighter(); } else - QCanvasRectangle::setSize(width, height); + TQCanvasRectangle::setSize(width, height); updatePixmap(); updateZ(); @@ -144,7 +144,7 @@ void Slope::newSize(int width, int height) void Slope::moveBy(double dx, double dy) { - QCanvasRectangle::moveBy(dx, dy); + TQCanvasRectangle::moveBy(dx, dy); point->dontMove(); point->move(x() + width(), y() + height()); @@ -156,7 +156,7 @@ void Slope::moveBy(double dx, double dy) void Slope::moveArrow() { int xavg = 0, yavg = 0; - QPointArray r = areaPoints(); + TQPointArray r = areaPoints(); for (unsigned int i = 0; i < r.size(); ++i) { xavg += r[i].x(); @@ -183,14 +183,14 @@ void Slope::editModeChanged(bool changed) moveBy(0, 0); } -void Slope::updateZ(QCanvasRectangle *vStrut) +void Slope::updateZ(TQCanvasRectangle *vStrut) { const int area = (height() * width()); const int defaultz = -50; double newZ = 0; - QCanvasRectangle *rect = 0; + TQCanvasRectangle *rect = 0; if (!stuckOnGround) rect = vStrut? vStrut : onVStrut(); @@ -214,10 +214,10 @@ void Slope::load(KConfig *cfg) reversed = cfg->readBoolEntry("reversed", reversed); // bypass updatePixmap which newSize normally does - QCanvasRectangle::setSize(cfg->readNumEntry("width", width()), cfg->readNumEntry("height", height())); + TQCanvasRectangle::setSize(cfg->readNumEntry("width", width()), cfg->readNumEntry("height", height())); updateZ(); - QString gradientType = cfg->readEntry("gradient", gradientKeys[type]); + TQString gradientType = cfg->readEntry("gradient", gradientKeys[type]); setGradient(gradientType); } @@ -231,44 +231,44 @@ void Slope::save(KConfig *cfg) cfg->writeEntry("stuckOnGround", stuckOnGround); } -void Slope::draw(QPainter &painter) +void Slope::draw(TQPainter &painter) { painter.drawPixmap(x(), y(), pixmap); } -QPointArray Slope::areaPoints() const +TQPointArray Slope::areaPoints() const { switch (type) { case KImageEffect::CrossDiagonalGradient: { - QPointArray ret(3); - ret[0] = QPoint((int)x(), (int)y()); - ret[1] = QPoint((int)x() + width(), (int)y() + height()); - ret[2] = reversed? QPoint((int)x() + width(), y()) : QPoint((int)x(), (int)y() + height()); + TQPointArray ret(3); + ret[0] = TQPoint((int)x(), (int)y()); + ret[1] = TQPoint((int)x() + width(), (int)y() + height()); + ret[2] = reversed? TQPoint((int)x() + width(), y()) : TQPoint((int)x(), (int)y() + height()); return ret; } case KImageEffect::DiagonalGradient: { - QPointArray ret(3); - ret[0] = QPoint((int)x() + width(), (int)y()); - ret[1] = QPoint((int)x(), (int)y() + height()); - ret[2] = !reversed? QPoint((int)x() + width(), y() + height()) : QPoint((int)x(), (int)y()); + TQPointArray ret(3); + ret[0] = TQPoint((int)x() + width(), (int)y()); + ret[1] = TQPoint((int)x(), (int)y() + height()); + ret[2] = !reversed? TQPoint((int)x() + width(), y() + height()) : TQPoint((int)x(), (int)y()); return ret; } case KImageEffect::EllipticGradient: { - QPointArray ret; + TQPointArray ret; ret.makeEllipse((int)x(), (int)y(), width(), height()); return ret; } default: - return QCanvasRectangle::areaPoints(); + return TQCanvasRectangle::areaPoints(); } } @@ -290,8 +290,8 @@ bool Slope::collision(Ball *ball, long int /*id*/) slopeAngle = atan((double)width() / (double)height()); else if (circle) { - const QPoint start(x() + (int)width() / 2.0, y() + (int)height() / 2.0); - const QPoint end((int)ball->x(), (int)ball->y()); + const TQPoint start(x() + (int)width() / 2.0, y() + (int)height() / 2.0); + const TQPoint end((int)ball->x(), (int)ball->y()); Vector betweenVector(start, end); const double factor = betweenVector.magnitude() / ((double)width() / 2.0); @@ -339,9 +339,9 @@ bool Slope::collision(Ball *ball, long int /*id*/) return false; } -void Slope::setGradient(QString text) +void Slope::setGradient(TQString text) { - for (QMap::Iterator it = gradientKeys.begin(); it != gradientKeys.end(); ++it) + for (TQMap::Iterator it = gradientKeys.begin(); it != gradientKeys.end(); ++it) { if (it.data() == text) { @@ -351,7 +351,7 @@ void Slope::setGradient(QString text) } // extra forgiveness ;-) (note it's i18n keys) - for (QMap::Iterator it = gradientI18nKeys.begin(); it != gradientI18nKeys.end(); ++it) + for (TQMap::Iterator it = gradientI18nKeys.begin(); it != gradientI18nKeys.end(); ++it) { if (it.data() == text) { @@ -385,28 +385,28 @@ void Slope::updatePixmap() const bool diag = type == KImageEffect::DiagonalGradient || type == KImageEffect::CrossDiagonalGradient; const bool circle = type == KImageEffect::EllipticGradient; - const QColor darkColor = color.dark(100 + grade * (circle? 20 : 10)); - const QColor lightColor = diag || circle? color.light(110 + (diag? 5 : .5) * grade) : color; + const TQColor darkColor = color.dark(100 + grade * (circle? 20 : 10)); + const TQColor lightColor = diag || circle? color.light(110 + (diag? 5 : .5) * grade) : color; // hack only for circles const bool _reversed = circle? !reversed : reversed; - QImage gradientImage = KImageEffect::gradient(QSize(width(), height()), _reversed? darkColor : lightColor, _reversed? lightColor : darkColor, type); + TQImage gradientImage = KImageEffect::gradient(TQSize(width(), height()), _reversed? darkColor : lightColor, _reversed? lightColor : darkColor, type); - QPixmap qpixmap(width(), height()); - QPainter p(&qpixmap); - p.drawTiledPixmap(QRect(0, 0, width(), height()), grass); + TQPixmap qpixmap(width(), height()); + TQPainter p(&qpixmap); + p.drawTiledPixmap(TQRect(0, 0, width(), height()), grass); p.end(); const double length = sqrt(width() * width() + height() * height()) / 4; if (circle) { - const QColor otherLightColor = color.light(110 + 15 * grade); - const QColor otherDarkColor = darkColor.dark(110 + 20 * grade); - QImage otherGradientImage = KImageEffect::gradient(QSize(width(), height()), reversed? otherDarkColor : otherLightColor, reversed? otherLightColor : otherDarkColor, KImageEffect::DiagonalGradient); + const TQColor otherLightColor = color.light(110 + 15 * grade); + const TQColor otherDarkColor = darkColor.dark(110 + 20 * grade); + TQImage otherGradientImage = KImageEffect::gradient(TQSize(width(), height()), reversed? otherDarkColor : otherLightColor, reversed? otherLightColor : otherDarkColor, KImageEffect::DiagonalGradient); - QImage grassImage(qpixmap.convertToImage()); + TQImage grassImage(qpixmap.convertToImage()); - QImage finalGradientImage = KImageEffect::blend(otherGradientImage, gradientImage, .60); + TQImage finalGradientImage = KImageEffect::blend(otherGradientImage, gradientImage, .60); pixmap.convertFromImage(KImageEffect::blend(grassImage, finalGradientImage, .40)); // make arrows @@ -475,7 +475,7 @@ void Slope::updatePixmap() KPixmap kpixmap = qpixmap; (void) KPixmapEffect::intensity(kpixmap, ratio); - QImage grassImage(kpixmap.convertToImage()); + TQImage grassImage(kpixmap.convertToImage()); // okay, now we have a grass image that's // appropriately lit, and a gradient; @@ -488,20 +488,20 @@ void Slope::updatePixmap() arrows.append(arrow); } - text->setText(QString::number(grade)); + text->setText(TQString::number(grade)); if (diag || circle) { // make cleared bitmap - QBitmap bitmap(pixmap.width(), pixmap.height(), true); - QPainter bpainter(&bitmap); + TQBitmap bitmap(pixmap.width(), pixmap.height(), true); + TQPainter bpainter(&bitmap); bpainter.setBrush(color1); - QPointArray r = areaPoints(); + TQPointArray r = areaPoints(); // shift all the points for (unsigned int i = 0; i < r.count(); ++i) { - QPoint &p = r[i]; + TQPoint &p = r[i]; p.setX(p.x() - x()); p.setY(p.y() - y()); } @@ -517,15 +517,15 @@ void Slope::updatePixmap() ///////////////////////// -SlopeConfig::SlopeConfig(Slope *slope, QWidget *parent) +SlopeConfig::SlopeConfig(Slope *slope, TQWidget *parent) : Config(parent) { this->slope = slope; - QVBoxLayout *layout = new QVBoxLayout(this, marginHint(), spacingHint()); + TQVBoxLayout *layout = new TQVBoxLayout(this, marginHint(), spacingHint()); KComboBox *gradient = new KComboBox(this); - QStringList items; - QString curText; - for (QMap::Iterator it = slope->gradientI18nKeys.begin(); it != slope->gradientI18nKeys.end(); ++it) + TQStringList items; + TQString curText; + for (TQMap::Iterator it = slope->gradientI18nKeys.begin(); it != slope->gradientI18nKeys.end(); ++it) { if (it.key() == slope->curType()) curText = it.data(); @@ -534,31 +534,31 @@ SlopeConfig::SlopeConfig(Slope *slope, QWidget *parent) gradient->insertStringList(items); gradient->setCurrentText(curText); layout->addWidget(gradient); - connect(gradient, SIGNAL(activated(const QString &)), this, SLOT(setGradient(const QString &))); + connect(gradient, TQT_SIGNAL(activated(const TQString &)), this, TQT_SLOT(setGradient(const TQString &))); layout->addStretch(); - QCheckBox *reversed = new QCheckBox(i18n("Reverse direction"), this); + TQCheckBox *reversed = new TQCheckBox(i18n("Reverse direction"), this); reversed->setChecked(slope->isReversed()); layout->addWidget(reversed); - connect(reversed, SIGNAL(toggled(bool)), this, SLOT(setReversed(bool))); + connect(reversed, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setReversed(bool))); - QHBoxLayout *hlayout = new QHBoxLayout(layout, spacingHint()); - hlayout->addWidget(new QLabel(i18n("Grade:"), this)); + TQHBoxLayout *hlayout = new TQHBoxLayout(layout, spacingHint()); + hlayout->addWidget(new TQLabel(i18n("Grade:"), this)); KDoubleNumInput *grade = new KDoubleNumInput(this); grade->setRange(0, 8, 1, true); grade->setValue(slope->curGrade()); hlayout->addWidget(grade); - connect(grade, SIGNAL(valueChanged(double)), this, SLOT(gradeChanged(double))); + connect(grade, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(gradeChanged(double))); - QCheckBox *stuck = new QCheckBox(i18n("Unmovable"), this); - QWhatsThis::add(stuck, i18n("Whether or not this slope can be moved by other objects, like floaters.")); + 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); - connect(stuck, SIGNAL(toggled(bool)), this, SLOT(setStuckOnGround(bool))); + connect(stuck, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setStuckOnGround(bool))); } -void SlopeConfig::setGradient(const QString &text) +void SlopeConfig::setGradient(const TQString &text) { slope->setGradient(text); changed(); diff --git a/kolf/slope.h b/kolf/slope.h index d638354f..1bca5e5e 100644 --- a/kolf/slope.h +++ b/kolf/slope.h @@ -11,10 +11,10 @@ class SlopeConfig : public Config Q_OBJECT public: - SlopeConfig(Slope *slope, QWidget *parent); + SlopeConfig(Slope *slope, TQWidget *parent); private slots: - void setGradient(const QString &text); + void setGradient(const TQString &text); void setReversed(bool); void setStuckOnGround(bool); void gradeChanged(double); @@ -23,10 +23,10 @@ private: Slope *slope; }; -class Slope : public QCanvasRectangle, public CanvasItem, public RectItem +class Slope : public TQCanvasRectangle, public CanvasItem, public RectItem { public: - Slope(QRect rect, QCanvas *canvas); + Slope(TQRect rect, TQCanvas *canvas); virtual void aboutToDie(); virtual int rtti() const { return 1031; } @@ -34,22 +34,22 @@ public: virtual void hideInfo(); virtual void editModeChanged(bool changed); virtual bool canBeMovedByOthers() const { return !stuckOnGround; } - virtual QPtrList moveableItems() const; - virtual Config *config(QWidget *parent) { return new SlopeConfig(this, parent); } + virtual TQPtrList moveableItems() const; + virtual Config *config(TQWidget *parent) { return new SlopeConfig(this, parent); } void setSize(int, int); virtual void newSize(int width, int height); virtual void moveBy(double dx, double dy); - virtual void draw(QPainter &painter); - virtual QPointArray areaPoints() const; + virtual void draw(TQPainter &painter); + virtual TQPointArray areaPoints() const; - void setGradient(QString text); + void setGradient(TQString text); KImageEffect::GradientType curType() const { return type; } void setGrade(double grade); double curGrade() const { return grade; } - void setColor(QColor color) { this->color = color; updatePixmap(); } + void setColor(TQColor color) { this->color = color; updatePixmap(); } void setReversed(bool reversed) { this->reversed = reversed; updatePixmap(); } bool isReversed() const { return reversed; } @@ -62,10 +62,10 @@ public: virtual bool collision(Ball *ball, long int id); virtual bool terrainCollisions() const; - QMap gradientI18nKeys; - QMap gradientKeys; + TQMap gradientI18nKeys; + TQMap gradientKeys; - virtual void updateZ(QCanvasRectangle *vStrut = 0); + virtual void updateZ(TQCanvasRectangle *vStrut = 0); void moveArrow(); @@ -75,16 +75,16 @@ private: bool showingInfo; double grade; bool reversed; - QColor color; - QPixmap pixmap; + TQColor color; + TQPixmap pixmap; void updatePixmap(); bool stuckOnGround; - QPixmap grass; + TQPixmap grass; void clearArrows(); - QPtrList arrows; - QCanvasText *text; + TQPtrList arrows; + TQCanvasText *text; RectPoint *point; }; @@ -92,7 +92,7 @@ class SlopeObj : public Object { public: SlopeObj() { m_name = i18n("Slope"); m__name = "slope"; } - virtual QCanvasItem *newObject(QCanvas *canvas) { return new Slope(QRect(0, 0, 40, 40), canvas); } + virtual TQCanvasItem *newObject(TQCanvas *canvas) { return new Slope(TQRect(0, 0, 40, 40), canvas); } }; #endif diff --git a/kolf/statedb.h b/kolf/statedb.h index 522d147f..397eb588 100644 --- a/kolf/statedb.h +++ b/kolf/statedb.h @@ -1,23 +1,23 @@ #ifndef KOLF_STATEDB_H #define KOLF_STATEDB_H -#include -#include -#include +#include +#include +#include // items can save their per-game states here // most don't have to do anything class StateDB { public: - void setPoint(const QPoint &point) { points[curName] = point; } - QPoint point() { return points[curName]; } - void setName(const QString &name) { curName = name; } + void setPoint(const TQPoint &point) { points[curName] = point; } + TQPoint point() { return points[curName]; } + void setName(const TQString &name) { curName = name; } void clear() { points.clear(); } private: - QMap points; - QString curName; + TQMap points; + TQString curName; }; #endif diff --git a/kolf/vector.cpp b/kolf/vector.cpp index f4c05262..0a3458b9 100644 --- a/kolf/vector.cpp +++ b/kolf/vector.cpp @@ -5,7 +5,7 @@ // this and vector.h by Ryan Cummings // Creates a vector with between two points -Vector::Vector(const QPoint &source, const QPoint &dest) { +Vector::Vector(const TQPoint &source, const TQPoint &dest) { _magnitude = sqrt(pow(source.x() - dest.x(), 2) + pow(source.y() - dest.y(), 2)); _direction = atan2(source.y() - dest.y(), source.x() - dest.x()); } @@ -94,12 +94,12 @@ void Vector::setComponents(double x, double y) { _magnitude = sqrt((x * x) + (y * y)); } -void debugPoint(const QString &text, const Point &p) +void debugPoint(const TQString &text, const Point &p) { kdDebug(12007) << text << " (" << p.x << ", " << p.y << ")" << endl; } -void debugVector(const QString &text, const Vector &p) +void debugVector(const TQString &text, const Vector &p) { // debug degrees kdDebug(12007) << text << " (magnitude: " << p.magnitude() << ", direction: " << p.direction() << ", direction (deg): " << (360L / (2L * M_PI)) * p.direction() << ")" << endl; diff --git a/kolf/vector.h b/kolf/vector.h index 1da7328b..bca39c0c 100644 --- a/kolf/vector.h +++ b/kolf/vector.h @@ -3,7 +3,7 @@ #include -#include +#include class Point { @@ -24,7 +24,7 @@ public: double y; }; -void debugPoint(const QString &, const Point &); +void debugPoint(const TQString &, const Point &); // This and vector.cpp by Ryan Cummings @@ -33,7 +33,7 @@ class Vector { public: // Normal constructors Vector(double magnitude, double direction) { _magnitude = magnitude; _direction = direction; } - Vector(const QPoint& source, const QPoint& dest); + Vector(const TQPoint& source, const TQPoint& dest); Vector(const Point& source, const Point& dest); Vector(); @@ -87,6 +87,6 @@ class Vector { double _direction; }; -void debugVector(const QString &, const Vector &); +void debugVector(const TQString &, const Vector &); #endif -- cgit v1.2.1