diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-06 20:59:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-06 20:59:29 +0000 |
commit | 11f31c37e5fa4889d9989f10272f44845449cb7b (patch) | |
tree | 4383da04a76c497950d957fc6120b0fd0d9082c2 /src/gui/kdeext/RGLed.cpp | |
parent | 832eb69d571e8e518db45d0c0e6fbc0f00690209 (diff) | |
download | rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.tar.gz rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.zip |
Initial TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1172292 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/kdeext/RGLed.cpp')
-rw-r--r-- | src/gui/kdeext/RGLed.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/src/gui/kdeext/RGLed.cpp b/src/gui/kdeext/RGLed.cpp index 54b91b2..c5e5934 100644 --- a/src/gui/kdeext/RGLed.cpp +++ b/src/gui/kdeext/RGLed.cpp @@ -52,7 +52,7 @@ * kapp-- * * Revision 1.21 2002/01/22 10:23:55 hausmann - * - minor API fix (don't return a const QColor object) + * - minor API fix (don't return a const TQColor object) * * Revision 1.20 2001/10/10 17:40:39 mueller * CVS_SILENT: fixincludes @@ -131,14 +131,14 @@ #undef PAINT_BENCH #ifdef PAINT_BENCH -#include <qdatetime.h> +#include <tqdatetime.h> #include <stdio.h> #endif -#include <qpainter.h> -#include <qimage.h> -#include <qcolor.h> +#include <tqpainter.h> +#include <tqimage.h> +#include <tqcolor.h> #include <kapplication.h> #include <kpixmapeffect.h> #include "kled.h" @@ -149,20 +149,20 @@ class KLed::KLedPrivate friend class KLed; int dark_factor; - QColor offcolor; - QPixmap *off_map; - QPixmap *on_map; + TQColor offcolor; + TQPixmap *off_map; + TQPixmap *on_map; }; -KLed::KLed(QWidget *parent, const char *name) - : QWidget( parent, name), +KLed::KLed(TQWidget *parent, const char *name) + : TQWidget( parent, name), led_state(On), led_look(Raised), led_shape(Circular) { - QColor col(green); + TQColor col(green); d = new KLed::KLedPrivate; d->dark_factor = 300; d->offcolor = col.dark(300); @@ -173,8 +173,8 @@ KLed::KLed(QWidget *parent, const char *name) } -KLed::KLed(const QColor& col, QWidget *parent, const char *name) - : QWidget( parent, name), +KLed::KLed(const TQColor& col, TQWidget *parent, const char *name) + : TQWidget( parent, name), led_state(On), led_look(Raised), led_shape(Circular) @@ -189,9 +189,9 @@ KLed::KLed(const QColor& col, QWidget *parent, const char *name) //setShape(Circular); } -KLed::KLed(const QColor& col, KLed::State state, - KLed::Look look, KLed::Shape shape, QWidget *parent, const char *name ) - : QWidget(parent, name), +KLed::KLed(const TQColor& col, KLed::State state, + KLed::Look look, KLed::Shape shape, TQWidget *parent, const char *name ) + : TQWidget(parent, name), led_state(state), led_look(look), led_shape(shape) @@ -215,11 +215,11 @@ KLed::~KLed() } void -KLed::paintEvent(QPaintEvent *) +KLed::paintEvent(TQPaintEvent *) { #ifdef PAINT_BENCH const int rounds = 1000; - QTime t; + TQTime t; t.start(); for (int i = 0; i < rounds; i++) { #endif @@ -269,10 +269,10 @@ KLed::paintEvent(QPaintEvent *) void KLed::paintFlat() // paint a ROUND FLAT led lamp { - QPainter paint; - QColor color; - QBrush brush; - QPen pen; + TQPainter paint; + TQColor color; + TQBrush brush; + TQPen pen; // Initialize coordinates, width, and height of the LED // @@ -294,7 +294,7 @@ KLed::paintFlat() // paint a ROUND FLAT led lamp // Set the brush to SolidPattern, this fills the entire area // of the ellipse which is drawn with a thin grey "border" (pen) - brush.setStyle( QBrush::SolidPattern ); + brush.setStyle( TQBrush::SolidPattern ); brush.setColor( color ); pen.setWidth( 1 ); @@ -315,10 +315,10 @@ KLed::paintFlat() // paint a ROUND FLAT led lamp void KLed::paintRound() // paint a ROUND RAISED led lamp { - QPainter paint; - QColor color; - QBrush brush; - QPen pen; + TQPainter paint; + TQColor color; + TQBrush brush; + TQPen pen; // Initialize coordinates, width, and height of the LED int width = this->width(); @@ -339,7 +339,7 @@ KLed::paintRound() // paint a ROUND RAISED led lamp // Set the brush to SolidPattern, this fills the entire area // of the ellipse which is drawn first - brush.setStyle( QBrush::SolidPattern ); + brush.setStyle( TQBrush::SolidPattern ); brush.setColor( color ); paint.setBrush( brush ); // Assign the brush to the painter @@ -389,7 +389,7 @@ KLed::paintRound() // paint a ROUND RAISED led lamp color = colorGroup().dark(); pen.setColor( color ); // Set the pen accordingly paint.setPen( pen ); // Select pen for drawing - brush.setStyle( QBrush::NoBrush ); // Switch off the brush + brush.setStyle( TQBrush::NoBrush ); // Switch off the brush paint.setBrush( brush ); // This avoids filling of the ellipse paint.drawEllipse( 1, 1, width, width ); @@ -402,10 +402,10 @@ KLed::paintRound() // paint a ROUND RAISED led lamp void KLed::paintSunken() // paint a ROUND SUNKEN led lamp { - QPainter paint; - QColor color; - QBrush brush; - QPen pen; + TQPainter paint; + TQColor color; + TQBrush brush; + TQPen pen; // First of all we want to know what area should be updated // Initialize coordinates, width, and height of the LED @@ -421,7 +421,7 @@ KLed::paintSunken() // paint a ROUND SUNKEN led lamp // maybe we could stop HERE, if width <=0 ? int scale = 1; - QPixmap *tmpMap = 0; + TQPixmap *tmpMap = 0; bool smooth = true; if (smooth) @@ -445,7 +445,7 @@ KLed::paintSunken() // paint a ROUND SUNKEN led lamp scale = 3; width *= scale; - tmpMap = new QPixmap(width, width); + tmpMap = new TQPixmap(width, width); tmpMap->fill(paletteBackgroundColor()); paint.begin(tmpMap); @@ -459,7 +459,7 @@ KLed::paintSunken() // paint a ROUND SUNKEN led lamp // Set the brush to SolidPattern, this fills the entire area // of the ellipse which is drawn first - brush.setStyle( QBrush::SolidPattern ); + brush.setStyle( TQBrush::SolidPattern ); brush.setColor( color ); paint.setBrush( brush ); // Assign the brush to the painter @@ -506,7 +506,7 @@ KLed::paintSunken() // paint a ROUND SUNKEN led lamp // from the upper left. pen.setWidth( 2 * scale + 1 ); // ### shouldn't this value be smaller for smaller LEDs? - brush.setStyle( QBrush::NoBrush ); // Switch off the brush + brush.setStyle( TQBrush::NoBrush ); // Switch off the brush paint.setBrush( brush ); // This avoids filling of the ellipse // Set the initial color value to colorGroup().light() (bright) and start @@ -531,12 +531,12 @@ KLed::paintSunken() // paint a ROUND SUNKEN led lamp if (smooth) { - QPixmap *&dest = led_state ? d->on_map : d->off_map; - QImage i = tmpMap->convertToImage(); + TQPixmap *&dest = led_state ? d->on_map : d->off_map; + TQImage i = tmpMap->convertToImage(); width /= 3; i = i.smoothScale(width, width); delete tmpMap; - dest = new QPixmap(i); + dest = new TQPixmap(i); paint.begin(this); paint.drawPixmap(0, 0, *dest); paint.end(); @@ -546,10 +546,10 @@ KLed::paintSunken() // paint a ROUND SUNKEN led lamp void KLed::paintRect() { - QPainter painter(this); - QBrush lightBrush(led_color); - QBrush darkBrush(d->offcolor); - QPen pen(led_color.dark(300)); + TQPainter painter(this); + TQBrush lightBrush(led_color); + TQBrush darkBrush(d->offcolor); + TQPen pen(led_color.dark(300)); int w = width(); int h = height(); // ----- @@ -577,13 +577,13 @@ KLed::paintRect() void KLed::paintRectFrame(bool raised) { - QPainter painter(this); - QBrush lightBrush(led_color); - QBrush darkBrush(d->offcolor); + TQPainter painter(this); + TQBrush lightBrush(led_color); + TQBrush darkBrush(d->offcolor); int w = width(); int h = height(); - QColor black = Qt::black; - QColor white = Qt::white; + TQColor black = Qt::black; + TQColor white = Qt::white; // ----- if (raised) { painter.setPen(white); @@ -656,7 +656,7 @@ KLed::setShape(KLed::Shape s) } void -KLed::setColor(const QColor& col) +KLed::setColor(const TQColor& col) { if (led_color != col) { led_color = col; @@ -715,13 +715,13 @@ KLed::off() QSize KLed::sizeHint() const { - return QSize(16, 16); + return TQSize(16, 16); } QSize KLed::minimumSizeHint() const { - return QSize(16, 16 ); + return TQSize(16, 16 ); } void KLed::virtual_hook( int, void* ) |