diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:58:26 +0000 |
commit | 838baf3f99ec5ab81b063eb5449a3381d860f377 (patch) | |
tree | dd31abcfde08ca92e4623b8f50b3d762a87c997a /libkdegames/kgameprogress.cpp | |
parent | 2bf598bafa22fac4126fc8842df6b0119aadc0e9 (diff) | |
download | tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.tar.gz tdegames-838baf3f99ec5ab81b063eb5449a3381d860f377.zip |
TQt4 port kdegames
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegames@1236074 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdegames/kgameprogress.cpp')
-rw-r--r-- | libkdegames/kgameprogress.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/libkdegames/kgameprogress.cpp b/libkdegames/kgameprogress.cpp index c9f122fb..7ed1728f 100644 --- a/libkdegames/kgameprogress.cpp +++ b/libkdegames/kgameprogress.cpp @@ -29,16 +29,16 @@ #include <kapplication.h> -KGameProgress::KGameProgress(TQWidget *parent, const char *name) - : TQFrame(parent, name), +KGameProgress::KGameProgress(TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name), TQRangeControl(0, 100, 1, 10, 0), - orient(Horizontal) + orient(Qt::Horizontal) { initialize(); } -KGameProgress::KGameProgress(Orientation orientation, TQWidget *parent, const char *name) - : TQFrame(parent, name), +KGameProgress::KGameProgress(Qt::Orientation orientation, TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name), TQRangeControl(0, 100, 1, 10, 0), orient(orientation) { @@ -46,8 +46,8 @@ KGameProgress::KGameProgress(Orientation orientation, TQWidget *parent, const ch } KGameProgress::KGameProgress(int minValue, int maxValue, int value, - Orientation orientation, TQWidget *parent, const char *name) - : TQFrame(parent, name), + Qt::Orientation orientation, TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name), TQRangeControl(minValue, maxValue, 1, 10, value), orient(orientation) { @@ -79,11 +79,11 @@ void KGameProgress::initialize() void KGameProgress::paletteChange() { TQPalette p = kapp->palette(); - const TQColorGroup &colorGroup = p.active(); + const TQColorGroup &tqcolorGroup = p.active(); if (!use_supplied_bar_color) - bar_color = colorGroup.highlight(); - bar_text_color = colorGroup.highlightedText(); - text_color = colorGroup.text(); + bar_color = tqcolorGroup.highlight(); + bar_text_color = tqcolorGroup.highlightedText(); + text_color = tqcolorGroup.text(); setPalette(p); adjustStyle(); @@ -118,7 +118,7 @@ void KGameProgress::setBarStyle(BarStyle style) } } -void KGameProgress::setOrientation(Orientation orientation) +void KGameProgress::setOrientation(Qt::Orientation orientation) { if (orient != orientation) { orient = orientation; @@ -151,11 +151,11 @@ bool KGameProgress::textEnabled() const return text_enabled; } -TQSize KGameProgress::sizeHint() const +TQSize KGameProgress::tqsizeHint() const { TQSize s( size() ); - if(orientation() == KGameProgress::Vertical) { + if(orientation() == Qt::Vertical) { s.setWidth(24); } else { s.setHeight(24); @@ -164,14 +164,14 @@ TQSize KGameProgress::sizeHint() const return s; } -TQSize KGameProgress::minimumSizeHint() const +TQSize KGameProgress::tqminimumSizeHint() const { - return sizeHint(); + return tqsizeHint(); } TQSizePolicy KGameProgress::sizePolicy() const { - if ( orientation()==KGameProgress::Vertical ) + if ( orientation()==Qt::Vertical ) return TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Expanding ); else return TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ); @@ -196,13 +196,13 @@ int KGameProgress::recalcValue(int range) void KGameProgress::valueChange() { - repaint(contentsRect(), FALSE); + tqrepaint(contentsRect(), FALSE); emit percentageChanged(recalcValue(100)); } void KGameProgress::rangeChange() { - repaint(contentsRect(), FALSE); + tqrepaint(contentsRect(), FALSE); emit percentageChanged(recalcValue(100)); } @@ -213,7 +213,7 @@ void KGameProgress::styleChange(TQStyle&) void KGameProgress::adjustStyle() { - switch (style().styleHint(TQStyle::SH_GUIStyle)) { + switch (tqstyle().tqstyleHint(TQStyle::SH_GUIStyle)) { case WindowsStyle: setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); break; @@ -242,9 +242,9 @@ void KGameProgress::drawText(TQPainter *p) // the current value and the maximum value respectively. TQString s(format_); - s.replace(TQRegExp(TQString::fromLatin1("%p")), TQString::number(recalcValue(100))); - s.replace(TQRegExp(TQString::fromLatin1("%v")), TQString::number(value())); - s.replace(TQRegExp(TQString::fromLatin1("%m")), TQString::number(maxValue())); + s.tqreplace(TQRegExp(TQString::tqfromLatin1("%p")), TQString::number(recalcValue(100))); + s.tqreplace(TQRegExp(TQString::tqfromLatin1("%v")), TQString::number(value())); + s.tqreplace(TQRegExp(TQString::tqfromLatin1("%m")), TQString::number(maxValue())); p->setPen(text_color); TQFont font = p->font(); @@ -271,7 +271,7 @@ void KGameProgress::drawContents(TQPainter *p) switch (bar_style) { case Solid: - if (orient == Horizontal) { + if (orient ==Qt::Horizontal) { fr.setWidth(recalcValue(cr.width())); er.setLeft(fr.right() + 1); } else { @@ -289,7 +289,7 @@ void KGameProgress::drawContents(TQPainter *p) case Blocked: const int margin = 2; int max, num, dx, dy; - if (orient == Horizontal) { + if (orient ==Qt::Horizontal) { fr.setHeight(cr.height() - 2 * margin); fr.setWidth((int)(0.67 * fr.height())); fr.moveTopLeft(TQPoint(cr.left() + margin, cr.top() + margin)); @@ -315,7 +315,7 @@ void KGameProgress::drawContents(TQPainter *p) } if (num != max) { - if (orient == Horizontal) + if (orient ==Qt::Horizontal) er.setLeft(fr.right() + 1); else er.setBottom(fr.bottom() + 1); |