1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
3
* Copyright (C) 1997 Josef Wilgen
4
* Copyright (C) 2002 Uwe Rathmann
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the Qwt License, Version 1.0
8
*****************************************************************************/
12
#if QT_VERSION >= 0x040000
19
#include "qwt_scale_engine.h"
20
#include "qwt_scale_map.h"
21
#include "qwt_paint_buffer.h"
22
#include "qwt_painter.h"
23
#include "qwt_dial_needle.h"
26
class QwtDial::PrivateData
30
visibleBackground(true),
50
bool visibleBackground;
60
QwtDialScaleDraw *scaleDraw;
65
QwtDialNeedle *needle;
67
static double previousDir;
70
double QwtDial::PrivateData::previousDir = -1.0;
75
\param parent Parent dial widget
77
QwtDialScaleDraw::QwtDialScaleDraw(QwtDial *parent):
84
Set the pen width used for painting the scale
86
\param penWidth Pen width
87
\sa penWidth(), QwtDial::drawScale()
90
void QwtDialScaleDraw::setPenWidth(uint penWidth)
92
d_penWidth = penWidth;
96
\return Pen width used for painting the scale
97
\sa setPenWidth, QwtDial::drawScale()
99
uint QwtDialScaleDraw::penWidth() const
105
Call QwtDial::scaleLabel of the parent dial widget.
107
\param value Value to display
109
\sa QwtDial::scaleLabel
111
QwtText QwtDialScaleDraw::label(double value) const
113
if ( d_parent == NULL )
114
return QwtRoundScaleDraw::label(value);
116
return d_parent->scaleLabel(value);
121
\param parent Parent widget
123
Create a dial widget with no scale and no needle.
124
The default origin is 90.0 with no valid value. It accepts
125
mouse and keyboard inputs and has no step size. The default mode
126
is QwtDial::RotateNeedle.
129
QwtDial::QwtDial(QWidget* parent):
130
QwtAbstractSlider(Qt::Horizontal, parent)
135
#if QT_VERSION < 0x040000
138
\param parent Parent widget
139
\param name Object name
141
Create a dial widget with no scale and no needle.
142
The default origin is 90.0 with no valid value. It accepts
143
mouse and keyboard inputs and has no step size. The default mode
144
is QwtDial::RotateNeedle.
146
QwtDial::QwtDial(QWidget* parent, const char *name):
147
QwtAbstractSlider(Qt::Horizontal, parent)
154
void QwtDial::initDial()
156
d_data = new PrivateData;
158
#if QT_VERSION < 0x040000
159
setWFlags(Qt::WNoAutoErase);
162
#if QT_VERSION >= 0x040000
165
setFocusPolicy(TabFocus);
167
QPalette p = palette();
168
for ( int i = 0; i < QPalette::NColorGroups; i++ )
170
const QPalette::ColorGroup cg = (QPalette::ColorGroup)i;
172
// Base: background color of the circle inside the frame.
173
// Foreground: background color of the circle inside the scale
175
#if QT_VERSION < 0x040000
176
p.setColor(cg, QColorGroup::Foreground,
177
p.color(cg, QColorGroup::Base));
179
p.setColor(cg, QPalette::Foreground,
180
p.color(cg, QPalette::Base));
185
d_data->scaleDraw = new QwtDialScaleDraw(this);
186
d_data->scaleDraw->setRadius(0);
188
setScaleArc(0.0, 360.0); // scale as a full circle
189
setRange(0.0, 360.0, 1.0, 10); // degrees as deafult
199
Show/Hide the area outside of the frame
200
\param show Show if true, hide if false
202
\sa hasVisibleBackground(), setMask()
203
\warning When QwtDial is a toplevel widget the window
204
border might disappear too.
206
void QwtDial::showBackground(bool show)
208
if ( d_data->visibleBackground != show )
210
d_data->visibleBackground = show;
216
true when the area outside of the frame is visible
218
\sa showBackground(), setMask()
220
bool QwtDial::hasVisibleBackground() const
222
return d_data->visibleBackground;
226
Sets the frame shadow value from the frame style.
227
\param shadow Frame shadow
228
\sa setLineWidth(), QFrame::setFrameShadow()
230
void QwtDial::setFrameShadow(Shadow shadow)
232
if ( shadow != d_data->frameShadow )
234
d_data->frameShadow = shadow;
235
if ( lineWidth() > 0 )
242
/sa setFrameShadow(), lineWidth(), QFrame::frameShadow
244
QwtDial::Shadow QwtDial::frameShadow() const
246
return d_data->frameShadow;
252
\param lineWidth Line width
255
void QwtDial::setLineWidth(int lineWidth)
260
if ( d_data->lineWidth != lineWidth )
262
d_data->lineWidth = lineWidth;
268
\return Line width of the frame
269
\sa setLineWidth(), frameShadow(), lineWidth()
271
int QwtDial::lineWidth() const
273
return d_data->lineWidth;
277
\return bounding rect of the circle inside the frame
278
\sa setLineWidth(), scaleContentsRect(), boundingRect()
280
QRect QwtDial::contentsRect() const
282
const int lw = lineWidth();
284
QRect r = boundingRect();
287
r.setRect(r.x() + lw, r.y() + lw,
288
r.width() - 2 * lw, r.height() - 2 * lw);
294
\return bounding rect of the dial including the frame
295
\sa setLineWidth(), scaleContentsRect(), contentsRect()
297
QRect QwtDial::boundingRect() const
299
const int radius = qwtMin(width(), height()) / 2;
301
QRect r(0, 0, 2 * radius, 2 * radius);
302
r.moveCenter(rect().center());
307
\return rect inside the scale
308
\sa setLineWidth(), boundingRect(), contentsRect()
310
QRect QwtDial::scaleContentsRect() const
312
#if QT_VERSION < 0x040000
313
const QPen scalePen(colorGroup().text(), 0, Qt::NoPen);
315
const QPen scalePen(palette().text(), 0, Qt::NoPen);
319
if ( d_data->scaleDraw )
321
scaleDist = d_data->scaleDraw->extent(scalePen, font());
322
scaleDist++; // margin
325
const QRect rect = contentsRect();
326
return QRect(rect.x() + scaleDist, rect.y() + scaleDist,
327
rect.width() - 2 * scaleDist, rect.height() - 2 * scaleDist);
331
\brief Change the mode of the meter.
334
The value of the meter is indicated by the difference
335
between north of the scale and the direction of the needle.
336
In case of QwtDial::RotateNeedle north is pointing
337
to the origin() and the needle is rotating, in case of
338
QwtDial::RotateScale, the needle points to origin()
339
and the scale is rotating.
341
The default mode is QwtDial::RotateNeedle.
343
\sa mode(), setValue(), setOrigin()
345
void QwtDial::setMode(Mode mode)
347
if ( mode != d_data->mode )
355
\return mode of the dial.
357
The value of the dial is indicated by the difference
358
between the origin and the direction of the needle.
359
In case of QwtDial::RotateNeedle the scale arc is fixed
360
to the origin() and the needle is rotating, in case of
361
QwtDial::RotateScale, the needle points to origin()
362
and the scale is rotating.
364
The default mode is QwtDial::RotateNeedle.
366
\sa setMode(), origin(), setScaleArc(), value()
368
QwtDial::Mode QwtDial::mode() const
374
Sets whether it is possible to step the value from the highest value to
375
the lowest value and vice versa to on.
377
\param wrapping en/disables wrapping
379
\sa wrapping(), QwtDoubleRange::periodic()
380
\note The meaning of wrapping is like the wrapping property of QSpinBox,
381
but not like it is used in QDial.
383
void QwtDial::setWrapping(bool wrapping)
385
setPeriodic(wrapping);
389
wrapping() holds whether it is possible to step the value from the
390
highest value to the lowest value and vice versa.
392
\sa setWrapping(), QwtDoubleRange::setPeriodic()
393
\note The meaning of wrapping is like the wrapping property of QSpinBox,
394
but not like it is used in QDial.
396
bool QwtDial::wrapping() const
402
Resize the dial widget
403
\param e Resize event
405
void QwtDial::resizeEvent(QResizeEvent *e)
407
QWidget::resizeEvent(e);
409
if ( !hasVisibleBackground() )
417
void QwtDial::paintEvent(QPaintEvent *e)
419
const QRect &ur = e->rect();
422
#if QT_VERSION < 0x040000
423
QwtPaintBuffer paintBuffer(this, ur);
424
QPainter &painter = *paintBuffer.painter();
426
QPainter painter(this);
427
painter.setRenderHint(QPainter::Antialiasing, true);
431
drawContents(&painter);
439
drawFocusIndicator(&painter);
444
Draw a dotted round circle, if !isReadOnly()
446
\param painter Painter
448
void QwtDial::drawFocusIndicator(QPainter *painter) const
452
QRect focusRect = contentsRect();
454
const int margin = 2;
456
focusRect.x() + margin,
457
focusRect.y() + margin,
458
focusRect.width() - 2 * margin,
459
focusRect.height() - 2 * margin);
461
#if QT_VERSION < 0x040000
462
QColor color = colorGroup().color(QColorGroup::Base);
464
QColor color = palette().color(QPalette::Base);
468
const QColor gray(Qt::gray);
471
#if QT_VERSION < 0x040000
472
color.hsv(&h, &s, &v);
474
color.getHsv(&h, &s, &v);
476
color = (v > 128) ? gray.dark(120) : gray.light(120);
479
color = Qt::darkGray;
482
painter->setBrush(Qt::NoBrush);
483
painter->setPen(QPen(color, 0, Qt::DotLine));
484
painter->drawEllipse(focusRect);
490
Draw the frame around the dial
492
\param painter Painter
493
\sa lineWidth(), frameShadow()
495
void QwtDial::drawFrame(QPainter *painter)
497
const int lw = lineWidth();
498
const int off = (lw + 1) % 2;
500
QRect r = boundingRect();
501
r.setRect(r.x() + lw / 2 - off, r.y() + lw / 2 - off,
502
r.width() - lw + off + 1, r.height() - lw + off + 1);
503
#if QT_VERSION >= 0x040000
508
r.setWidth(r.width() - 2);
509
r.setHeight(r.height() - 2);
514
switch(d_data->frameShadow)
516
case QwtDial::Raised:
517
#if QT_VERSION < 0x040000
518
QwtPainter::drawRoundFrame(painter, r,
519
lw, colorGroup(), false);
521
QwtPainter::drawRoundFrame(painter, r,
522
lw, palette(), false);
525
case QwtDial::Sunken:
526
#if QT_VERSION < 0x040000
527
QwtPainter::drawRoundFrame(painter, r,
528
lw, colorGroup(), true);
530
QwtPainter::drawRoundFrame(painter, r,
531
lw, palette(), true);
537
painter->setPen(QPen(Qt::black, lw));
538
painter->setBrush(Qt::NoBrush);
539
painter->drawEllipse(r);
547
\brief Draw the contents inside the frame
549
QColorGroup::Background is the background color outside of the frame.
550
QColorGroup::Base is the background color inside the frame.
551
QColorGroup::Foreground is the background color inside the scale.
553
\param painter Painter
554
\sa boundingRect(), contentsRect(),
555
scaleContentsRect(), QWidget::setPalette
557
void QwtDial::drawContents(QPainter *painter) const
559
#if QT_VERSION < 0x040000
560
if ( backgroundMode() == Qt::NoBackground ||
561
colorGroup().brush(QColorGroup::Base) !=
562
colorGroup().brush(QColorGroup::Background) )
564
if ( testAttribute(Qt::WA_NoSystemBackground) ||
565
palette().brush(QPalette::Base) !=
566
palette().brush(QPalette::Background) )
570
const QRect br = boundingRect();
573
painter->setPen(Qt::NoPen);
575
#if QT_VERSION < 0x040000
576
painter->setBrush(colorGroup().brush(QColorGroup::Base));
578
painter->setBrush(palette().brush(QPalette::Base));
581
painter->drawEllipse(br);
586
const QRect insideScaleRect = scaleContentsRect();
587
#if QT_VERSION < 0x040000
588
if ( colorGroup().brush(QColorGroup::Foreground) !=
589
colorGroup().brush(QColorGroup::Base) )
591
if ( palette().brush(QPalette::Foreground) !=
592
palette().brush(QPalette::Base) )
596
painter->setPen(Qt::NoPen);
598
#if QT_VERSION < 0x040000
599
painter->setBrush(colorGroup().brush(QColorGroup::Foreground));
601
painter->setBrush(palette().brush(QPalette::Foreground));
604
painter->drawEllipse(insideScaleRect.x() - 1, insideScaleRect.y() - 1,
605
insideScaleRect.width(), insideScaleRect.height() );
610
const QPoint center = insideScaleRect.center();
611
const int radius = insideScaleRect.width() / 2;
614
drawScaleContents(painter, center, radius);
617
double direction = d_data->origin;
621
direction = d_data->origin + d_data->minScaleArc;
622
if ( maxValue() > minValue() && d_data->maxScaleArc > d_data->minScaleArc )
625
(value() - minValue()) / (maxValue() - minValue());
626
direction += ratio * (d_data->maxScaleArc - d_data->minScaleArc);
629
if ( direction >= 360.0 )
633
double origin = d_data->origin;
634
if ( mode() == RotateScale )
636
origin -= direction - d_data->origin;
637
direction = d_data->origin;
641
drawScale(painter, center, radius, origin, d_data->minScaleArc, d_data->maxScaleArc);
646
QPalette::ColorGroup cg;
648
cg = hasFocus() ? QPalette::Active : QPalette::Inactive;
650
cg = QPalette::Disabled;
653
drawNeedle(painter, center, radius, direction, cg);
661
\param painter Painter
662
\param center Center of the dial
663
\param radius Length for the needle
664
\param direction Direction of the needle in degrees, counter clockwise
667
void QwtDial::drawNeedle(QPainter *painter, const QPoint ¢er,
668
int radius, double direction, QPalette::ColorGroup cg) const
670
if ( d_data->needle )
672
direction = 360.0 - direction; // counter clockwise
673
d_data->needle->draw(painter, center, radius, direction, cg);
680
\param painter Painter
681
\param center Center of the dial
682
\param radius Radius of the scale
683
\param origin Origin of the scale
684
\param minArc Minimum of the arc
685
\param maxArc Minimum of the arc
687
\sa QwtAbstractScaleDraw::setAngleRange
689
void QwtDial::drawScale(QPainter *painter, const QPoint ¢er,
690
int radius, double origin, double minArc, double maxArc) const
692
if ( d_data->scaleDraw == NULL )
695
origin -= 270.0; // hardcoded origin of QwtScaleDraw
697
double angle = maxArc - minArc;
699
angle = fmod(angle, 360.0);
702
if ( minArc < -360.0 )
703
minArc = fmod(minArc, 360.0);
705
maxArc = minArc + angle;
706
if ( maxArc > 360.0 )
708
// QwtAbstractScaleDraw::setAngleRange accepts only values
709
// in the range [-360.0..360.0]
714
painter->setFont(font());
716
d_data->scaleDraw->setAngleRange(minArc, maxArc);
717
d_data->scaleDraw->setRadius(radius);
718
d_data->scaleDraw->moveCenter(center);
720
#if QT_VERSION < 0x040000
721
QColorGroup cg = colorGroup();
723
const QColor textColor = cg.color(QColorGroup::Text);
724
cg.setColor(QColorGroup::Foreground, textColor);
725
painter->setPen(QPen(textColor, d_data->scaleDraw->penWidth()));
727
d_data->scaleDraw->draw(painter, cg);
729
QPalette pal = palette();
731
const QColor textColor = pal.color(QPalette::Text);
732
pal.setColor(QPalette::Foreground, textColor); //ticks, backbone
734
painter->setPen(QPen(textColor, d_data->scaleDraw->penWidth()));
736
d_data->scaleDraw->draw(painter, pal);
740
void QwtDial::drawScaleContents(QPainter *,
741
const QPoint &, int) const
743
// empty default implementation
747
Set a needle for the dial
749
Qwt is missing a set of good looking needles.
750
Contributions are very welcome.
753
\warning The needle will be deleted, when a different needle is
756
void QwtDial::setNeedle(QwtDialNeedle *needle)
758
if ( needle != d_data->needle )
760
if ( d_data->needle )
761
delete d_data->needle;
763
d_data->needle = needle;
772
const QwtDialNeedle *QwtDial::needle() const
774
return d_data->needle;
781
QwtDialNeedle *QwtDial::needle()
783
return d_data->needle;
786
//! QwtDoubleRange update hook
787
void QwtDial::rangeChange()
793
Update the scale with the current attributes
796
void QwtDial::updateScale()
798
if ( d_data->scaleDraw )
800
QwtLinearScaleEngine scaleEngine;
802
const QwtScaleDiv scaleDiv = scaleEngine.divideScale(
803
minValue(), maxValue(),
804
d_data->maxMajIntv, d_data->maxMinIntv, d_data->scaleStep);
806
d_data->scaleDraw->setTransformation(scaleEngine.transformation());
807
d_data->scaleDraw->setScaleDiv(scaleDiv);
811
//! Return the scale draw
812
QwtDialScaleDraw *QwtDial::scaleDraw()
814
return d_data->scaleDraw;
817
//! Return the scale draw
818
const QwtDialScaleDraw *QwtDial::scaleDraw() const
820
return d_data->scaleDraw;
824
Set an individual scale draw
826
\param scaleDraw Scale draw
827
\warning The previous scale draw is deleted
829
void QwtDial::setScaleDraw(QwtDialScaleDraw *scaleDraw)
831
if ( scaleDraw != d_data->scaleDraw )
833
if ( d_data->scaleDraw )
834
delete d_data->scaleDraw;
836
d_data->scaleDraw = scaleDraw;
843
Change the intervals of the scale
844
\sa QwtAbstractScaleDraw::setScale
846
void QwtDial::setScale(int maxMajIntv, int maxMinIntv, double step)
848
d_data->maxMajIntv = maxMajIntv;
849
d_data->maxMinIntv = maxMinIntv;
850
d_data->scaleStep = step;
856
A wrapper method for accessing the scale draw.
859
No visible scale: setScaleDraw(NULL)
860
- options & ScaleBackbone\n
861
En/disable the backbone of the scale.
862
- options & ScaleTicks\n
863
En/disable the ticks of the scale.
864
- options & ScaleLabel\n
865
En/disable scale labels
867
\sa QwtAbstractScaleDraw::enableComponent
869
void QwtDial::setScaleOptions(int options)
874
QwtDialScaleDraw *sd = d_data->scaleDraw;
878
sd->enableComponent(QwtAbstractScaleDraw::Backbone,
879
options & ScaleBackbone);
881
sd->enableComponent(QwtAbstractScaleDraw::Ticks,
882
options & ScaleTicks);
884
sd->enableComponent(QwtAbstractScaleDraw::Labels,
885
options & ScaleLabel);
888
//! See: QwtAbstractScaleDraw::setTickLength, QwtDialScaleDraw::setPenWidth
889
void QwtDial::setScaleTicks(int minLen, int medLen,
890
int majLen, int penWidth)
892
QwtDialScaleDraw *sd = d_data->scaleDraw;
895
sd->setTickLength(QwtScaleDiv::MinorTick, minLen);
896
sd->setTickLength(QwtScaleDiv::MediumTick, medLen);
897
sd->setTickLength(QwtScaleDiv::MajorTick, majLen);
898
sd->setPenWidth(penWidth);
903
Find the label for a value
908
QwtText QwtDial::scaleLabel(double value) const
915
return QString::number(value);
918
//! \return Lower limit of the scale arc
919
double QwtDial::minScaleArc() const
921
return d_data->minScaleArc;
924
//! \return Upper limit of the scale arc
925
double QwtDial::maxScaleArc() const
927
return d_data->maxScaleArc;
931
\brief Change the origin
933
The origin is the angle where scale and needle is relative to.
935
\param origin New origin
938
void QwtDial::setOrigin(double origin)
940
d_data->origin = origin;
945
The origin is the angle where scale and needle is relative to.
947
\return Origin of the dial
950
double QwtDial::origin() const
952
return d_data->origin;
956
Change the arc of the scale
958
\param minArc Lower limit
959
\param maxArc Upper limit
961
void QwtDial::setScaleArc(double minArc, double maxArc)
963
if ( minArc != 360.0 && minArc != -360.0 )
964
minArc = fmod(minArc, 360.0);
965
if ( maxArc != 360.0 && maxArc != -360.0 )
966
maxArc = fmod(maxArc, 360.0);
968
d_data->minScaleArc = qwtMin(minArc, maxArc);
969
d_data->maxScaleArc = qwtMax(minArc, maxArc);
970
if ( d_data->maxScaleArc - d_data->minScaleArc > 360.0 )
971
d_data->maxScaleArc = d_data->minScaleArc + 360.0;
976
//! QwtDoubleRange update hook
977
void QwtDial::valueChange()
980
QwtAbstractSlider::valueChange();
986
QSize QwtDial::sizeHint() const
989
if ( d_data->scaleDraw )
990
sh = d_data->scaleDraw->extent( QPen(), font() );
992
const int d = 6 * sh + 2 * lineWidth();
994
return QSize( d, d );
998
\brief Return a minimum size hint
999
\warning The return value of QwtDial::minimumSizeHint() depends on the
1002
QSize QwtDial::minimumSizeHint() const
1005
if ( d_data->scaleDraw )
1006
sh = d_data->scaleDraw->extent(QPen(), font() );
1008
const int d = 3 * sh + 2 * lineWidth();
1010
return QSize( d, d );
1013
static double line2Radians(const QPoint &p1, const QPoint &p2)
1015
const QPoint p = p2 - p1;
1019
angle = ( p.y() <= 0 ) ? M_PI_2 : 3 * M_PI_2;
1022
angle = atan(double(-p.y()) / double(p.x()));
1028
return 360.0 - angle * 180.0 / M_PI;
1032
Find the value for a given position
1037
double QwtDial::getValue(const QPoint &pos)
1039
if ( d_data->maxScaleArc == d_data->minScaleArc || maxValue() == minValue() )
1042
double dir = line2Radians(rect().center(), pos) - d_data->origin;
1046
if ( mode() == RotateScale )
1049
// The position might be in the area that is outside the scale arc.
1050
// We need the range of the scale if it was a complete circle.
1052
const double completeCircle = 360.0 / (d_data->maxScaleArc - d_data->minScaleArc)
1053
* (maxValue() - minValue());
1055
double posValue = minValue() + completeCircle * dir / 360.0;
1057
if ( scrollMode() == ScrMouse )
1059
if ( d_data->previousDir >= 0.0 ) // valid direction
1061
// We have to find out whether the mouse is moving
1062
// clock or counter clockwise
1064
bool clockWise = false;
1066
const double angle = dir - d_data->previousDir;
1067
if ( (angle >= 0.0 && angle <= 180.0) || angle < -180.0 )
1072
if ( dir < d_data->previousDir && mouseOffset() > 0.0 )
1074
// We passed 360 -> 0
1075
setMouseOffset(mouseOffset() - completeCircle);
1080
if ( posValue - mouseOffset() > maxValue() )
1082
// We passed maxValue and the value will be set
1083
// to minValue. We have to adjust the mouseOffset.
1085
setMouseOffset(posValue - minValue());
1090
if ( posValue - mouseOffset() > maxValue() ||
1091
value() == maxValue() )
1093
// We fix the value at maxValue by adjusting
1094
// the mouse offset.
1096
setMouseOffset(posValue - maxValue());
1102
if ( dir > d_data->previousDir && mouseOffset() < 0.0 )
1104
// We passed 0 -> 360
1105
setMouseOffset(mouseOffset() + completeCircle);
1110
if ( posValue - mouseOffset() < minValue() )
1112
// We passed minValue and the value will be set
1113
// to maxValue. We have to adjust the mouseOffset.
1115
setMouseOffset(posValue - maxValue());
1120
if ( posValue - mouseOffset() < minValue() ||
1121
value() == minValue() )
1123
// We fix the value at minValue by adjusting
1124
// the mouse offset.
1126
setMouseOffset(posValue - minValue());
1131
d_data->previousDir = dir;
1138
\sa QwtAbstractSlider::getScrollMode
1140
void QwtDial::getScrollMode(const QPoint &p, int &scrollMode, int &direction)
1143
scrollMode = ScrNone;
1145
const QRegion region(contentsRect(), QRegion::Ellipse);
1146
if ( region.contains(p) && p != rect().center() )
1148
scrollMode = ScrMouse;
1149
d_data->previousDir = -1.0;
1156
- Key_Down, KeyLeft\n
1159
Decrement by pageSize()
1161
Set the value to minValue()
1163
- Key_Up, KeyRight\n
1166
Increment by pageSize()
1168
Set the value to maxValue()
1172
void QwtDial::keyPressEvent(QKeyEvent *e)
1183
double previous = prevValue();
1188
QwtDoubleRange::incValue(-1);
1190
#if QT_VERSION < 0x040000
1193
case Qt::Key_PageUp:
1195
QwtDoubleRange::incValue(-pageSize());
1198
setValue(minValue());
1203
QwtDoubleRange::incValue(1);
1205
#if QT_VERSION < 0x040000
1208
case Qt::Key_PageDown:
1210
QwtDoubleRange::incValue(pageSize());
1213
setValue(maxValue());
1219
if (value() != previous)
1220
emit sliderMoved(value());
1224
\brief Update the mask of the dial
1226
In case of "hasVisibleBackground() == false", the backgound is
1227
transparent by a mask.
1229
\sa showBackground(), hasVisibleBackground()
1231
void QwtDial::updateMask()
1233
if ( d_data->visibleBackground )
1236
setMask(QRegion(boundingRect(), QRegion::Ellipse));