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 --- libkdegames/kgamelcd.cpp | 94 ++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 47 deletions(-) (limited to 'libkdegames/kgamelcd.cpp') diff --git a/libkdegames/kgamelcd.cpp b/libkdegames/kgamelcd.cpp index 65c436a5..c87930b5 100644 --- a/libkdegames/kgamelcd.cpp +++ b/libkdegames/kgamelcd.cpp @@ -20,23 +20,23 @@ #include "kgamelcd.h" #include "kgamelcd.moc" -#include -#include -#include +#include +#include +#include #include //----------------------------------------------------------------------------- -KGameLCD::KGameLCD(uint nbDigits, QWidget *parent, const char *name) - : QLCDNumber(nbDigits, parent, name), _htime(800) +KGameLCD::KGameLCD(uint nbDigits, TQWidget *parent, const char *name) + : TQLCDNumber(nbDigits, parent, name), _htime(800) { - const QPalette &p = palette(); - _fgColor = p.color(QPalette::Active, QColorGroup::Foreground); - _hlColor = p.color(QPalette::Active, QColorGroup::HighlightedText); + const TQPalette &p = palette(); + _fgColor = p.color(TQPalette::Active, TQColorGroup::Foreground); + _hlColor = p.color(TQPalette::Active, TQColorGroup::HighlightedText); - _timer = new QTimer(this); - connect(_timer, SIGNAL(timeout()), SLOT(timeout())); + _timer = new TQTimer(this); + connect(_timer, TQT_SIGNAL(timeout()), TQT_SLOT(timeout())); setFrameStyle(Panel | Plain); setSegmentStyle(Flat); @@ -47,27 +47,27 @@ KGameLCD::KGameLCD(uint nbDigits, QWidget *parent, const char *name) KGameLCD::~KGameLCD() {} -void KGameLCD::setDefaultBackgroundColor(const QColor &color) +void KGameLCD::setDefaultBackgroundColor(const TQColor &color) { - QPalette p = palette(); - p.setColor(QColorGroup::Background, color); + TQPalette p = palette(); + p.setColor(TQColorGroup::Background, color); setPalette(p); } -void KGameLCD::setDefaultColor(const QColor &color) +void KGameLCD::setDefaultColor(const TQColor &color) { _fgColor = color; - QPalette p = palette(); - p.setColor(QColorGroup::Foreground, color); + TQPalette p = palette(); + p.setColor(TQColorGroup::Foreground, color); setPalette(p); } -void KGameLCD::setHighlightColor(const QColor &color) +void KGameLCD::setHighlightColor(const TQColor &color) { _hlColor = color; } -void KGameLCD::setLeadingString(const QString &s) +void KGameLCD::setLeadingString(const TQString &s) { _lead = s; displayInt(0); @@ -80,21 +80,21 @@ void KGameLCD::setHighlightTime(uint time) void KGameLCD::resetColor() { - setColor(QColor()); + setColor(TQColor()); } -void KGameLCD::setColor(const QColor &color) +void KGameLCD::setColor(const TQColor &color) { - const QColor &c = (color.isValid() ? color : _fgColor); - QPalette p = palette(); - p.setColor(QColorGroup::Foreground, c); + const TQColor &c = (color.isValid() ? color : _fgColor); + TQPalette p = palette(); + p.setColor(TQColorGroup::Foreground, c); setPalette(p); } void KGameLCD::displayInt(int v) { int n = numDigits() - _lead.length(); - display(_lead + QString::number(v).rightJustify(n)); + display(_lead + TQString::number(v).rightJustify(n)); } void KGameLCD::highlight() @@ -110,11 +110,11 @@ void KGameLCD::highlight(bool light) } //----------------------------------------------------------------------------- -KGameLCDClock::KGameLCDClock(QWidget *parent, const char *name) +KGameLCDClock::KGameLCDClock(TQWidget *parent, const char *name) : KGameLCD(5, parent, name) { - _timerClock = new QTimer(this); - connect(_timerClock, SIGNAL(timeout()), SLOT(timeoutClock())); + _timerClock = new TQTimer(this); + connect(_timerClock, TQT_SIGNAL(timeout()), TQT_SLOT(timeoutClock())); } KGameLCDClock::~KGameLCDClock() @@ -132,10 +132,10 @@ void KGameLCDClock::timeoutClock() showTime(); } -QString KGameLCDClock::pretty() const +TQString KGameLCDClock::pretty() const { - QString sec = QString::number(_sec).rightJustify(2, '0', true); - QString min = QString::number(_min).rightJustify(2, '0', true); + TQString sec = TQString::number(_sec).rightJustify(2, '0', true); + TQString min = TQString::number(_min).rightJustify(2, '0', true); return min + ':' + sec; } @@ -175,7 +175,7 @@ void KGameLCDClock::setTime(uint sec) showTime(); } -void KGameLCDClock::setTime(const QString &s) +void KGameLCDClock::setTime(const TQString &s) { Q_ASSERT( s.length()==5 && s[2]==':' ); uint min = kMin(s.section(':', 0, 0).toUInt(), uint(59)); @@ -188,20 +188,20 @@ void KGameLCDClock::setTime(const QString &s) class KGameLCDList::KGameLCDListPrivate { public: - QValueVector _leadings; + TQValueVector _leadings; }; -KGameLCDList::KGameLCDList(const QString &title, QWidget *parent, +KGameLCDList::KGameLCDList(const TQString &title, TQWidget *parent, const char *name) - : QWidget(parent, name) + : TQWidget(parent, name) { init(title); } -KGameLCDList::KGameLCDList(QWidget *parent, const char *name) - : QWidget(parent, name) +KGameLCDList::KGameLCDList(TQWidget *parent, const char *name) + : TQWidget(parent, name) { - init(QString::null); + init(TQString::null); } KGameLCDList::~KGameLCDList() @@ -209,34 +209,34 @@ KGameLCDList::~KGameLCDList() delete d; } -void KGameLCDList::init(const QString &title) +void KGameLCDList::init(const TQString &title) { d = new KGameLCDListPrivate; - QGridLayout *top = new QGridLayout(this, 1, 2, 5); + TQGridLayout *top = new TQGridLayout(this, 1, 2, 5); top->setColStretch(1, 1); - _title = new QLabel(title, this); + _title = new TQLabel(title, this); _title->setAlignment(AlignCenter); top->addMultiCellWidget(_title, 0, 0, 0, 1, AlignCenter); } -void KGameLCDList::append(QLCDNumber *lcd) +void KGameLCDList::append(TQLCDNumber *lcd) { - append(QString::null, lcd); + append(TQString::null, lcd); } -void KGameLCDList::append(const QString &leading, QLCDNumber *lcd) +void KGameLCDList::append(const TQString &leading, TQLCDNumber *lcd) { uint i = size(); - QLabel *label = 0; + TQLabel *label = 0; if ( !leading.isEmpty() ) { - label = new QLabel(leading, this); - static_cast(layout())->addWidget(label, i+1, 0); + label = new TQLabel(leading, this); + static_cast(layout())->addWidget(label, i+1, 0); } d->_leadings.push_back(label); _lcds.push_back(lcd); - static_cast(layout())->addWidget(lcd, i+1, 1); + static_cast(layout())->addWidget(lcd, i+1, 1); } void KGameLCDList::clear() -- cgit v1.2.1