1
.TH "QwtDial" 3 "26 Feb 2007" "Version 5.0.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 { \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::Mode\fP"
210
In case of RotateNeedle the needle is rotating, in case of RotateScale, the needle points to \fBorigin()\fP and the scale is rotating.
212
Definition at line 112 of file qwt_dial.h.
213
.SS "enum \fBQwtDial::ScaleOptions\fP"
215
see \fBQwtDial::setScaleOptions\fP
217
Definition at line 100 of file qwt_dial.h.
218
.SS "enum \fBQwtDial::Shadow\fP"
222
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.
224
Definition at line 92 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 "QRect QwtDial::boundingRect () const"
250
bounding rect of the dial including the frame
255
\fBsetLineWidth()\fP, \fBscaleContentsRect()\fP, \fBcontentsRect()\fP
260
Definition at line 311 of file qwt_dial.cpp.
262
Referenced by contentsRect(), drawContents(), drawFrame(), and updateMask().
263
.SS "QRect QwtDial::contentsRect () const"
267
bounding rect of the circle inside the frame
272
\fBsetLineWidth()\fP, \fBscaleContentsRect()\fP, \fBboundingRect()\fP
277
Definition at line 294 of file qwt_dial.cpp.
279
References boundingRect(), and lineWidth().
281
Referenced by drawFocusIndicator(), getScrollMode(), and scaleContentsRect().
282
.SS "void QwtDial::drawContents (QPainter * painter) const\fC [protected, virtual]\fP"
284
Draw the contents inside the frame.
286
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.
290
\fIpainter\fP Painter
295
\fBboundingRect()\fP, \fBcontentsRect()\fP, \fBscaleContentsRect()\fP, QWidget::setPalette
300
Definition at line 572 of file qwt_dial.cpp.
302
References boundingRect(), drawNeedle(), drawScale(), drawScaleContents(), QwtAbstractSlider::isValid(), QwtDoubleRange::maxValue(), QwtDoubleRange::minValue(), mode(), origin(), scaleContentsRect(), and QwtDoubleRange::value().
304
Referenced by paintEvent().
305
.SS "void QwtDial::drawFocusIndicator (QPainter * painter) const\fC [protected, virtual]\fP"
307
Draw a dotted round circle, if !isReadOnly()
311
\fIpainter\fP Painter
316
Definition at line 463 of file qwt_dial.cpp.
318
References contentsRect(), and QwtAbstractSlider::isReadOnly().
320
Referenced by paintEvent().
321
.SS "void QwtDial::drawFrame (QPainter * painter)\fC [protected, virtual]\fP"
323
Draw the frame around the dial
327
\fIpainter\fP Painter
332
\fBlineWidth()\fP, \fBframeShadow()\fP
337
Definition at line 510 of file qwt_dial.cpp.
339
References boundingRect(), QwtPainter::drawRoundFrame(), and lineWidth().
341
Referenced by paintEvent().
342
.SS "void QwtDial::drawNeedle (QPainter * painter, const QPoint & center, int radius, double direction, QPalette::ColorGroup cg) const\fC [protected, virtual]\fP"
348
\fIpainter\fP Painter
350
\fIcenter\fP Center of the dial
352
\fIradius\fP Length for the needle
354
\fIdirection\fP Direction of the needle in degrees, counter clockwise
361
Reimplemented in \fBQwtAnalogClock\fP.
363
Definition at line 682 of file qwt_dial.cpp.
365
Referenced by drawContents().
366
.SS "void QwtDial::drawScale (QPainter * painter, const QPoint & center, int radius, double origin, double minArc, double maxArc) const\fC [protected, virtual]\fP"
372
\fIpainter\fP Painter
374
\fIcenter\fP Center of the dial
376
\fIradius\fP Radius of the scale
378
\fIorigin\fP Origin of the scale
380
\fIminArc\fP Minimum of the arc
382
\fImaxArc\fP Minimum of the arc
387
QwtAbstractScaleDraw::setAngleRange
392
Definition at line 704 of file qwt_dial.cpp.
394
Referenced by drawContents().
395
.SS "void QwtDial::drawScaleContents (QPainter * painter, const QPoint & center, int radius) const\fC [protected, virtual]\fP"
397
Draw the contents inside the scale
403
\fIpainter\fP Painter
405
\fIcenter\fP Center of the contents circle
407
\fIradius\fP Radius of the contents circle
412
Reimplemented in \fBQwtCompass\fP.
414
Definition at line 755 of file qwt_dial.cpp.
416
Referenced by drawContents().
417
.SS "\fBQwtDial::Shadow\fP QwtDial::frameShadow () const"
421
Frame shadow /sa \fBsetFrameShadow()\fP, \fBlineWidth()\fP, QFrame::frameShadow
426
Definition at line 258 of file qwt_dial.cpp.
427
.SS "void QwtDial::getScrollMode (const QPoint & p, int & scrollMode, int & direction)\fC [protected, virtual]\fP"
431
\fBQwtAbstractSlider::getScrollMode\fP
436
Implements \fBQwtAbstractSlider\fP.
438
Definition at line 1155 of file qwt_dial.cpp.
440
References contentsRect().
441
.SS "double QwtDial::getValue (const QPoint & pos)\fC [protected, virtual]\fP"
443
Find the value for a given position
457
Implements \fBQwtAbstractSlider\fP.
459
Definition at line 1052 of file qwt_dial.cpp.
461
References QwtDoubleRange::maxValue(), QwtDoubleRange::minValue(), mode(), QwtAbstractSlider::mouseOffset(), QwtAbstractSlider::scrollMode(), QwtAbstractSlider::setMouseOffset(), QwtDoubleRange::value(), and wrapping().
462
.SS "bool QwtDial::hasVisibleBackground () const"
464
true when the area outside of the frame is visible
468
\fBshowBackground()\fP, setMask()
473
Definition at line 234 of file qwt_dial.cpp.
475
Referenced by resizeEvent().
476
.SS "void QwtDial::keyPressEvent (QKeyEvent * e)\fC [protected, virtual]\fP"
487
Decrement by \fBpageSize()\fP
491
Set the value to \fBminValue()\fP
501
Increment by \fBpageSize()\fP
505
Set the value to \fBmaxValue()\fP
515
Reimplemented from \fBQwtAbstractSlider\fP.
517
Reimplemented in \fBQwtCompass\fP.
519
Definition at line 1187 of file qwt_dial.cpp.
521
References QwtDoubleRange::incValue(), QwtAbstractSlider::isReadOnly(), QwtAbstractSlider::isValid(), QwtDoubleRange::maxValue(), QwtDoubleRange::minValue(), QwtDoubleRange::pageSize(), QwtDoubleRange::prevValue(), and QwtAbstractSlider::setValue().
522
.SS "int QwtDial::lineWidth () const"
526
Line width of the frame
531
\fBsetLineWidth()\fP, \fBframeShadow()\fP, \fBlineWidth()\fP
536
Definition at line 285 of file qwt_dial.cpp.
538
Referenced by contentsRect(), drawFrame(), minimumSizeHint(), setFrameShadow(), and sizeHint().
539
.SS "double QwtDial::maxScaleArc () const"
543
Upper limit of the scale arc
548
Definition at line 940 of file qwt_dial.cpp.
549
.SS "QSize QwtDial::minimumSizeHint () const\fC [virtual]\fP"
551
Return a minimum size hint.
555
The return value of \fBQwtDial::minimumSizeHint()\fP depends on the font and the scale.
560
Definition at line 1017 of file qwt_dial.cpp.
562
References lineWidth().
563
.SS "double QwtDial::minScaleArc () const"
567
Lower limit of the scale arc
572
Definition at line 934 of file qwt_dial.cpp.
573
.SS "\fBQwtDial::Mode\fP QwtDial::mode () const"
580
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.
582
The default mode is QwtDial::RotateNeedle.
586
\fBsetMode()\fP, \fBorigin()\fP, \fBsetScaleArc()\fP, \fBvalue()\fP
591
Definition at line 382 of file qwt_dial.cpp.
593
Referenced by drawContents(), QwtCompass::drawScaleContents(), and getValue().
594
.SS "\fBQwtDialNeedle\fP * QwtDial::needle ()"
608
Definition at line 796 of file qwt_dial.cpp.
609
.SS "const \fBQwtDialNeedle\fP * QwtDial::needle () const"
623
Definition at line 787 of file qwt_dial.cpp.
625
Referenced by QwtAnalogClock::drawHand(), QwtAnalogClock::setHand(), and setNeedle().
626
.SS "double QwtDial::origin () const"
628
The origin is the angle where scale and needle is relative to.
642
Definition at line 965 of file qwt_dial.cpp.
644
Referenced by drawContents(), QwtAnalogClock::drawNeedle(), and QwtCompass::drawScaleContents().
645
.SS "void QwtDial::paintEvent (QPaintEvent * e)\fC [protected, virtual]\fP"
656
Definition at line 431 of file qwt_dial.cpp.
658
References drawContents(), drawFocusIndicator(), and drawFrame().
659
.SS "void QwtDial::rangeChange ()\fC [protected, virtual]\fP"
661
\fBQwtDoubleRange\fP update hook.
663
Reimplemented from \fBQwtDoubleRange\fP.
665
Definition at line 802 of file qwt_dial.cpp.
667
References updateScale().
668
.SS "void QwtDial::resizeEvent (QResizeEvent * e)\fC [protected, virtual]\fP"
670
Resize the dial widget
679
Definition at line 419 of file qwt_dial.cpp.
681
References hasVisibleBackground(), and updateMask().
682
.SS "QRect QwtDial::scaleContentsRect () const\fC [virtual]\fP"
686
rect inside the scale
691
\fBsetLineWidth()\fP, \fBboundingRect()\fP, \fBcontentsRect()\fP
696
Definition at line 324 of file qwt_dial.cpp.
698
References contentsRect().
700
Referenced by drawContents().
701
.SS "const \fBQwtDialScaleDraw\fP * QwtDial::scaleDraw () const"
703
Return the scale draw.
705
Definition at line 833 of file qwt_dial.cpp.
706
.SS "\fBQwtDialScaleDraw\fP * QwtDial::scaleDraw ()"
708
Return the scale draw.
710
Definition at line 827 of file qwt_dial.cpp.
712
Referenced by setScaleDraw().
713
.SS "\fBQwtText\fP QwtDial::scaleLabel (double value) const\fC [protected, virtual]\fP"
715
Find the label for a value
729
Reimplemented in \fBQwtAnalogClock\fP, and \fBQwtCompass\fP.
731
Definition at line 923 of file qwt_dial.cpp.
733
Referenced by QwtDialScaleDraw::label().
734
.SS "void QwtDial::setFrameShadow (\fBShadow\fP shadow)"
736
Sets the frame shadow value from the frame style.
740
\fIshadow\fP Frame shadow
745
\fBsetLineWidth()\fP, QFrame::setFrameShadow()
750
Definition at line 244 of file qwt_dial.cpp.
752
References lineWidth().
753
.SS "void QwtDial::setLineWidth (int lineWidth)"
759
\fIlineWidth\fP Line width
764
\fBsetFrameShadow()\fP
769
Definition at line 269 of file qwt_dial.cpp.
770
.SS "void QwtDial::setMode (\fBMode\fP mode)"
772
Change the mode of the meter.
779
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.
781
The default mode is QwtDial::RotateNeedle.
785
\fBmode()\fP, \fBsetValue()\fP, \fBsetOrigin()\fP
790
Definition at line 359 of file qwt_dial.cpp.
791
.SS "void QwtDial::setNeedle (\fBQwtDialNeedle\fP * needle)\fC [virtual]\fP"
793
Set a needle for the dial
795
Qwt is missing a set of good looking needles. Contributions are very welcome.
804
The needle will be deleted, when a different needle is set or in \fB~QwtDial()\fP
809
Definition at line 771 of file qwt_dial.cpp.
812
.SS "void QwtDial::setOrigin (double origin)\fC [virtual]\fP"
816
The origin is the angle where scale and needle is relative to.
820
\fIorigin\fP New origin
830
Definition at line 953 of file qwt_dial.cpp.
831
.SS "void QwtDial::setScale (int maxMajIntv, int maxMinIntv, double step = \fC0.0\fP)\fC [virtual]\fP"
833
Change the intervals of the scale
837
QwtAbstractScaleDraw::setScale
842
Definition at line 861 of file qwt_dial.cpp.
844
References updateScale().
845
.SS "void QwtDial::setScaleArc (double minArc, double maxArc)"
847
Change the arc of the scale
851
\fIminArc\fP Lower limit
853
\fImaxArc\fP Upper limit
858
Definition at line 976 of file qwt_dial.cpp.
859
.SS "void QwtDial::setScaleDraw (\fBQwtDialScaleDraw\fP * scaleDraw)\fC [virtual]\fP"
861
Set an individual scale draw
865
\fIscaleDraw\fP Scale draw
870
The previous scale draw is deleted
875
Definition at line 844 of file qwt_dial.cpp.
877
References scaleDraw(), and updateScale().
879
Referenced by setScaleOptions().
880
.SS "void QwtDial::setScaleOptions (int options)"
882
A wrapper method for accessing the scale draw.
887
No visible scale: setScaleDraw(NULL)
889
options & ScaleBackbone
891
En/disable the backbone of the scale.
895
En/disable the ticks of the scale.
899
En/disable scale labels
904
\fBQwtAbstractScaleDraw::enableComponent\fP
909
Definition at line 884 of file qwt_dial.cpp.
911
References QwtAbstractScaleDraw::enableComponent(), and setScaleDraw().
912
.SS "void QwtDial::setScaleTicks (int minLen, int medLen, int majLen, int penWidth = \fC1\fP)"
914
See: \fBQwtAbstractScaleDraw::setTickLength\fP, \fBQwtDialScaleDraw::setPenWidth\fP.
916
Definition at line 904 of file qwt_dial.cpp.
918
References QwtDialScaleDraw::setPenWidth(), and QwtAbstractScaleDraw::setTickLength().
919
.SS "void QwtDial::setWrapping (bool wrapping)\fC [virtual]\fP"
921
Sets whether it is possible to step the value from the highest value to the lowest value and vice versa to on.
925
\fIwrapping\fP en/disables wrapping
930
\fBwrapping()\fP, \fBQwtDoubleRange::periodic()\fP
935
The meaning of wrapping is like the wrapping property of QSpinBox, but not like it is used in QDial.
940
Definition at line 397 of file qwt_dial.cpp.
942
References QwtDoubleRange::setPeriodic().
943
.SS "void QwtDial::showBackground (bool show)"
945
Show/Hide the area outside of the frame
949
\fIshow\fP Show if true, hide if false
954
\fBhasVisibleBackground()\fP, setMask()
959
When \fBQwtDial\fP is a toplevel widget the window border might disappear too.
964
Definition at line 220 of file qwt_dial.cpp.
966
References updateMask().
967
.SS "QSize QwtDial::sizeHint () const\fC [virtual]\fP"
976
Definition at line 1001 of file qwt_dial.cpp.
978
References lineWidth().
979
.SS "void QwtDial::updateMask ()\fC [protected, virtual]\fP"
981
Update the mask of the dial.
983
In case of 'hasVisibleBackground() == false', the backgound is transparent by a mask.
987
\fBshowBackground()\fP, \fBhasVisibleBackground()\fP
992
Definition at line 1246 of file qwt_dial.cpp.
994
References boundingRect().
996
Referenced by resizeEvent(), and showBackground().
997
.SS "void QwtDial::updateScale ()\fC [protected]\fP"
999
Update the scale with the current attributes
1008
Definition at line 811 of file qwt_dial.cpp.
1010
References QwtLinearScaleEngine::divideScale(), QwtDoubleRange::maxValue(), QwtDoubleRange::minValue(), and QwtLinearScaleEngine::transformation().
1012
Referenced by rangeChange(), setScale(), and setScaleDraw().
1013
.SS "void QwtDial::valueChange ()\fC [protected, virtual]\fP"
1015
\fBQwtDoubleRange\fP update hook.
1017
Reimplemented from \fBQwtAbstractSlider\fP.
1019
Definition at line 992 of file qwt_dial.cpp.
1021
References QwtAbstractSlider::valueChange().
1022
.SS "bool QwtDial::wrapping () const"
1024
\fBwrapping()\fP holds whether it is possible to step the value from the highest value to the lowest value and vice versa.
1028
\fBsetWrapping()\fP, \fBQwtDoubleRange::setPeriodic()\fP
1033
The meaning of wrapping is like the wrapping property of QSpinBox, but not like it is used in QDial.
1038
Definition at line 410 of file qwt_dial.cpp.
1040
References QwtDoubleRange::periodic().
1042
Referenced by getValue().
1046
Generated automatically by Doxygen for Qwt User's Guide from the source code.