diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-02 19:23:46 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-02 19:23:46 +0000 |
commit | eba47f8f0637f451e21348187591e1f1fd58ac74 (patch) | |
tree | 448f10b95c656604acc331a3236c1e59bde5c1ad /kcoloredit/kxycolorselector.cpp | |
parent | c7e8736c69373f48b0401319757c742e8607431a (diff) | |
download | tdegraphics-eba47f8f0637f451e21348187591e1f1fd58ac74.tar.gz tdegraphics-eba47f8f0637f451e21348187591e1f1fd58ac74.zip |
TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1158446 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcoloredit/kxycolorselector.cpp')
-rw-r--r-- | kcoloredit/kxycolorselector.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/kcoloredit/kxycolorselector.cpp b/kcoloredit/kxycolorselector.cpp index e12f7987..4a717c5e 100644 --- a/kcoloredit/kxycolorselector.cpp +++ b/kcoloredit/kxycolorselector.cpp @@ -15,15 +15,15 @@ * * ***************************************************************************/ -#include <qpainter.h> -#include <qpixmap.h> -#include <qimage.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqimage.h> #include <kimageeffect.h> #include <kpalette.h> #include "kxycolorselector.h" -KXYColorSelector::KXYColorSelector(QWidget *parent, const char *name) : KXYSelector(parent,name) { +KXYColorSelector::KXYColorSelector(TQWidget *parent, const char *name) : KXYSelector(parent,name) { setBackgroundMode(NoBackground); setRange(0, 0, COMPONENT_SELECTION_RESOLUTION - 1, COMPONENT_SELECTION_RESOLUTION - 1); setType(TYPE_NONE); @@ -45,17 +45,17 @@ void KXYColorSelector::updateContents() { repaint(); } -void KXYColorSelector::resizeEvent(QResizeEvent*) { +void KXYColorSelector::resizeEvent(TQResizeEvent*) { setValues(xValue(), yValue()); updateContents(); } -void KXYColorSelector::drawContents(QPainter* painter) { +void KXYColorSelector::drawContents(TQPainter* painter) { painter->drawPixmap(contentsRect().x(), contentsRect().y(), pixmap); } -void KXYColorSelector::drawCursor(QPainter* painter, int x, int y) { - QColor color; +void KXYColorSelector::drawCursor(TQPainter* painter, int x, int y) { + TQColor color; int colorX = x - contentsRect().x(); int colorY = y - contentsRect().y(); if(colorX < 0) @@ -67,13 +67,13 @@ void KXYColorSelector::drawCursor(QPainter* painter, int x, int y) { if(colorY > contentsRect().height() - 1) colorY = contentsRect().height() - 1; setColor(&color, colorX, colorY); - QColor cursorColor; + TQColor cursorColor; if(( 2*color.red() + 4*color.green() + 1*color.blue() )*1.0/ ( 2*255 + 4*255 + 1*255 ) > 0.65) cursorColor = Qt::black; else cursorColor = Qt::white; - painter->setPen(QPen( cursorColor )); + painter->setPen(TQPen( cursorColor )); const int lineBegin = 2; const int lineEnd = 6; painter->drawLine(x + lineBegin, y - lineBegin, x + lineEnd, y - lineEnd); @@ -90,7 +90,7 @@ int KXYColorSelector::globalComponent() const{ return m_globalComponent; } -void KXYColorSelector::setColor(QColor* const color, const int x, const int y) { +void KXYColorSelector::setColor(TQColor* const color, const int x, const int y) { int xSize = contentsRect().width(); int ySize = contentsRect().height(); switch(type) { @@ -131,8 +131,8 @@ void KXYColorSelector::setColor(QColor* const color, const int x, const int y) { } } -QColor* KXYColorSelector::standardColorsPalette() { - QColor* palette = new QColor[STANDARD_PALETTE_SIZE]; +TQColor* KXYColorSelector::standardColorsPalette() { + TQColor* palette = new QColor[STANDARD_PALETTE_SIZE]; int i = 0; palette[i++] = Qt::red; palette[i++] = Qt::green; @@ -154,11 +154,11 @@ QColor* KXYColorSelector::standardColorsPalette() { return palette; } -void KXYColorSelector::drawPalette(QPixmap* pixmap) { +void KXYColorSelector::drawPalette(TQPixmap* pixmap) { int xSize = contentsRect().width(); int ySize = contentsRect().height(); - QImage image(xSize, ySize, 32); - QColor color; + TQImage image(xSize, ySize, 32); + TQColor color; int x; int y; @@ -173,9 +173,9 @@ void KXYColorSelector::drawPalette(QPixmap* pixmap) { ++p; } } - if (QColor::numBitPlanes() <= 8) + if (TQColor::numBitPlanes() <= 8) { - QColor* standardPalette = standardColorsPalette(); + TQColor* standardPalette = standardColorsPalette(); KImageEffect::dither(image, standardPalette, STANDARD_PALETTE_SIZE); delete[] standardPalette; } |