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/game.cpp | 790 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 395 insertions(+), 395 deletions(-) (limited to 'kolf/game.cpp') 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); } -- cgit v1.2.1