summaryrefslogtreecommitdiffstats
path: root/kdeui/kled.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:46:43 +0000
commitffe8a83e053396df448e9413828527613ca3bd46 (patch)
treea73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kdeui/kled.cpp
parent682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff)
downloadtdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz
tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdeui/kled.cpp')
-rw-r--r--kdeui/kled.cpp126
1 files changed, 63 insertions, 63 deletions
diff --git a/kdeui/kled.cpp b/kdeui/kled.cpp
index 6a8d7c5e0..b7980203b 100644
--- a/kdeui/kled.cpp
+++ b/kdeui/kled.cpp
@@ -22,14 +22,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"
@@ -40,20 +40,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);
@@ -64,8 +64,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)
@@ -80,9 +80,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)
@@ -106,11 +106,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
@@ -180,13 +180,13 @@ KLed::paintCachedPixmap()
{
if (led_state) {
if (d->on_map) {
- QPainter paint(this);
+ TQPainter paint(this);
paint.drawPixmap(0, 0, *d->on_map);
return true;
}
} else {
if (d->off_map) {
- QPainter paint(this);
+ TQPainter paint(this);
paint.drawPixmap(0, 0, *d->off_map);
return true;
}
@@ -200,20 +200,20 @@ KLed::paintFlat() // paint a ROUND FLAT led lamp
{
if (paintCachedPixmap()) return;
- QPainter paint;
- QColor color;
- QBrush brush;
- QPen pen;
+ TQPainter paint;
+ TQColor color;
+ TQBrush brush;
+ TQPen pen;
int width = ensureRoundLed();
int scale = 3;
- QPixmap *tmpMap = 0;
+ TQPixmap *tmpMap = 0;
width *= scale;
- tmpMap = new QPixmap(width + 6, width + 6);
+ tmpMap = new TQPixmap(width + 6, width + 6);
tmpMap->fill(paletteBackgroundColor());
// start painting widget
@@ -225,7 +225,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 gray "border" (pen)
- brush.setStyle( QBrush::SolidPattern );
+ brush.setStyle( TQBrush::SolidPattern );
brush.setColor( color );
pen.setWidth( scale );
@@ -241,12 +241,12 @@ KLed::paintFlat() // paint a ROUND FLAT led lamp
paint.end();
//
// painting done
- 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();
@@ -258,20 +258,20 @@ KLed::paintRound() // paint a ROUND RAISED led lamp
{
if (paintCachedPixmap()) return;
- 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 = ensureRoundLed();
int scale = 3;
- QPixmap *tmpMap = 0;
+ TQPixmap *tmpMap = 0;
width *= scale;
- tmpMap = new QPixmap(width + 6, width + 6);
+ tmpMap = new TQPixmap(width + 6, width + 6);
tmpMap->fill(paletteBackgroundColor());
paint.begin(tmpMap);
@@ -280,7 +280,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
@@ -328,7 +328,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( 2, 2, width, width );
@@ -336,12 +336,12 @@ KLed::paintRound() // paint a ROUND RAISED led lamp
paint.end();
//
// painting done
- 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();
@@ -353,21 +353,21 @@ KLed::paintSunken() // paint a ROUND SUNKEN led lamp
{
if (paintCachedPixmap()) return;
- 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
int width = ensureRoundLed();
int scale = 3;
- QPixmap *tmpMap = 0;
+ TQPixmap *tmpMap = 0;
width *= scale;
- tmpMap = new QPixmap(width, width);
+ tmpMap = new TQPixmap(width, width);
tmpMap->fill(paletteBackgroundColor());
paint.begin(tmpMap);
@@ -376,7 +376,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
@@ -421,7 +421,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
@@ -443,12 +443,12 @@ KLed::paintSunken() // paint a ROUND SUNKEN led lamp
//
// painting done
- 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();
@@ -458,10 +458,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();
// -----
@@ -489,13 +489,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)
{
@@ -569,7 +569,7 @@ KLed::setShape(KLed::Shape s)
}
void
-KLed::setColor(const QColor& col)
+KLed::setColor(const TQColor& col)
{
if(led_color!=col) {
if(d->on_map) { delete d->on_map; d->on_map = 0; }
@@ -629,13 +629,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* )