summaryrefslogtreecommitdiffstats
path: root/digikam/libs/widgets/common/histogramwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'digikam/libs/widgets/common/histogramwidget.cpp')
-rw-r--r--digikam/libs/widgets/common/histogramwidget.cpp302
1 files changed, 151 insertions, 151 deletions
diff --git a/digikam/libs/widgets/common/histogramwidget.cpp b/digikam/libs/widgets/common/histogramwidget.cpp
index 4e9b5377..4e8f2427 100644
--- a/digikam/libs/widgets/common/histogramwidget.cpp
+++ b/digikam/libs/widgets/common/histogramwidget.cpp
@@ -28,19 +28,19 @@
#include <cmath>
-// Qt includes.
-
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <qpen.h>
-#include <qevent.h>
-#include <qtimer.h>
-#include <qcolor.h>
-#include <qbrush.h>
-#include <qrect.h>
-#include <qfont.h>
-#include <qfontmetrics.h>
-#include <qtooltip.h>
+// TQt includes.
+
+#include <tqpixmap.h>
+#include <tqpainter.h>
+#include <tqpen.h>
+#include <tqevent.h>
+#include <tqtimer.h>
+#include <tqcolor.h>
+#include <tqbrush.h>
+#include <tqrect.h>
+#include <tqfont.h>
+#include <tqfontmetrics.h>
+#include <tqtooltip.h>
// KDE includes.
@@ -102,7 +102,7 @@ public:
// image/computation time).
bool inInitialRepaintWait;
- QTimer *blinkTimer;
+ TQTimer *blinkTimer;
DColor colorGuide;
};
@@ -110,9 +110,9 @@ public:
// Constructor without image data (needed to use updateData() method after instance created).
HistogramWidget::HistogramWidget(int w, int h,
- QWidget *parent, bool selectMode,
+ TQWidget *tqparent, bool selectMode,
bool showProgress, bool statisticsVisible)
- : QWidget(parent, 0, Qt::WDestructiveClose)
+ : TQWidget(tqparent, 0, TQt::WDestructiveClose)
{
d = new HistogramWidgetPriv;
setup(w, h, selectMode, showProgress, statisticsVisible);
@@ -126,15 +126,15 @@ HistogramWidget::HistogramWidget(int w, int h,
HistogramWidget::HistogramWidget(int w, int h,
uchar *i_data, uint i_w, uint i_h,
bool i_sixteenBits,
- QWidget *parent, bool selectMode,
+ TQWidget *tqparent, bool selectMode,
bool showProgress, bool statisticsVisible)
- : QWidget(parent, 0, Qt::WDestructiveClose)
+ : TQWidget(tqparent, 0, TQt::WDestructiveClose)
{
d = new HistogramWidgetPriv;
d->sixteenBits = i_sixteenBits;
setup(w, h, selectMode, showProgress, statisticsVisible);
- m_imageHistogram = new ImageHistogram(i_data, i_w, i_h, i_sixteenBits, this);
+ m_imageHistogram = new ImageHistogram(i_data, i_w, i_h, i_sixteenBits, TQT_TQOBJECT(this));
m_selectionHistogram = 0L;
}
@@ -144,16 +144,16 @@ HistogramWidget::HistogramWidget(int w, int h,
uchar *i_data, uint i_w, uint i_h,
uchar *s_data, uint s_w, uint s_h,
bool i_sixteenBits,
- QWidget *parent, bool selectMode,
+ TQWidget *tqparent, bool selectMode,
bool showProgress, bool statisticsVisible)
- : QWidget(parent, 0, Qt::WDestructiveClose)
+ : TQWidget(tqparent, 0, TQt::WDestructiveClose)
{
d = new HistogramWidgetPriv;
d->sixteenBits = i_sixteenBits;
setup(w, h, selectMode, showProgress, statisticsVisible);
- m_imageHistogram = new ImageHistogram(i_data, i_w, i_h, i_sixteenBits, this);
- m_selectionHistogram = new ImageHistogram(s_data, s_w, s_h, i_sixteenBits, this);
+ m_imageHistogram = new ImageHistogram(i_data, i_w, i_h, i_sixteenBits, TQT_TQOBJECT(this));
+ m_selectionHistogram = new ImageHistogram(s_data, s_w, s_h, i_sixteenBits, TQT_TQOBJECT(this));
}
HistogramWidget::~HistogramWidget()
@@ -182,26 +182,26 @@ void HistogramWidget::setup(int w, int h, bool selectMode, bool showProgress, bo
setMouseTracking(true);
setMinimumSize(w, h);
- d->blinkTimer = new QTimer( this );
+ d->blinkTimer = new TQTimer( this );
- connect( d->blinkTimer, SIGNAL(timeout()),
- this, SLOT(slotBlinkTimerDone()) );
+ connect( d->blinkTimer, TQT_SIGNAL(timeout()),
+ this, TQT_SLOT(slotBlinkTimerDone()) );
}
void HistogramWidget::setHistogramGuideByColor(const DColor& color)
{
d->guideVisible = true;
d->colorGuide = color;
- repaint(false);
+ tqrepaint(false);
}
void HistogramWidget::reset()
{
d->guideVisible = false;
- repaint(false);
+ tqrepaint(false);
}
-void HistogramWidget::customEvent(QCustomEvent *event)
+void HistogramWidget::customEvent(TQCustomEvent *event)
{
if (!event) return;
@@ -220,15 +220,15 @@ void HistogramWidget::customEvent(QCustomEvent *event)
{
if (d->clearFlag != HistogramWidgetPriv::HistogramDataLoading)
{
- // enter initial repaint wait, repaint only after waiting
+ // enter initial tqrepaint wait, tqrepaint only after waiting
// a short time so that very fast computation does not create flicker
d->inInitialRepaintWait = true;
d->blinkTimer->start( 100 );
}
else
{
- // after the initial repaint, we can repaint immediately
- repaint(false);
+ // after the initial tqrepaint, we can tqrepaint immediately
+ tqrepaint(false);
d->blinkTimer->start( 200 );
}
}
@@ -244,22 +244,22 @@ void HistogramWidget::customEvent(QCustomEvent *event)
setCursor( KCursor::arrowCursor() );
// Send signals to refresh information if necessary.
- // The signals may trigger multiple repaints, avoid this,
- // we repaint once afterwards.
+ // The signals may trigger multiple tqrepaints, avoid this,
+ // we tqrepaint once afterwards.
setUpdatesEnabled(false);
notifyValuesChanged();
emit signalHistogramComputationDone(d->sixteenBits);
setUpdatesEnabled(true);
- repaint(false);
+ tqrepaint(false);
}
else
{
d->clearFlag = HistogramWidgetPriv::HistogramFailed;
d->blinkTimer->stop();
d->inInitialRepaintWait = false;
- repaint(false);
+ tqrepaint(false);
setCursor( KCursor::arrowCursor() );
// Remove old histogram data from memory.
if (m_imageHistogram)
@@ -285,7 +285,7 @@ void HistogramWidget::setDataLoading()
{
setCursor( KCursor::waitCursor() );
d->clearFlag = HistogramWidgetPriv::HistogramDataLoading;
- // enter initial repaint wait, repaint only after waiting
+ // enter initial tqrepaint wait, tqrepaint only after waiting
// a short time so that very fast computation does not create flicker
d->inInitialRepaintWait = true;
d->pos = 0;
@@ -299,7 +299,7 @@ void HistogramWidget::setLoadingFailed()
d->pos = 0;
d->blinkTimer->stop();
d->inInitialRepaintWait = false;
- repaint(false);
+ tqrepaint(false);
setCursor( KCursor::arrowCursor() );
}
@@ -340,10 +340,10 @@ void HistogramWidget::updateData(uchar *i_data, uint i_w, uint i_h,
delete m_selectionHistogram;
// Calc new histogram data
- m_imageHistogram = new ImageHistogram(i_data, i_w, i_h, i_sixteenBits, this);
+ m_imageHistogram = new ImageHistogram(i_data, i_w, i_h, i_sixteenBits, TQT_TQOBJECT(this));
if (s_data && s_w && s_h)
- m_selectionHistogram = new ImageHistogram(s_data, s_w, s_h, i_sixteenBits, this);
+ m_selectionHistogram = new ImageHistogram(s_data, s_w, s_h, i_sixteenBits, TQT_TQOBJECT(this));
else
m_selectionHistogram = 0L;
}
@@ -360,17 +360,17 @@ void HistogramWidget::updateSelectionData(uchar *s_data, uint s_w, uint s_h,
delete m_selectionHistogram;
// Calc new histogram data
- m_selectionHistogram = new ImageHistogram(s_data, s_w, s_h, i_sixteenBits, this);
+ m_selectionHistogram = new ImageHistogram(s_data, s_w, s_h, i_sixteenBits, TQT_TQOBJECT(this));
}
void HistogramWidget::slotBlinkTimerDone()
{
d->inInitialRepaintWait = false;
- repaint(false);
+ tqrepaint(false);
d->blinkTimer->start( 200 );
}
-void HistogramWidget::paintEvent(QPaintEvent*)
+void HistogramWidget::paintEvent(TQPaintEvent*)
{
// Widget is disabled, not initialized,
// or loading, but no message shall be drawn:
@@ -381,13 +381,13 @@ void HistogramWidget::paintEvent(QPaintEvent*)
d->clearFlag == HistogramWidgetPriv::HistogramDataLoading))
)
{
- QPixmap pm(size());
- QPainter p1;
- p1.begin(&pm, this);
- p1.fillRect(0, 0, size().width(), size().height(), palette().disabled().background());
- p1.setPen(QPen(palette().active().foreground(), 1, Qt::SolidLine));
+ TQPixmap pm(size());
+ TQPainter p1;
+ p1.tqbegin(TQT_TQPAINTDEVICE(&pm), TQT_TQOBJECT(this));
+ p1.fillRect(0, 0, size().width(), size().height(), tqpalette().disabled().background());
+ p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
p1.drawRect(0, 0, width(), height());
- p1.setPen(QPen(palette().disabled().foreground(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().disabled().foreground(), 1, TQt::SolidLine));
p1.drawRect(0, 0, width(), height());
p1.end();
bitBlt(this, 0, 0, &pm);
@@ -403,14 +403,14 @@ void HistogramWidget::paintEvent(QPaintEvent*)
// In first, we draw an animation.
int asize = 24;
- QPixmap anim(asize, asize);
- QPainter p2;
- p2.begin(&anim, this);
- p2.fillRect(0, 0, asize, asize, palette().active().background());
+ TQPixmap anim(asize, asize);
+ TQPainter p2;
+ p2.tqbegin(TQT_TQPAINTDEVICE(&anim), TQT_TQOBJECT(this));
+ p2.fillRect(0, 0, asize, asize, tqpalette().active().background());
p2.translate(asize/2, asize/2);
d->pos = (d->pos + 10) % 360;
- p2.setPen(QPen(palette().active().text()));
+ p2.setPen(TQPen(tqpalette().active().text()));
p2.rotate(d->pos);
for ( int i=0 ; i<12 ; i++ )
{
@@ -421,20 +421,20 @@ void HistogramWidget::paintEvent(QPaintEvent*)
// ... and we render busy text.
- QPixmap pm(size());
- QPainter p1;
- p1.begin(&pm, this);
- p1.fillRect(0, 0, width(), height(), palette().active().background());
- p1.setPen(QPen(palette().active().foreground(), 1, Qt::SolidLine));
+ TQPixmap pm(size());
+ TQPainter p1;
+ p1.tqbegin(TQT_TQPAINTDEVICE(&pm), TQT_TQOBJECT(this));
+ p1.fillRect(0, 0, width(), height(), tqpalette().active().background());
+ p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
p1.drawRect(0, 0, width(), height());
p1.drawPixmap(width()/2 - asize /2, asize, anim);
- p1.setPen(QPen(palette().active().text()));
+ p1.setPen(TQPen(tqpalette().active().text()));
if (d->clearFlag == HistogramWidgetPriv::HistogramDataLoading)
- p1.drawText(0, 0, width(), height(), Qt::AlignCenter,
+ p1.drawText(0, 0, width(), height(), TQt::AlignCenter,
i18n("Loading image..."));
else
- p1.drawText(0, 0, width(), height(), Qt::AlignCenter,
+ p1.drawText(0, 0, width(), height(), TQt::AlignCenter,
i18n("Histogram calculation..."));
p1.end();
@@ -445,14 +445,14 @@ void HistogramWidget::paintEvent(QPaintEvent*)
// Draw message.
else if (d->clearFlag == HistogramWidgetPriv::HistogramFailed)
{
- QPixmap pm(size());
- QPainter p1;
- p1.begin(&pm, this);
- p1.fillRect(0, 0, width(), height(), palette().active().background());
- p1.setPen(QPen(palette().active().foreground(), 1, Qt::SolidLine));
+ TQPixmap pm(size());
+ TQPainter p1;
+ p1.tqbegin(TQT_TQPAINTDEVICE(&pm), TQT_TQOBJECT(this));
+ p1.fillRect(0, 0, width(), height(), tqpalette().active().background());
+ p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
p1.drawRect(0, 0, width(), height());
- p1.setPen(QPen(palette().active().text()));
- p1.drawText(0, 0, width(), height(), Qt::AlignCenter,
+ p1.setPen(TQPen(tqpalette().active().text()));
+ p1.drawText(0, 0, width(), height(), TQt::AlignCenter,
i18n("Histogram\ncalculation\nfailed."));
p1.end();
bitBlt(this, 0, 0, &pm);
@@ -497,7 +497,7 @@ void HistogramWidget::paintEvent(QPaintEvent*)
break;
case HistogramWidget::ColorChannelsHistogram: // All color channels.
- max = QMAX (QMAX (histogram->getMaximum(ImageHistogram::RedChannel),
+ max = TQMAX (TQMAX (histogram->getMaximum(ImageHistogram::RedChannel),
histogram->getMaximum(ImageHistogram::GreenChannel)),
histogram->getMaximum(ImageHistogram::BlueChannel));
break;
@@ -520,12 +520,12 @@ void HistogramWidget::paintEvent(QPaintEvent*)
break;
}
- // A QPixmap is used to enable the double buffering.
+ // A TQPixmap is used to enable the double buffering.
- QPixmap pm(size());
- QPainter p1;
- p1.begin(&pm, this);
- p1.fillRect(0, 0, width(), height(), palette().active().background());
+ TQPixmap pm(size());
+ TQPainter p1;
+ p1.tqbegin(TQT_TQPAINTDEVICE(&pm), TQT_TQOBJECT(this));
+ p1.fillRect(0, 0, width(), height(), tqpalette().active().background());
// Drawing selection or all histogram values.
@@ -645,35 +645,35 @@ void HistogramWidget::paintEvent(QPaintEvent*)
{
if ( x >= (int)(d->xmin * wWidth) && x <= (int)(d->xmax * wWidth) )
{
- p1.setPen(QPen(palette().active().foreground(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, 0);
- p1.setPen(QPen(palette().active().background(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - y);
}
else
{
- p1.setPen(QPen(palette().active().foreground(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - y);
- p1.setPen(QPen(palette().active().background(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight - y, x, 0);
if ( x == wWidth/4 || x == wWidth/2 || x == 3*wWidth/4 )
{
- p1.setPen(QPen(palette().active().base(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().base(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, 0);
}
}
}
else
{
- p1.setPen(QPen(palette().active().foreground(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - y);
- p1.setPen(QPen(palette().active().background(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight - y, x, 0);
if ( x == wWidth/4 || x == wWidth/2 || x == 3*wWidth/4 )
{
- p1.setPen(QPen(palette().active().base(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().base(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, 0);
}
}
@@ -684,9 +684,9 @@ void HistogramWidget::paintEvent(QPaintEvent*)
{
if ( x >= (int)(d->xmin * wWidth) && x <= (int)(d->xmax * wWidth) )
{
- p1.setPen(QPen(palette().active().foreground(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, 0);
- p1.setPen(QPen(palette().active().background(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
// Witch color must be used on the foreground with all colors channel mode?
switch (m_colorType)
@@ -710,69 +710,69 @@ void HistogramWidget::paintEvent(QPaintEvent*)
switch (m_colorType)
{
case HistogramWidget::RedColor:
- p1.setPen(QPen(Qt::green, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::green, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yg);
- p1.setPen(QPen(Qt::blue, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::blue, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yb);
- p1.setPen(QPen(Qt::red, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::red, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yr);
- p1.setPen(QPen(palette().active().background(), 1, Qt::SolidLine));
- p1.drawLine(x, wHeight - QMAX(QMAX(yr, yg), yb), x, 0);
- p1.setPen(QPen(palette().active().foreground(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
+ p1.drawLine(x, wHeight - TQMAX(TQMAX(yr, yg), yb), x, 0);
+ p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight - yg -1, x, wHeight - yg);
p1.drawLine(x, wHeight - yb -1, x, wHeight - yb);
p1.drawLine(x, wHeight - yr -1, x, wHeight - yr);
if ( x == wWidth/4 || x == wWidth/2 || x == 3*wWidth/4 )
{
- p1.setPen(QPen(palette().active().base(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().base(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, 0);
}
break;
case HistogramWidget::GreenColor:
- p1.setPen(QPen(Qt::blue, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::blue, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yb);
- p1.setPen(QPen(Qt::red, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::red, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yr);
- p1.setPen(QPen(Qt::green, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::green, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yg);
- p1.setPen(QPen(palette().active().background(), 1, Qt::SolidLine));
- p1.drawLine(x, wHeight - QMAX(QMAX(yr, yg), yb), x, 0);
- p1.setPen(QPen(palette().active().foreground(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
+ p1.drawLine(x, wHeight - TQMAX(TQMAX(yr, yg), yb), x, 0);
+ p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight - yb -1, x, wHeight - yb);
p1.drawLine(x, wHeight - yr -1, x, wHeight - yr);
p1.drawLine(x, wHeight - yg -1, x, wHeight - yg);
if ( x == wWidth/4 || x == wWidth/2 || x == 3*wWidth/4 )
{
- p1.setPen(QPen(palette().active().base(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().base(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, 0);
}
break;
default:
- p1.setPen(QPen(Qt::red, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::red, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yr);
- p1.setPen(QPen(Qt::green, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::green, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yg);
- p1.setPen(QPen(Qt::blue, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::blue, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yb);
- p1.setPen(QPen(palette().active().background(), 1, Qt::SolidLine));
- p1.drawLine(x, wHeight - QMAX(QMAX(yr, yg), yb), x, 0);
- p1.setPen(QPen(palette().active().foreground(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
+ p1.drawLine(x, wHeight - TQMAX(TQMAX(yr, yg), yb), x, 0);
+ p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight - yr -1, x, wHeight - yr);
p1.drawLine(x, wHeight - yg -1, x, wHeight - yg);
p1.drawLine(x, wHeight - yb -1, x, wHeight - yb);
if ( x == wWidth/4 || x == wWidth/2 || x == 3*wWidth/4 )
{
- p1.setPen(QPen(palette().active().base(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().base(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, 0);
}
@@ -786,69 +786,69 @@ void HistogramWidget::paintEvent(QPaintEvent*)
switch (m_colorType)
{
case HistogramWidget::RedColor:
- p1.setPen(QPen(Qt::green, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::green, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yg);
- p1.setPen(QPen(Qt::blue, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::blue, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yb);
- p1.setPen(QPen(Qt::red, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::red, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yr);
- p1.setPen(QPen(palette().active().background(), 1, Qt::SolidLine));
- p1.drawLine(x, wHeight - QMAX(QMAX(yr, yg), yb), x, 0);
- p1.setPen(QPen(palette().active().foreground(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
+ p1.drawLine(x, wHeight - TQMAX(TQMAX(yr, yg), yb), x, 0);
+ p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight - yg -1, x, wHeight - yg);
p1.drawLine(x, wHeight - yb -1, x, wHeight - yb);
p1.drawLine(x, wHeight - yr -1, x, wHeight - yr);
if ( x == wWidth/4 || x == wWidth/2 || x == 3*wWidth/4 )
{
- p1.setPen(QPen(palette().active().base(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().base(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, 0);
}
break;
case HistogramWidget::GreenColor:
- p1.setPen(QPen(Qt::blue, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::blue, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yb);
- p1.setPen(QPen(Qt::red, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::red, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yr);
- p1.setPen(QPen(Qt::green, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::green, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yg);
- p1.setPen(QPen(palette().active().background(), 1, Qt::SolidLine));
- p1.drawLine(x, wHeight - QMAX(QMAX(yr, yg), yb), x, 0);
- p1.setPen(QPen(palette().active().foreground(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
+ p1.drawLine(x, wHeight - TQMAX(TQMAX(yr, yg), yb), x, 0);
+ p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight - yb -1, x, wHeight - yb);
p1.drawLine(x, wHeight - yr -1, x, wHeight - yr);
p1.drawLine(x, wHeight - yg -1, x, wHeight - yg);
if ( x == wWidth/4 || x == wWidth/2 || x == 3*wWidth/4 )
{
- p1.setPen(QPen(palette().active().base(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().base(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, 0);
}
break;
default:
- p1.setPen(QPen(Qt::red, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::red, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yr);
- p1.setPen(QPen(Qt::green, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::green, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yg);
- p1.setPen(QPen(Qt::blue, 1, Qt::SolidLine));
+ p1.setPen(TQPen(TQt::blue, 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, wHeight - yb);
- p1.setPen(QPen(palette().active().background(), 1, Qt::SolidLine));
- p1.drawLine(x, wHeight - QMAX(QMAX(yr, yg), yb), x, 0);
- p1.setPen(QPen(palette().active().foreground(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().background(), 1, TQt::SolidLine));
+ p1.drawLine(x, wHeight - TQMAX(TQMAX(yr, yg), yb), x, 0);
+ p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight - yr -1, x, wHeight - yr);
p1.drawLine(x, wHeight - yg -1, x, wHeight - yg);
p1.drawLine(x, wHeight - yb -1, x, wHeight - yb);
if ( x == wWidth/4 || x == wWidth/2 || x == 3*wWidth/4 )
{
- p1.setPen(QPen(palette().active().base(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().base(), 1, TQt::SolidLine));
p1.drawLine(x, wHeight, x, 0);
}
@@ -860,7 +860,7 @@ void HistogramWidget::paintEvent(QPaintEvent*)
// Drawing color guide.
- p1.setPen(QPen(Qt::red, 1, Qt::DotLine));
+ p1.setPen(TQPen(TQt::red, 1, TQt::DotLine));
int guidePos;
if (d->guideVisible)
@@ -880,7 +880,7 @@ void HistogramWidget::paintEvent(QPaintEvent*)
break;
case HistogramWidget::ValueHistogram:
- guidePos = QMAX(QMAX(d->colorGuide.red(), d->colorGuide.green()), d->colorGuide.blue());
+ guidePos = TQMAX(TQMAX(d->colorGuide.red(), d->colorGuide.green()), d->colorGuide.blue());
break;
case HistogramWidget::ColorChannelsHistogram:
@@ -911,37 +911,37 @@ void HistogramWidget::paintEvent(QPaintEvent*)
int xGuide = (guidePos * wWidth) / histogram->getHistogramSegment();
p1.drawLine(xGuide, 0, xGuide, wHeight);
- QString string = i18n("x:%1").arg(guidePos);
- QFontMetrics fontMt( string );
- QRect rect = fontMt.boundingRect(0, 0, wWidth, wHeight, 0, string);
- p1.setPen(QPen(Qt::red, 1, Qt::SolidLine));
+ TQString string = i18n("x:%1").tqarg(guidePos);
+ TQFontMetrics fontMt( string );
+ TQRect rect = fontMt.boundingRect(0, 0, wWidth, wHeight, 0, string);
+ p1.setPen(TQPen(TQt::red, 1, TQt::SolidLine));
rect.moveTop(1);
if (xGuide < wWidth/2)
{
rect.moveLeft(xGuide);
- p1.fillRect(rect, QBrush(QColor(250, 250, 255)) );
+ p1.fillRect(rect, TQBrush(TQColor(250, 250, 255)) );
p1.drawRect(rect);
rect.moveLeft(xGuide+3);
- p1.drawText(rect, Qt::AlignLeft, string);
+ p1.drawText(rect, TQt::AlignLeft, string);
}
else
{
rect.moveRight(xGuide);
- p1.fillRect(rect, QBrush(QColor(250, 250, 255)) );
+ p1.fillRect(rect, TQBrush(TQColor(250, 250, 255)) );
p1.drawRect(rect);
rect.moveRight(xGuide-3);
- p1.drawText(rect, Qt::AlignRight, string);
+ p1.drawText(rect, TQt::AlignRight, string);
}
}
}
if (d->statisticsVisible)
{
- QString tipText, value;
- QString cellBeg("<tr><td><nobr><font size=-1>");
- QString cellMid("</font></nobr></td><td><nobr><font size=-1>");
- QString cellEnd("</font></nobr></td></tr>");
+ TQString tipText, value;
+ TQString cellBeg("<tr><td><nobr><font size=-1>");
+ TQString cellMid("</font></nobr></td><td><nobr><font size=-1>");
+ TQString cellEnd("</font></nobr></td></tr>");
tipText = "<table cellspacing=0 cellpadding=0>";
tipText += cellBeg + i18n("Mean:") + cellMid;
@@ -970,23 +970,23 @@ void HistogramWidget::paintEvent(QPaintEvent*)
tipText += "</table>";
- QToolTip::add( this, tipText);
+ TQToolTip::add( this, tipText);
}
- p1.setPen(QPen(palette().active().foreground(), 1, Qt::SolidLine));
+ p1.setPen(TQPen(tqpalette().active().foreground(), 1, TQt::SolidLine));
p1.drawRect(0, 0, width(), height());
p1.end();
bitBlt(this, 0, 0, &pm);
}
-void HistogramWidget::mousePressEvent(QMouseEvent* e)
+void HistogramWidget::mousePressEvent(TQMouseEvent* e)
{
if ( d->selectMode == true && d->clearFlag == HistogramWidgetPriv::HistogramCompleted )
{
if (!d->inSelected)
{
d->inSelected = true;
- repaint(false);
+ tqrepaint(false);
}
d->xmin = ((double)e->pos().x()) / ((double)width());
@@ -997,7 +997,7 @@ void HistogramWidget::mousePressEvent(QMouseEvent* e)
}
}
-void HistogramWidget::mouseReleaseEvent(QMouseEvent*)
+void HistogramWidget::mouseReleaseEvent(TQMouseEvent*)
{
if ( d->selectMode == true && d->clearFlag == HistogramWidgetPriv::HistogramCompleted )
{
@@ -1009,12 +1009,12 @@ void HistogramWidget::mouseReleaseEvent(QMouseEvent*)
//emit signalMinValueChanged( 0 );
//emit signalMaxValueChanged( d->range );
notifyValuesChanged();
- repaint(false);
+ tqrepaint(false);
}
}
}
-void HistogramWidget::mouseMoveEvent(QMouseEvent *e)
+void HistogramWidget::mouseMoveEvent(TQMouseEvent *e)
{
if ( d->selectMode == true && d->clearFlag == HistogramWidgetPriv::HistogramCompleted )
{
@@ -1040,7 +1040,7 @@ void HistogramWidget::mouseMoveEvent(QMouseEvent *e)
notifyValuesChanged();
//emit signalMaxValueChanged( d->xmax == 0.0 ? d->range : (int)(d->xmax * d->range) );
- repaint(false);
+ tqrepaint(false);
}
}
}
@@ -1064,7 +1064,7 @@ void HistogramWidget::slotMinValueChanged( int min )
{
d->xmin = ((double)min)/d->range;
}
- repaint(false);
+ tqrepaint(false);
}
}
@@ -1082,7 +1082,7 @@ void HistogramWidget::slotMaxValueChanged(int max)
{
d->xmax = ((double)max)/d->range;
}
- repaint(false);
+ tqrepaint(false);
}
}