21 switch (m_colorFilterMode) {
46 QLabel::paintEvent (
event);
49void ViewProfileScale::paintForeground ()
51 if (
qGray (m_rgbBackground) < 127) {
53 paintOneSpectrum (
QColor (m_rgbBackground),
QColor (Qt::white));
56 paintOneSpectrum (
QColor (m_rgbBackground),
QColor (Qt::black));
60void ViewProfileScale::paintHue ()
69 gradient.setColorAt (0.0000, Qt::red);
70 gradient.setColorAt (0.3333, Qt::green);
71 gradient.setColorAt (0.6666, Qt::blue);
72 gradient.setColorAt (1.0000, Qt::red);
86void ViewProfileScale::paintIntensity ()
88 paintOneSpectrum (
QColor (Qt::black),
QColor (Qt::white));
113void ViewProfileScale::paintSaturation ()
115 paintOneSpectrum (
QColor (Qt::white),
QColor (Qt::red));
118void ViewProfileScale::paintValue ()
120 paintOneSpectrum (
QColor (Qt::black),
QColor (Qt::red));
130 m_colorFilterMode = colorFilterMode;
@ COLOR_FILTER_MODE_FOREGROUND
@ COLOR_FILTER_MODE_VALUE
@ COLOR_FILTER_MODE_INTENSITY
@ COLOR_FILTER_MODE_SATURATION
const int INNER_RADIUS_MIN
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS) define ENGAUGE...
ViewProfileScale(int minimumWidth, QWidget *parent=0)
Single constructor.
void setBackgroundColor(QRgb rgbBackground)
Save the background color for foreground calculations.
virtual void paintEvent(QPaintEvent *)
Draw the gradient.
void setColorFilterMode(ColorFilterMode colorFilterMode)
Change the gradient type.