1
.TH "QwtDial" 3 "22 Mar 2009" "Qwt User's Guide" \" -*- nroff -*-
5
QwtDial \- \fBQwtDial\fP class provides a rounded range control.
11
\fC#include <qwt_dial.h>\fP
13
Inherits \fBQwtAbstractSlider\fP.
15
Inherited by \fBQwtAnalogClock\fP, and \fBQwtCompass\fP.
21
.RI "enum \fBShadow\fP { \fBPlain\fP = QFrame::Plain, \fBRaised\fP = QFrame::Raised, \fBSunken\fP = QFrame::Sunken }"
24
.RI "enum \fBScaleOptions\fP { \fBScaleBackbone\fP = 1, \fBScaleTicks\fP = 2, \fBScaleLabel\fP = 4 }"
27
.RI "enum \fBMode\fP { \fBRotateNeedle\fP, \fBRotateScale\fP }"
30
.RI "enum \fBDirection\fP { \fBClockwise\fP, \fBCounterClockwise\fP }"
32
.SS "Public Member Functions"
36
.RI "\fBQwtDial\fP (QWidget *parent=NULL)"
39
.RI "virtual \fB~QwtDial\fP ()"
42
.RI "void \fBsetFrameShadow\fP (\fBShadow\fP)"
45
.RI "\fBShadow\fP \fBframeShadow\fP () const "
48
.RI "bool \fBhasVisibleBackground\fP () const "
51
.RI "void \fBshowBackground\fP (bool)"
54
.RI "void \fBsetLineWidth\fP (int)"
57
.RI "int \fBlineWidth\fP () const "
60
.RI "void \fBsetMode\fP (\fBMode\fP)"
63
.RI "\fBMode\fP \fBmode\fP () const "
66
.RI "virtual void \fBsetWrapping\fP (bool)"
69
.RI "bool \fBwrapping\fP () const "
72
.RI "virtual void \fBsetScale\fP (int maxMajIntv, int maxMinIntv, double step=0.0)"
75
.RI "void \fBsetScaleArc\fP (double min, double max)"
78
.RI "void \fBsetScaleOptions\fP (int)"
81
.RI "void \fBsetScaleTicks\fP (int minLen, int medLen, int majLen, int penWidth=1)"
84
.RI "double \fBminScaleArc\fP () const "
87
.RI "double \fBmaxScaleArc\fP () const "
90
.RI "virtual void \fBsetOrigin\fP (double)"
93
.RI "double \fBorigin\fP () const "
96
.RI "void \fBsetDirection\fP (\fBDirection\fP)"
99
.RI "\fBDirection\fP \fBdirection\fP () const "
102
.RI "virtual void \fBsetNeedle\fP (\fBQwtDialNeedle\fP *)"
105
.RI "const \fBQwtDialNeedle\fP * \fBneedle\fP () const "
108
.RI "\fBQwtDialNeedle\fP * \fBneedle\fP ()"
111
.RI "QRect \fBboundingRect\fP () const "
114
.RI "QRect \fBcontentsRect\fP () const "
117
.RI "virtual QRect \fBscaleContentsRect\fP () const "
120
.RI "virtual QSize \fBsizeHint\fP () const "
123
.RI "virtual QSize \fBminimumSizeHint\fP () const "
126
.RI "virtual void \fBsetScaleDraw\fP (\fBQwtDialScaleDraw\fP *)"
129
.RI "\fBQwtDialScaleDraw\fP * \fBscaleDraw\fP ()"
132
.RI "const \fBQwtDialScaleDraw\fP * \fBscaleDraw\fP () const "
135
.SS "Protected Member Functions"
139
.RI "virtual void \fBpaintEvent\fP (QPaintEvent *)"
142
.RI "virtual void \fBresizeEvent\fP (QResizeEvent *)"
145
.RI "virtual void \fBkeyPressEvent\fP (QKeyEvent *)"
148
.RI "virtual void \fBupdateMask\fP ()"
151
.RI "virtual void \fBdrawFrame\fP (QPainter *p)"
154
.RI "virtual void \fBdrawContents\fP (QPainter *) const "
157
.RI "virtual void \fBdrawFocusIndicator\fP (QPainter *) const "
160
.RI "virtual void \fBdrawScale\fP (QPainter *, const QPoint ¢er, int radius, double origin, double arcMin, double arcMax) const "
163
.RI "virtual void \fBdrawScaleContents\fP (QPainter *painter, const QPoint ¢er, int radius) const "
166
.RI "virtual void \fBdrawNeedle\fP (QPainter *, const QPoint &, int radius, double direction, QPalette::ColorGroup) const "
169
.RI "virtual \fBQwtText\fP \fBscaleLabel\fP (double) const "
172
.RI "void \fBupdateScale\fP ()"
175
.RI "virtual void \fBrangeChange\fP ()"
178
.RI "virtual void \fBvalueChange\fP ()"
181
.RI "virtual double \fBgetValue\fP (const QPoint &)"
184
.RI "virtual void \fBgetScrollMode\fP (const QPoint &, int &scrollMode, int &direction)"
191
.RI "class \fBQwtDialScaleDraw\fP"
194
.SH "Detailed Description"
196
\fBQwtDial\fP class provides a rounded range control.
198
\fBQwtDial\fP is intended as base class for dial widgets like speedometers, compass widgets, clocks ...
201
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.
203
Qwt is missing a set of good looking needles (\fBQwtDialNeedle\fP). Contributions are very welcome.
207
\fBQwtCompass\fP, \fBQwtAnalogClock\fP, \fBQwtDialNeedle\fP
212
The examples/dials example shows different types of dials.
216
.SH "Member Enumeration Documentation"
218
.SS "enum \fBQwtDial::Direction\fP"
220
Direction of the dial
221
.SS "enum \fBQwtDial::Mode\fP"
223
In case of RotateNeedle the needle is rotating, in case of RotateScale, the needle points to \fBorigin()\fP and the scale is rotating.
224
.SS "enum \fBQwtDial::ScaleOptions\fP"
226
see \fBQwtDial::setScaleOptions\fP
228
.SS "enum \fBQwtDial::Shadow\fP"
232
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.
233
.SH "Constructor & Destructor Documentation"
235
.SS "QwtDial::QwtDial (QWidget * parent = \fCNULL\fP)\fC [explicit]\fP"
241
\fIparent\fP Parent widget
244
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.
245
.SS "QwtDial::~QwtDial ()\fC [virtual]\fP"
249
.SH "Member Function Documentation"
251
.SS "QRect QwtDial::boundingRect () const"
255
bounding rect of the dial including the frame
260
\fBsetLineWidth()\fP, \fBscaleContentsRect()\fP, \fBcontentsRect()\fP
264
.SS "QRect QwtDial::contentsRect () const"
268
bounding rect of the circle inside the frame
273
\fBsetLineWidth()\fP, \fBscaleContentsRect()\fP, \fBboundingRect()\fP
277
.SS "\fBQwtDial::Direction\fP QwtDial::direction () const"
281
Direction of the dial
284
The default direction of a dial is QwtDial::Clockwise
292
.SS "void QwtDial::drawContents (QPainter * painter) const\fC [protected, virtual]\fP"
294
Draw the contents inside the frame.
296
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.
300
\fIpainter\fP Painter
305
\fBboundingRect()\fP, \fBcontentsRect()\fP, \fBscaleContentsRect()\fP, QWidget::setPalette()
309
.SS "void QwtDial::drawFocusIndicator (QPainter * painter) const\fC [protected, virtual]\fP"
311
Draw a dotted round circle, if !isReadOnly()
315
\fIpainter\fP Painter
319
.SS "void QwtDial::drawFrame (QPainter * painter)\fC [protected, virtual]\fP"
321
Draw the frame around the dial
325
\fIpainter\fP Painter
330
\fBlineWidth()\fP, \fBframeShadow()\fP
334
.SS "void QwtDial::drawNeedle (QPainter * painter, const QPoint & center, int radius, double direction, QPalette::ColorGroup cg) const\fC [protected, virtual]\fP"
340
\fIpainter\fP Painter
342
\fIcenter\fP Center of the dial
344
\fIradius\fP Length for the needle
346
\fIdirection\fP Direction of the needle in degrees, counter clockwise
353
Reimplemented in \fBQwtAnalogClock\fP.
354
.SS "void QwtDial::drawScale (QPainter * painter, const QPoint & center, int radius, double origin, double minArc, double maxArc) const\fC [protected, virtual]\fP"
360
\fIpainter\fP Painter
362
\fIcenter\fP Center of the dial
364
\fIradius\fP Radius of the scale
366
\fIorigin\fP Origin of the scale
368
\fIminArc\fP Minimum of the arc
370
\fImaxArc\fP Minimum of the arc
375
QwtAbstractScaleDraw::setAngleRange()
379
.SS "void QwtDial::drawScaleContents (QPainter * painter, const QPoint & center, int radius) const\fC [protected, virtual]\fP"
381
Draw the contents inside the scale
387
\fIpainter\fP Painter
389
\fIcenter\fP Center of the contents circle
391
\fIradius\fP Radius of the contents circle
396
Reimplemented in \fBQwtCompass\fP.
397
.SS "\fBQwtDial::Shadow\fP QwtDial::frameShadow () const"
401
Frame shadow /sa \fBsetFrameShadow()\fP, \fBlineWidth()\fP, QFrame::frameShadow
405
.SS "void QwtDial::getScrollMode (const QPoint & pos, int & scrollMode, int & direction)\fC [protected, virtual]\fP"
407
See \fBQwtAbstractSlider::getScrollMode()\fP
411
\fIpos\fP point where the mouse was pressed
416
\fIscrollMode\fP The scrolling mode
418
\fIdirection\fP direction: 1, 0, or -1.
423
\fBQwtAbstractSlider::getScrollMode()\fP
428
Implements \fBQwtAbstractSlider\fP.
429
.SS "double QwtDial::getValue (const QPoint & pos)\fC [protected, virtual]\fP"
431
Find the value for a given position
445
Implements \fBQwtAbstractSlider\fP.
446
.SS "bool QwtDial::hasVisibleBackground () const"
448
true when the area outside of the frame is visible
452
\fBshowBackground()\fP, setMask()
456
.SS "void QwtDial::keyPressEvent (QKeyEvent * event)\fC [protected, virtual]\fP"
467
Decrement by \fBpageSize()\fP
471
Set the value to \fBminValue()\fP
481
Increment by \fBpageSize()\fP
485
Set the value to \fBmaxValue()\fP
490
\fIevent\fP Key event
500
Reimplemented from \fBQwtAbstractSlider\fP.
502
Reimplemented in \fBQwtCompass\fP.
503
.SS "int QwtDial::lineWidth () const"
507
Line width of the frame
512
\fBsetLineWidth()\fP, \fBframeShadow()\fP, \fBlineWidth()\fP
516
.SS "double QwtDial::maxScaleArc () const"
520
Upper limit of the scale arc
524
.SS "QSize QwtDial::minimumSizeHint () const\fC [virtual]\fP"
526
Return a minimum size hint.
530
The return value of \fBQwtDial::minimumSizeHint()\fP depends on the font and the scale.
534
.SS "double QwtDial::minScaleArc () const"
538
Lower limit of the scale arc
542
.SS "\fBQwtDial::Mode\fP QwtDial::mode () const"
549
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.
551
The default mode is QwtDial::RotateNeedle.
555
\fBsetMode()\fP, \fBorigin()\fP, \fBsetScaleArc()\fP, \fBvalue()\fP
559
.SS "\fBQwtDialNeedle\fP * QwtDial::needle ()"
572
.SS "const \fBQwtDialNeedle\fP * QwtDial::needle () const"
585
.SS "double QwtDial::origin () const"
587
The origin is the angle where scale and needle is relative to.
600
.SS "void QwtDial::paintEvent (QPaintEvent * e)\fC [protected, virtual]\fP"
610
.SS "void QwtDial::rangeChange ()\fC [protected, virtual]\fP"
612
\fBQwtDoubleRange\fP update hook.
614
Reimplemented from \fBQwtDoubleRange\fP.
615
.SS "void QwtDial::resizeEvent (QResizeEvent * e)\fC [protected, virtual]\fP"
617
Resize the dial widget
625
.SS "QRect QwtDial::scaleContentsRect () const\fC [virtual]\fP"
629
rect inside the scale
634
\fBsetLineWidth()\fP, \fBboundingRect()\fP, \fBcontentsRect()\fP
638
.SS "const \fBQwtDialScaleDraw\fP * QwtDial::scaleDraw () const"
640
Return the scale draw.
642
.SS "\fBQwtDialScaleDraw\fP * QwtDial::scaleDraw ()"
644
Return the scale draw.
646
.SS "\fBQwtText\fP QwtDial::scaleLabel (double value) const\fC [protected, virtual]\fP"
648
Find the label for a value
662
Reimplemented in \fBQwtAnalogClock\fP, and \fBQwtCompass\fP.
663
.SS "void QwtDial::setDirection (\fBDirection\fP direction)"
665
Set the direction of the dial (clockwise/counterclockwise)
675
.SS "void QwtDial::setFrameShadow (\fBShadow\fP shadow)"
677
Sets the frame shadow value from the frame style.
681
\fIshadow\fP Frame shadow
686
\fBsetLineWidth()\fP, QFrame::setFrameShadow()
690
.SS "void QwtDial::setLineWidth (int lineWidth)"
696
\fIlineWidth\fP Line width
701
\fBsetFrameShadow()\fP
705
.SS "void QwtDial::setMode (\fBMode\fP mode)"
707
Change the mode of the meter.
714
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.
716
The default mode is QwtDial::RotateNeedle.
720
\fBmode()\fP, \fBsetValue()\fP, \fBsetOrigin()\fP
724
.SS "void QwtDial::setNeedle (\fBQwtDialNeedle\fP * needle)\fC [virtual]\fP"
726
Set a needle for the dial
728
Qwt is missing a set of good looking needles. Contributions are very welcome.
737
The needle will be deleted, when a different needle is set or in \fB~QwtDial()\fP
741
.SS "void QwtDial::setOrigin (double origin)\fC [virtual]\fP"
745
The origin is the angle where scale and needle is relative to.
749
\fIorigin\fP New origin
758
.SS "void QwtDial::setScale (int maxMajIntv, int maxMinIntv, double step = \fC0.0\fP)\fC [virtual]\fP"
760
Change the intervals of the scale
764
QwtAbstractScaleDraw::setScale()
768
.SS "void QwtDial::setScaleArc (double minArc, double maxArc)"
770
Change the arc of the scale
774
\fIminArc\fP Lower limit
776
\fImaxArc\fP Upper limit
780
.SS "void QwtDial::setScaleDraw (\fBQwtDialScaleDraw\fP * scaleDraw)\fC [virtual]\fP"
782
Set an individual scale draw
786
\fIscaleDraw\fP Scale draw
791
The previous scale draw is deleted
795
.SS "void QwtDial::setScaleOptions (int options)"
797
A wrapper method for accessing the scale draw.
802
No visible scale: setScaleDraw(NULL)
804
options & ScaleBackbone
806
En/disable the backbone of the scale.
810
En/disable the ticks of the scale.
814
En/disable scale labels
819
\fBQwtAbstractScaleDraw::enableComponent()\fP
823
.SS "void QwtDial::setScaleTicks (int minLen, int medLen, int majLen, int penWidth = \fC1\fP)"
825
Assign length and width of the ticks
829
\fIminLen\fP Length of the minor ticks
831
\fImedLen\fP Length of the medium ticks
833
\fImajLen\fP Length of the major ticks
835
\fIpenWidth\fP Width of the pen for all ticks
840
\fBQwtAbstractScaleDraw::setTickLength()\fP, \fBQwtDialScaleDraw::setPenWidth()\fP
844
.SS "void QwtDial::setWrapping (bool wrapping)\fC [virtual]\fP"
846
Sets whether it is possible to step the value from the highest value to the lowest value and vice versa to on.
850
\fIwrapping\fP en/disables wrapping
855
\fBwrapping()\fP, \fBQwtDoubleRange::periodic()\fP
860
The meaning of wrapping is like the wrapping property of QSpinBox, but not like it is used in QDial.
864
.SS "void QwtDial::showBackground (bool show)"
866
Show/Hide the area outside of the frame
870
\fIshow\fP Show if true, hide if false
875
\fBhasVisibleBackground()\fP, setMask()
880
When \fBQwtDial\fP is a toplevel widget the window border might disappear too.
884
.SS "QSize QwtDial::sizeHint () const\fC [virtual]\fP"
892
.SS "void QwtDial::updateMask ()\fC [protected, virtual]\fP"
894
Update the mask of the dial.
896
In case of 'hasVisibleBackground() == false', the backgound is transparent by a mask.
900
\fBshowBackground()\fP, \fBhasVisibleBackground()\fP
904
.SS "void QwtDial::updateScale ()\fC [protected]\fP"
906
Update the scale with the current attributes
914
.SS "void QwtDial::valueChange ()\fC [protected, virtual]\fP"
916
\fBQwtDoubleRange\fP update hook.
918
Reimplemented from \fBQwtAbstractSlider\fP.
919
.SS "bool QwtDial::wrapping () const"
921
\fBwrapping()\fP holds whether it is possible to step the value from the highest value to the lowest value and vice versa.
925
\fBsetWrapping()\fP, \fBQwtDoubleRange::setPeriodic()\fP
930
The meaning of wrapping is like the wrapping property of QSpinBox, but not like it is used in QDial.
937
Generated automatically by Doxygen for Qwt User's Guide from the source code.