diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:42:31 +0000 |
commit | 576eb4299a00bc053db35414406f46372a0f70f2 (patch) | |
tree | 4c030922d533821db464af566188e7d40cc8848c /kolf/objects | |
parent | 0718336b6017d1a4fc1d626544180a5a2a29ddec (diff) | |
download | tdegames-576eb4299a00bc053db35414406f46372a0f70f2.tar.gz tdegames-576eb4299a00bc053db35414406f46372a0f70f2.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1157643 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kolf/objects')
-rw-r--r-- | kolf/objects/poolball/poolball.cpp | 30 | ||||
-rw-r--r-- | kolf/objects/poolball/poolball.h | 18 | ||||
-rw-r--r-- | kolf/objects/test/test.cpp | 42 | ||||
-rw-r--r-- | kolf/objects/test/test.h | 16 |
4 files changed, 53 insertions, 53 deletions
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 <qbrush.h> -#include <qcolor.h> -#include <qcanvas.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qpainter.h> +#include <tqbrush.h> +#include <tqcolor.h> +#include <tqcanvas.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpainter.h> #include <klocale.h> #include <klibloader.h> @@ -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 <qcanvas.h> -#include <qobject.h> -#include <qpainter.h> +#include <tqcanvas.h> +#include <tqobject.h> +#include <tqpainter.h> #include <klibloader.h> @@ -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 <qbrush.h> -#include <qcolor.h> -#include <qcanvas.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qslider.h> +#include <tqbrush.h> +#include <tqcolor.h> +#include <tqcanvas.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqslider.h> #include <klocale.h> #include <klibloader.h> @@ -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 <qcanvas.h> -#include <qobject.h> +#include <tqcanvas.h> +#include <tqobject.h> #include <klibloader.h> @@ -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 |