1
.TH "QwtDial" 3 "24 May 2008" "Version 5.1.1" "Qwt User's Guide" \" -*- nroff -*-
9
Inherits \fBQwtAbstractSlider\fP.
11
Inherited by \fBQwtAnalogClock\fP, and \fBQwtCompass\fP.
13
.SH "Detailed Description"
15
\fBQwtDial\fP class provides a rounded range control.
17
\fBQwtDial\fP is intended as base class for dial widgets like speedometers, compass widgets, clocks ...
20
A dial contains a scale and a needle indicating the current value of the dial. Depending on Mode one of them is fixed and the other is rotating. If not \fBisReadOnly()\fP the dial can be rotated by dragging the mouse or using keyboard inputs (see \fBkeyPressEvent()\fP). A dial might be wrapping, what means a rotation below/above one limit continues on the other limit (f.e compass). The scale might cover any arc of the dial, its values are related to the \fBorigin()\fP of the dial.
22
Qwt is missing a set of good looking needles (\fBQwtDialNeedle\fP). Contributions are very welcome.
26
\fBQwtCompass\fP, \fBQwtAnalogClock\fP, \fBQwtDialNeedle\fP
31
The examples/dials example shows different types of dials.
36
Definition at line 67 of file qwt_dial.h.
41
.RI "enum \fBShadow\fP { \fBPlain\fP = QFrame::Plain, \fBRaised\fP = QFrame::Raised, \fBSunken\fP = QFrame::Sunken }"
44
.RI "enum \fBScaleOptions\fP { \fBScaleBackbone\fP = 1, \fBScaleTicks\fP = 2, \fBScaleLabel\fP = 4 }"
47
.RI "enum \fBMode\fP { \fBFixedColors\fP, \fBScaledColors\fP, \fBRotateNeedle\fP, \fBRotateScale\fP }"
50
.SS "Public Member Functions"
54
.RI "\fBQwtDial\fP (QWidget *parent=NULL)"
57
.RI "virtual \fB~QwtDial\fP ()"
60
.RI "void \fBsetFrameShadow\fP (\fBShadow\fP)"
63
.RI "\fBShadow\fP \fBframeShadow\fP () const"
66
.RI "bool \fBhasVisibleBackground\fP () const"
69
.RI "void \fBshowBackground\fP (bool)"
72
.RI "void \fBsetLineWidth\fP (int)"
75
.RI "int \fBlineWidth\fP () const"
78
.RI "void \fBsetMode\fP (\fBMode\fP)"
81
.RI "\fBMode\fP \fBmode\fP () const"
84
.RI "virtual void \fBsetWrapping\fP (bool)"
87
.RI "bool \fBwrapping\fP () const"
90
.RI "virtual void \fBsetScale\fP (int maxMajIntv, int maxMinIntv, double step=0.0)"
93
.RI "void \fBsetScaleArc\fP (double min, double max)"
96
.RI "void \fBsetScaleOptions\fP (int)"
99
.RI "void \fBsetScaleTicks\fP (int minLen, int medLen, int majLen, int penWidth=1)"
102
.RI "double \fBminScaleArc\fP () const"
105
.RI "double \fBmaxScaleArc\fP () const"
108
.RI "virtual void \fBsetOrigin\fP (double)"
111
.RI "double \fBorigin\fP () const"
114
.RI "virtual void \fBsetNeedle\fP (\fBQwtDialNeedle\fP *)"
117
.RI "const \fBQwtDialNeedle\fP * \fBneedle\fP () const"
120
.RI "\fBQwtDialNeedle\fP * \fBneedle\fP ()"
123
.RI "QRect \fBboundingRect\fP () const"
126
.RI "QRect \fBcontentsRect\fP () const"
129
.RI "virtual QRect \fBscaleContentsRect\fP () const"
132
.RI "virtual QSize \fBsizeHint\fP () const"
135
.RI "virtual QSize \fBminimumSizeHint\fP () const"
138
.RI "virtual void \fBsetScaleDraw\fP (\fBQwtDialScaleDraw\fP *)"
141
.RI "\fBQwtDialScaleDraw\fP * \fBscaleDraw\fP ()"
144
.RI "const \fBQwtDialScaleDraw\fP * \fBscaleDraw\fP () const"
147
.SS "Protected Member Functions"
151
.RI "virtual void \fBpaintEvent\fP (QPaintEvent *)"
154
.RI "virtual void \fBresizeEvent\fP (QResizeEvent *)"
157
.RI "virtual void \fBkeyPressEvent\fP (QKeyEvent *)"
160
.RI "virtual void \fBupdateMask\fP ()"
163
.RI "virtual void \fBdrawFrame\fP (QPainter *p)"
166
.RI "virtual void \fBdrawContents\fP (QPainter *) const"
169
.RI "virtual void \fBdrawFocusIndicator\fP (QPainter *) const"
172
.RI "virtual void \fBdrawScale\fP (QPainter *, const QPoint ¢er, int radius, double origin, double arcMin, double arcMax) const"
175
.RI "virtual void \fBdrawScaleContents\fP (QPainter *painter, const QPoint ¢er, int radius) const"
178
.RI "virtual void \fBdrawNeedle\fP (QPainter *, const QPoint &, int radius, double direction, QPalette::ColorGroup) const"
181
.RI "virtual \fBQwtText\fP \fBscaleLabel\fP (double) const"
184
.RI "void \fBupdateScale\fP ()"
187
.RI "virtual void \fBrangeChange\fP ()"
190
.RI "virtual void \fBvalueChange\fP ()"
193
.RI "virtual double \fBgetValue\fP (const QPoint &)"
196
.RI "virtual void \fBgetScrollMode\fP (const QPoint &, int &scrollMode, int &direction)"
203
.RI "class \fBQwtDialScaleDraw\fP"
206
.SH "Member Enumeration Documentation"
208
.SS "enum \fBQwtDial::Shadow\fP"
212
Unfortunately it is not possible to use QFrame::Shadow as a property of a widget that is not derived from QFrame. The following enum is made for the designer only. It is safe to use QFrame::Shadow instead.
214
Definition at line 92 of file qwt_dial.h.
215
.SS "enum \fBQwtDial::ScaleOptions\fP"
217
see \fBQwtDial::setScaleOptions\fP
219
Definition at line 100 of file qwt_dial.h.
220
.SS "enum \fBQwtDial::Mode\fP"
222
In case of RotateNeedle the needle is rotating, in case of RotateScale, the needle points to \fBorigin()\fP and the scale is rotating.
224
Definition at line 112 of file qwt_dial.h.
225
.SH "Constructor & Destructor Documentation"
227
.SS "QwtDial::QwtDial (QWidget * parent = \fCNULL\fP)\fC [explicit]\fP"
233
\fIparent\fP Parent widget
236
Create a dial widget with no scale and no needle. The default origin is 90.0 with no valid value. It accepts mouse and keyboard inputs and has no step size. The default mode is QwtDial::RotateNeedle.
238
Definition at line 143 of file qwt_dial.cpp.
239
.SS "QwtDial::~QwtDial ()\fC [virtual]\fP"
243
Definition at line 207 of file qwt_dial.cpp.
244
.SH "Member Function Documentation"
246
.SS "void QwtDial::setFrameShadow (\fBShadow\fP shadow)"
248
Sets the frame shadow value from the frame style.
252
\fIshadow\fP Frame shadow
257
\fBsetLineWidth()\fP, QFrame::setFrameShadow()
262
Definition at line 244 of file qwt_dial.cpp.
264
References lineWidth().
265
.SS "\fBQwtDial::Shadow\fP QwtDial::frameShadow () const"
269
Frame shadow /sa \fBsetFrameShadow()\fP, \fBlineWidth()\fP, QFrame::frameShadow
274
Definition at line 258 of file qwt_dial.cpp.
275
.SS "bool QwtDial::hasVisibleBackground () const"
277
true when the area outside of the frame is visible
281
\fBshowBackground()\fP, setMask()
286
Definition at line 234 of file qwt_dial.cpp.
288
Referenced by resizeEvent().
289
.SS "void QwtDial::showBackground (bool show)"
291
Show/Hide the area outside of the frame
295
\fIshow\fP Show if true, hide if false
300
\fBhasVisibleBackground()\fP, setMask()
305
When \fBQwtDial\fP is a toplevel widget the window border might disappear too.
310
Definition at line 220 of file qwt_dial.cpp.
312
References updateMask().
313
.SS "void QwtDial::setLineWidth (int lineWidth)"
319
\fIlineWidth\fP Line width
324
\fBsetFrameShadow()\fP
329
Definition at line 269 of file qwt_dial.cpp.
330
.SS "int QwtDial::lineWidth () const"
334
Line width of the frame
339
\fBsetLineWidth()\fP, \fBframeShadow()\fP, \fBlineWidth()\fP
344
Definition at line 285 of file qwt_dial.cpp.
346
Referenced by contentsRect(), drawFrame(), minimumSizeHint(), setFrameShadow(), and sizeHint().
347
.SS "void QwtDial::setMode (\fBMode\fP mode)"
349
Change the mode of the meter.
356
The value of the meter is indicated by the difference between north of the scale and the direction of the needle. In case of QwtDial::RotateNeedle north is pointing to the \fBorigin()\fP and the needle is rotating, in case of QwtDial::RotateScale, the needle points to \fBorigin()\fP and the scale is rotating.
358
The default mode is QwtDial::RotateNeedle.
362
\fBmode()\fP, \fBsetValue()\fP, \fBsetOrigin()\fP
367
Definition at line 359 of file qwt_dial.cpp.
368
.SS "\fBQwtDial::Mode\fP QwtDial::mode () const"
375
The value of the dial is indicated by the difference between the origin and the direction of the needle. In case of QwtDial::RotateNeedle the scale arc is fixed to the \fBorigin()\fP and the needle is rotating, in case of QwtDial::RotateScale, the needle points to \fBorigin()\fP and the scale is rotating.
377
The default mode is QwtDial::RotateNeedle.
381
\fBsetMode()\fP, \fBorigin()\fP, \fBsetScaleArc()\fP, \fBvalue()\fP
386
Definition at line 382 of file qwt_dial.cpp.
388
Referenced by drawContents(), QwtCompass::drawScaleContents(), getValue(), and QwtCompass::keyPressEvent().
389
.SS "void QwtDial::setWrapping (bool wrapping)\fC [virtual]\fP"
391
Sets whether it is possible to step the value from the highest value to the lowest value and vice versa to on.
395
\fIwrapping\fP en/disables wrapping
400
\fBwrapping()\fP, \fBQwtDoubleRange::periodic()\fP
405
The meaning of wrapping is like the wrapping property of QSpinBox, but not like it is used in QDial.
410
Definition at line 397 of file qwt_dial.cpp.
412
References QwtDoubleRange::setPeriodic().
413
.SS "bool QwtDial::wrapping () const"
415
\fBwrapping()\fP holds whether it is possible to step the value from the highest value to the lowest value and vice versa.
419
\fBsetWrapping()\fP, \fBQwtDoubleRange::setPeriodic()\fP
424
The meaning of wrapping is like the wrapping property of QSpinBox, but not like it is used in QDial.
429
Definition at line 410 of file qwt_dial.cpp.
431
References QwtDoubleRange::periodic().
433
Referenced by getValue().
434
.SS "void QwtDial::setScale (int maxMajIntv, int maxMinIntv, double step = \fC0.0\fP)\fC [virtual]\fP"
436
Change the intervals of the scale
440
QwtAbstractScaleDraw::setScale
445
Definition at line 861 of file qwt_dial.cpp.
447
References updateScale().
448
.SS "void QwtDial::setScaleArc (double minArc, double maxArc)"
450
Change the arc of the scale
454
\fIminArc\fP Lower limit
456
\fImaxArc\fP Upper limit
461
Definition at line 976 of file qwt_dial.cpp.
462
.SS "void QwtDial::setScaleOptions (int options)"
464
A wrapper method for accessing the scale draw.
469
No visible scale: setScaleDraw(NULL)
471
options & ScaleBackbone
473
En/disable the backbone of the scale.
477
En/disable the ticks of the scale.
481
En/disable scale labels
486
\fBQwtAbstractScaleDraw::enableComponent\fP
491
Definition at line 884 of file qwt_dial.cpp.
493
References QwtAbstractScaleDraw::enableComponent(), and setScaleDraw().
494
.SS "void QwtDial::setScaleTicks (int minLen, int medLen, int majLen, int penWidth = \fC1\fP)"
496
See: \fBQwtAbstractScaleDraw::setTickLength\fP, \fBQwtDialScaleDraw::setPenWidth\fP.
498
Definition at line 904 of file qwt_dial.cpp.
500
References QwtDialScaleDraw::setPenWidth(), and QwtAbstractScaleDraw::setTickLength().
501
.SS "double QwtDial::minScaleArc () const"
505
Lower limit of the scale arc
510
Definition at line 934 of file qwt_dial.cpp.
511
.SS "double QwtDial::maxScaleArc () const"
515
Upper limit of the scale arc
520
Definition at line 940 of file qwt_dial.cpp.
521
.SS "void QwtDial::setOrigin (double origin)\fC [virtual]\fP"
525
The origin is the angle where scale and needle is relative to.
529
\fIorigin\fP New origin
539
Definition at line 953 of file qwt_dial.cpp.
540
.SS "double QwtDial::origin () const"
542
The origin is the angle where scale and needle is relative to.
556
Definition at line 965 of file qwt_dial.cpp.
558
Referenced by drawContents(), QwtAnalogClock::drawNeedle(), QwtCompass::drawScaleContents(), and QwtCompass::keyPressEvent().
559
.SS "void QwtDial::setNeedle (\fBQwtDialNeedle\fP * needle)\fC [virtual]\fP"
561
Set a needle for the dial
563
Qwt is missing a set of good looking needles. Contributions are very welcome.
572
The needle will be deleted, when a different needle is set or in \fB~QwtDial()\fP
577
Definition at line 771 of file qwt_dial.cpp.
580
.SS "const \fBQwtDialNeedle\fP * QwtDial::needle () const"
594
Definition at line 787 of file qwt_dial.cpp.
596
Referenced by QwtAnalogClock::drawHand(), QwtAnalogClock::setHand(), and setNeedle().
597
.SS "\fBQwtDialNeedle\fP * QwtDial::needle ()"
611
Definition at line 796 of file qwt_dial.cpp.
612
.SS "QRect QwtDial::boundingRect () const"
616
bounding rect of the dial including the frame
621
\fBsetLineWidth()\fP, \fBscaleContentsRect()\fP, \fBcontentsRect()\fP
626
Definition at line 311 of file qwt_dial.cpp.
628
Referenced by contentsRect(), drawContents(), drawFrame(), and updateMask().
629
.SS "QRect QwtDial::contentsRect () const"
633
bounding rect of the circle inside the frame
638
\fBsetLineWidth()\fP, \fBscaleContentsRect()\fP, \fBboundingRect()\fP
643
Definition at line 294 of file qwt_dial.cpp.
645
References boundingRect(), and lineWidth().
647
Referenced by drawFocusIndicator(), getScrollMode(), and scaleContentsRect().
648
.SS "QRect QwtDial::scaleContentsRect () const\fC [virtual]\fP"
652
rect inside the scale
657
\fBsetLineWidth()\fP, \fBboundingRect()\fP, \fBcontentsRect()\fP
662
Definition at line 324 of file qwt_dial.cpp.
664
References contentsRect().
666
Referenced by drawContents().
667
.SS "QSize QwtDial::sizeHint () const\fC [virtual]\fP"
676
Definition at line 1001 of file qwt_dial.cpp.
678
References lineWidth().
679
.SS "QSize QwtDial::minimumSizeHint () const\fC [virtual]\fP"
681
Return a minimum size hint.
685
The return value of \fBQwtDial::minimumSizeHint()\fP depends on the font and the scale.
690
Definition at line 1017 of file qwt_dial.cpp.
692
References lineWidth().
693
.SS "void QwtDial::setScaleDraw (\fBQwtDialScaleDraw\fP * scaleDraw)\fC [virtual]\fP"
695
Set an individual scale draw
699
\fIscaleDraw\fP Scale draw
704
The previous scale draw is deleted
709
Definition at line 844 of file qwt_dial.cpp.
711
References scaleDraw(), and updateScale().
713
Referenced by setScaleOptions().
714
.SS "\fBQwtDialScaleDraw\fP * QwtDial::scaleDraw ()"
716
Return the scale draw.
718
Definition at line 827 of file qwt_dial.cpp.
720
Referenced by setScaleDraw().
721
.SS "const \fBQwtDialScaleDraw\fP * QwtDial::scaleDraw () const"
723
Return the scale draw.
725
Definition at line 833 of file qwt_dial.cpp.
726
.SS "void QwtDial::paintEvent (QPaintEvent * e)\fC [protected, virtual]\fP"
737
Definition at line 431 of file qwt_dial.cpp.
739
References drawContents(), drawFocusIndicator(), and drawFrame().
740
.SS "void QwtDial::resizeEvent (QResizeEvent * e)\fC [protected, virtual]\fP"
742
Resize the dial widget
751
Definition at line 419 of file qwt_dial.cpp.
753
References hasVisibleBackground(), and updateMask().
754
.SS "void QwtDial::keyPressEvent (QKeyEvent * e)\fC [protected, virtual]\fP"
765
Decrement by \fBpageSize()\fP
769
Set the value to \fBminValue()\fP
779
Increment by \fBpageSize()\fP
783
Set the value to \fBmaxValue()\fP
793
Reimplemented from \fBQwtAbstractSlider\fP.
795
Reimplemented in \fBQwtCompass\fP.
797
Definition at line 1187 of file qwt_dial.cpp.
799
References QwtDoubleRange::incValue(), QwtAbstractSlider::isReadOnly(), QwtAbstractSlider::isValid(), QwtDoubleRange::maxValue(), QwtDoubleRange::minValue(), QwtDoubleRange::pageSize(), QwtDoubleRange::prevValue(), QwtAbstractSlider::setValue(), QwtAbstractSlider::sliderMoved(), and QwtDoubleRange::value().
801
Referenced by QwtCompass::keyPressEvent().
802
.SS "void QwtDial::updateMask ()\fC [protected, virtual]\fP"
804
Update the mask of the dial.
806
In case of 'hasVisibleBackground() == false', the backgound is transparent by a mask.
810
\fBshowBackground()\fP, \fBhasVisibleBackground()\fP
815
Definition at line 1246 of file qwt_dial.cpp.
817
References boundingRect().
819
Referenced by resizeEvent(), and showBackground().
820
.SS "void QwtDial::drawFrame (QPainter * painter)\fC [protected, virtual]\fP"
822
Draw the frame around the dial
826
\fIpainter\fP Painter
831
\fBlineWidth()\fP, \fBframeShadow()\fP
836
Definition at line 510 of file qwt_dial.cpp.
838
References boundingRect(), QwtPainter::drawRoundFrame(), and lineWidth().
840
Referenced by paintEvent().
841
.SS "void QwtDial::drawContents (QPainter * painter) const\fC [protected, virtual]\fP"
843
Draw the contents inside the frame.
845
QColorGroup::Background is the background color outside of the frame. QColorGroup::Base is the background color inside the frame. QColorGroup::Foreground is the background color inside the scale.
849
\fIpainter\fP Painter
854
\fBboundingRect()\fP, \fBcontentsRect()\fP, \fBscaleContentsRect()\fP, QWidget::setPalette
859
Definition at line 572 of file qwt_dial.cpp.
861
References boundingRect(), drawNeedle(), drawScale(), drawScaleContents(), QwtAbstractSlider::isValid(), QwtDoubleRange::maxValue(), QwtDoubleRange::minValue(), mode(), origin(), scaleContentsRect(), and QwtDoubleRange::value().
863
Referenced by paintEvent().
864
.SS "void QwtDial::drawFocusIndicator (QPainter * painter) const\fC [protected, virtual]\fP"
866
Draw a dotted round circle, if !isReadOnly()
870
\fIpainter\fP Painter
875
Definition at line 463 of file qwt_dial.cpp.
877
References contentsRect(), and QwtAbstractSlider::isReadOnly().
879
Referenced by paintEvent().
880
.SS "void QwtDial::drawScale (QPainter * painter, const QPoint & center, int radius, double origin, double minArc, double maxArc) const\fC [protected, virtual]\fP"
886
\fIpainter\fP Painter
888
\fIcenter\fP Center of the dial
890
\fIradius\fP Radius of the scale
892
\fIorigin\fP Origin of the scale
894
\fIminArc\fP Minimum of the arc
896
\fImaxArc\fP Minimum of the arc
901
QwtAbstractScaleDraw::setAngleRange
906
Definition at line 704 of file qwt_dial.cpp.
908
Referenced by drawContents().
909
.SS "void QwtDial::drawScaleContents (QPainter * painter, const QPoint & center, int radius) const\fC [protected, virtual]\fP"
911
Draw the contents inside the scale
917
\fIpainter\fP Painter
919
\fIcenter\fP Center of the contents circle
921
\fIradius\fP Radius of the contents circle
926
Reimplemented in \fBQwtCompass\fP.
928
Definition at line 755 of file qwt_dial.cpp.
930
Referenced by drawContents().
931
.SS "void QwtDial::drawNeedle (QPainter * painter, const QPoint & center, int radius, double direction, QPalette::ColorGroup cg) const\fC [protected, virtual]\fP"
937
\fIpainter\fP Painter
939
\fIcenter\fP Center of the dial
941
\fIradius\fP Length for the needle
943
\fIdirection\fP Direction of the needle in degrees, counter clockwise
950
Reimplemented in \fBQwtAnalogClock\fP.
952
Definition at line 682 of file qwt_dial.cpp.
954
Referenced by drawContents().
955
.SS "\fBQwtText\fP QwtDial::scaleLabel (double value) const\fC [protected, virtual]\fP"
957
Find the label for a value
971
Reimplemented in \fBQwtAnalogClock\fP, and \fBQwtCompass\fP.
973
Definition at line 923 of file qwt_dial.cpp.
975
Referenced by QwtDialScaleDraw::label().
976
.SS "void QwtDial::updateScale ()\fC [protected]\fP"
978
Update the scale with the current attributes
987
Definition at line 811 of file qwt_dial.cpp.
989
References QwtLinearScaleEngine::divideScale(), QwtDoubleRange::maxValue(), QwtDoubleRange::minValue(), and QwtLinearScaleEngine::transformation().
991
Referenced by rangeChange(), setScale(), and setScaleDraw().
992
.SS "void QwtDial::rangeChange ()\fC [protected, virtual]\fP"
994
\fBQwtDoubleRange\fP update hook.
996
Reimplemented from \fBQwtDoubleRange\fP.
998
Definition at line 802 of file qwt_dial.cpp.
1000
References updateScale().
1001
.SS "void QwtDial::valueChange ()\fC [protected, virtual]\fP"
1003
\fBQwtDoubleRange\fP update hook.
1005
Reimplemented from \fBQwtAbstractSlider\fP.
1007
Definition at line 992 of file qwt_dial.cpp.
1009
References QwtAbstractSlider::valueChange().
1010
.SS "double QwtDial::getValue (const QPoint & pos)\fC [protected, virtual]\fP"
1012
Find the value for a given position
1026
Implements \fBQwtAbstractSlider\fP.
1028
Definition at line 1052 of file qwt_dial.cpp.
1030
References QwtDoubleRange::maxValue(), QwtDoubleRange::minValue(), mode(), QwtAbstractSlider::mouseOffset(), QwtAbstractSlider::scrollMode(), QwtAbstractSlider::setMouseOffset(), QwtDoubleRange::value(), and wrapping().
1031
.SS "void QwtDial::getScrollMode (const QPoint & p, int & scrollMode, int & direction)\fC [protected, virtual]\fP"
1035
\fBQwtAbstractSlider::getScrollMode\fP
1040
Implements \fBQwtAbstractSlider\fP.
1042
Definition at line 1155 of file qwt_dial.cpp.
1044
References contentsRect().
1048
Generated automatically by Doxygen for Qwt User's Guide from the source code.