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 /libkdegames/kgameprogress.cpp | |
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 'libkdegames/kgameprogress.cpp')
-rw-r--r-- | libkdegames/kgameprogress.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/libkdegames/kgameprogress.cpp b/libkdegames/kgameprogress.cpp index 861dd454..c9f122fb 100644 --- a/libkdegames/kgameprogress.cpp +++ b/libkdegames/kgameprogress.cpp @@ -19,36 +19,36 @@ * KGameProgress -- a progress indicator widget for KDE. */ -#include <qpainter.h> -#include <qpixmap.h> -#include <qstring.h> -#include <qregexp.h> -#include <qstyle.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqstring.h> +#include <tqregexp.h> +#include <tqstyle.h> #include "kgameprogress.h" #include <kapplication.h> -KGameProgress::KGameProgress(QWidget *parent, const char *name) - : QFrame(parent, name), - QRangeControl(0, 100, 1, 10, 0), +KGameProgress::KGameProgress(TQWidget *parent, const char *name) + : TQFrame(parent, name), + TQRangeControl(0, 100, 1, 10, 0), orient(Horizontal) { initialize(); } -KGameProgress::KGameProgress(Orientation orientation, QWidget *parent, const char *name) - : QFrame(parent, name), - QRangeControl(0, 100, 1, 10, 0), +KGameProgress::KGameProgress(Orientation orientation, TQWidget *parent, const char *name) + : TQFrame(parent, name), + TQRangeControl(0, 100, 1, 10, 0), orient(orientation) { initialize(); } KGameProgress::KGameProgress(int minValue, int maxValue, int value, - Orientation orientation, QWidget *parent, const char *name) - : QFrame(parent, name), - QRangeControl(minValue, maxValue, 1, 10, value), + Orientation orientation, TQWidget *parent, const char *name) + : TQFrame(parent, name), + TQRangeControl(minValue, maxValue, 1, 10, value), orient(orientation) { initialize(); @@ -72,14 +72,14 @@ void KGameProgress::initialize() bar_style = Solid; text_enabled = TRUE; setBackgroundMode( PaletteBackground ); - connect(kapp, SIGNAL(appearanceChanged()), this, SLOT(paletteChange())); + connect(kapp, TQT_SIGNAL(appearanceChanged()), this, TQT_SLOT(paletteChange())); paletteChange(); } void KGameProgress::paletteChange() { - QPalette p = kapp->palette(); - const QColorGroup &colorGroup = p.active(); + TQPalette p = kapp->palette(); + const TQColorGroup &colorGroup = p.active(); if (!use_supplied_bar_color) bar_color = colorGroup.highlight(); bar_text_color = colorGroup.highlightedText(); @@ -90,17 +90,17 @@ void KGameProgress::paletteChange() } -void KGameProgress::setBarPixmap(const QPixmap &pixmap) +void KGameProgress::setBarPixmap(const TQPixmap &pixmap) { if (pixmap.isNull()) return; if (bar_pixmap) delete bar_pixmap; - bar_pixmap = new QPixmap(pixmap); + bar_pixmap = new TQPixmap(pixmap); } -void KGameProgress::setBarColor(const QColor &color) +void KGameProgress::setBarColor(const TQColor &color) { bar_color = color; use_supplied_bar_color = true; @@ -128,7 +128,7 @@ void KGameProgress::setOrientation(Orientation orientation) void KGameProgress::setValue(int value) { - QRangeControl::setValue(value); + TQRangeControl::setValue(value); } void KGameProgress::setTextEnabled(bool enable) @@ -136,12 +136,12 @@ void KGameProgress::setTextEnabled(bool enable) text_enabled = enable; } -const QColor & KGameProgress::barColor() const +const TQColor & KGameProgress::barColor() const { return bar_color; } -const QPixmap * KGameProgress::barPixmap() const +const TQPixmap * KGameProgress::barPixmap() const { return bar_pixmap; } @@ -151,9 +151,9 @@ bool KGameProgress::textEnabled() const return text_enabled; } -QSize KGameProgress::sizeHint() const +TQSize KGameProgress::sizeHint() const { - QSize s( size() ); + TQSize s( size() ); if(orientation() == KGameProgress::Vertical) { s.setWidth(24); @@ -164,17 +164,17 @@ QSize KGameProgress::sizeHint() const return s; } -QSize KGameProgress::minimumSizeHint() const +TQSize KGameProgress::minimumSizeHint() const { return sizeHint(); } -QSizePolicy KGameProgress::sizePolicy() const +TQSizePolicy KGameProgress::sizePolicy() const { if ( orientation()==KGameProgress::Vertical ) - return QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding ); + return TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Expanding ); else - return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); + return TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ); } KGameProgress::Orientation KGameProgress::orientation() const @@ -206,48 +206,48 @@ void KGameProgress::rangeChange() emit percentageChanged(recalcValue(100)); } -void KGameProgress::styleChange(QStyle&) +void KGameProgress::styleChange(TQStyle&) { adjustStyle(); } void KGameProgress::adjustStyle() { - switch (style().styleHint(QStyle::SH_GUIStyle)) { + switch (style().styleHint(TQStyle::SH_GUIStyle)) { case WindowsStyle: - setFrameStyle(QFrame::WinPanel | QFrame::Sunken); + setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); break; case MotifStyle: default: - setFrameStyle(QFrame::Panel | QFrame::Sunken); + setFrameStyle(TQFrame::Panel | TQFrame::Sunken); setLineWidth( 2 ); break; } update(); } -void KGameProgress::paletteChange( const QPalette &p ) +void KGameProgress::paletteChange( const TQPalette &p ) { // This never gets called for global color changes // because we call setPalette() ourselves. - QFrame::paletteChange(p); + TQFrame::paletteChange(p); } -void KGameProgress::drawText(QPainter *p) +void KGameProgress::drawText(TQPainter *p) { - QRect r(contentsRect()); - //QColor c(bar_color.rgb() ^ backgroundColor().rgb()); + TQRect r(contentsRect()); + //TQColor c(bar_color.rgb() ^ backgroundColor().rgb()); // Rik: Replace the tags '%p', '%v' and '%m' with the current percentage, // the current value and the maximum value respectively. - QString s(format_); + TQString s(format_); - s.replace(QRegExp(QString::fromLatin1("%p")), QString::number(recalcValue(100))); - s.replace(QRegExp(QString::fromLatin1("%v")), QString::number(value())); - s.replace(QRegExp(QString::fromLatin1("%m")), QString::number(maxValue())); + 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())); p->setPen(text_color); - QFont font = p->font(); + TQFont font = p->font(); font.setBold(true); p->setFont(font); //p->setRasterOp(XorROP); @@ -257,11 +257,11 @@ void KGameProgress::drawText(QPainter *p) p->drawText(r, AlignCenter, s); } -void KGameProgress::drawContents(QPainter *p) +void KGameProgress::drawContents(TQPainter *p) { - QRect cr = contentsRect(), er = cr; + TQRect cr = contentsRect(), er = cr; fr = cr; - QBrush fb(bar_color), eb(backgroundColor()); + TQBrush fb(bar_color), eb(backgroundColor()); if (bar_pixmap) fb.setPixmap(*bar_pixmap); @@ -292,7 +292,7 @@ void KGameProgress::drawContents(QPainter *p) if (orient == Horizontal) { fr.setHeight(cr.height() - 2 * margin); fr.setWidth((int)(0.67 * fr.height())); - fr.moveTopLeft(QPoint(cr.left() + margin, cr.top() + margin)); + fr.moveTopLeft(TQPoint(cr.left() + margin, cr.top() + margin)); dx = fr.width() + margin; dy = 0; max = (cr.width() - margin) / (fr.width() + margin) + 1; @@ -300,7 +300,7 @@ void KGameProgress::drawContents(QPainter *p) } else { fr.setWidth(cr.width() - 2 * margin); fr.setHeight((int)(0.67 * fr.width())); - fr.moveBottomLeft(QPoint(cr.left() + margin, cr.bottom() - margin)); + fr.moveBottomLeft(TQPoint(cr.left() + margin, cr.bottom() - margin)); dx = 0; dy = - (fr.height() + margin); max = (cr.height() - margin) / (fr.height() + margin) + 1; @@ -332,12 +332,12 @@ void KGameProgress::drawContents(QPainter *p) drawText(p); } -void KGameProgress::setFormat(const QString & format) +void KGameProgress::setFormat(const TQString & format) { format_ = format; } -QString KGameProgress::format() const +TQString KGameProgress::format() const { return format_; } |