.TH "QwtDial" 3 "Tue Nov 20 2012" "Version 5.2.3" "Qwt User's Guide" \" -*- nroff -*- .ad l .nh .SH NAME QwtDial \- .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBQwtAbstractSlider\fP\&. .PP Inherited by \fBQwtAnalogClock\fP, and \fBQwtCompass\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "enum \fBDirection\fP { \fBClockwise\fP, \fBCounterClockwise\fP }" .br .ti -1c .RI "enum \fBMode\fP { \fBRotateNeedle\fP, \fBRotateScale\fP }" .br .ti -1c .RI "enum \fBScaleOptions\fP { \fBScaleBackbone\fP = 1, \fBScaleTicks\fP = 2, \fBScaleLabel\fP = 4 }" .br .ti -1c .RI "enum \fBShadow\fP { \fBPlain\fP = QFrame::Plain, \fBRaised\fP = QFrame::Raised, \fBSunken\fP = QFrame::Sunken }" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBQwtDial\fP (QWidget *parent=NULL)" .br .ti -1c .RI "virtual \fB~QwtDial\fP ()" .br .ti -1c .RI "QRect \fBboundingRect\fP () const " .br .ti -1c .RI "QRect \fBcontentsRect\fP () const " .br .ti -1c .RI "\fBDirection\fP \fBdirection\fP () const " .br .ti -1c .RI "\fBShadow\fP \fBframeShadow\fP () const " .br .ti -1c .RI "bool \fBhasVisibleBackground\fP () const " .br .ti -1c .RI "int \fBlineWidth\fP () const " .br .ti -1c .RI "double \fBmaxScaleArc\fP () const " .br .ti -1c .RI "virtual QSize \fBminimumSizeHint\fP () const " .br .ti -1c .RI "double \fBminScaleArc\fP () const " .br .ti -1c .RI "\fBMode\fP \fBmode\fP () const " .br .ti -1c .RI "const \fBQwtDialNeedle\fP * \fBneedle\fP () const " .br .ti -1c .RI "\fBQwtDialNeedle\fP * \fBneedle\fP ()" .br .ti -1c .RI "double \fBorigin\fP () const " .br .ti -1c .RI "virtual QRect \fBscaleContentsRect\fP () const " .br .ti -1c .RI "\fBQwtDialScaleDraw\fP * \fBscaleDraw\fP ()" .br .ti -1c .RI "const \fBQwtDialScaleDraw\fP * \fBscaleDraw\fP () const " .br .ti -1c .RI "void \fBsetDirection\fP (\fBDirection\fP)" .br .ti -1c .RI "void \fBsetFrameShadow\fP (\fBShadow\fP)" .br .ti -1c .RI "void \fBsetLineWidth\fP (int)" .br .ti -1c .RI "void \fBsetMode\fP (\fBMode\fP)" .br .ti -1c .RI "virtual void \fBsetNeedle\fP (\fBQwtDialNeedle\fP *)" .br .ti -1c .RI "virtual void \fBsetOrigin\fP (double)" .br .ti -1c .RI "virtual void \fBsetScale\fP (int maxMajIntv, int maxMinIntv, double \fBstep\fP=0\&.0)" .br .ti -1c .RI "void \fBsetScaleArc\fP (double min, double max)" .br .ti -1c .RI "virtual void \fBsetScaleDraw\fP (\fBQwtDialScaleDraw\fP *)" .br .ti -1c .RI "void \fBsetScaleOptions\fP (int)" .br .ti -1c .RI "void \fBsetScaleTicks\fP (int minLen, int medLen, int majLen, int penWidth=1)" .br .ti -1c .RI "virtual void \fBsetWrapping\fP (bool)" .br .ti -1c .RI "void \fBshowBackground\fP (bool)" .br .ti -1c .RI "virtual QSize \fBsizeHint\fP () const " .br .ti -1c .RI "bool \fBwrapping\fP () const " .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual void \fBdrawContents\fP (QPainter *) const " .br .ti -1c .RI "virtual void \fBdrawFocusIndicator\fP (QPainter *) const " .br .ti -1c .RI "virtual void \fBdrawFrame\fP (QPainter *p)" .br .ti -1c .RI "virtual void \fBdrawNeedle\fP (QPainter *, const QPoint &, int radius, double \fBdirection\fP, QPalette::ColorGroup) const " .br .ti -1c .RI "virtual void \fBdrawScale\fP (QPainter *, const QPoint ¢er, int radius, double \fBorigin\fP, double arcMin, double arcMax) const " .br .ti -1c .RI "virtual void \fBdrawScaleContents\fP (QPainter *painter, const QPoint ¢er, int radius) const " .br .ti -1c .RI "virtual void \fBgetScrollMode\fP (const QPoint &, int &scrollMode, int &\fBdirection\fP)" .br .ti -1c .RI "virtual double \fBgetValue\fP (const QPoint &)" .br .ti -1c .RI "virtual void \fBkeyPressEvent\fP (QKeyEvent *)" .br .ti -1c .RI "virtual void \fBpaintEvent\fP (QPaintEvent *)" .br .ti -1c .RI "virtual void \fBrangeChange\fP ()" .br .ti -1c .RI "virtual void \fBresizeEvent\fP (QResizeEvent *)" .br .ti -1c .RI "virtual \fBQwtText\fP \fBscaleLabel\fP (double) const " .br .ti -1c .RI "virtual void \fBupdateMask\fP ()" .br .ti -1c .RI "void \fBupdateScale\fP ()" .br .ti -1c .RI "virtual void \fBvalueChange\fP ()" .br .in -1c .SS "Friends" .in +1c .ti -1c .RI "class \fBQwtDialScaleDraw\fP" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP \fBQwtDial\fP class provides a rounded range control\&. \fBQwtDial\fP is intended as base class for dial widgets like speedometers, compass widgets, clocks \&.\&.\&. .PP .PP 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\&. .PP Qwt is missing a set of good looking needles (\fBQwtDialNeedle\fP)\&. Contributions are very welcome\&. .PP \fBSee also:\fP .RS 4 \fBQwtCompass\fP, \fBQwtAnalogClock\fP, \fBQwtDialNeedle\fP .RE .PP \fBNote:\fP .RS 4 The examples/dials example shows different types of dials\&. .RE .PP .SH "Member Enumeration Documentation" .PP .SS "enum \fBQwtDial::Direction\fP" Direction of the dial .SS "enum \fBQwtDial::Mode\fP" In case of RotateNeedle the needle is rotating, in case of RotateScale, the needle points to \fBorigin()\fP and the scale is rotating\&. .SS "enum \fBQwtDial::Shadow\fP" .PP Frame shadow\&. 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\&. .SH "Constructor & Destructor Documentation" .PP .SS "QwtDial::QwtDial (QWidget *parent = \fCNULL\fP)\fC [explicit]\fP" .PP Constructor\&. \fBParameters:\fP .RS 4 \fIparent\fP Parent widget .RE .PP 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\&. .SH "Member Function Documentation" .PP .SS "QRect QwtDial::boundingRect () const" \fBReturns:\fP .RS 4 bounding rect of the dial including the frame .RE .PP \fBSee also:\fP .RS 4 \fBsetLineWidth()\fP, \fBscaleContentsRect()\fP, \fBcontentsRect()\fP .RE .PP .SS "QRect QwtDial::contentsRect () const" \fBReturns:\fP .RS 4 bounding rect of the circle inside the frame .RE .PP \fBSee also:\fP .RS 4 \fBsetLineWidth()\fP, \fBscaleContentsRect()\fP, \fBboundingRect()\fP .RE .PP .SS "\fBQwtDial::Direction\fP QwtDial::direction () const" \fBReturns:\fP .RS 4 Direction of the dial .RE .PP The default direction of a dial is QwtDial::Clockwise .PP \fBSee also:\fP .RS 4 \fBsetDirection()\fP .RE .PP .SS "void QwtDial::drawContents (QPainter *painter) const\fC [protected]\fP, \fC [virtual]\fP" .PP Draw the contents inside the frame\&. 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\&. .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .RE .PP \fBSee also:\fP .RS 4 \fBboundingRect()\fP, \fBcontentsRect()\fP, \fBscaleContentsRect()\fP, QWidget::setPalette() .RE .PP .SS "void QwtDial::drawFocusIndicator (QPainter *painter) const\fC [protected]\fP, \fC [virtual]\fP" Draw a dotted round circle, if !isReadOnly() .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .RE .PP .SS "void QwtDial::drawFrame (QPainter *painter)\fC [protected]\fP, \fC [virtual]\fP" Draw the frame around the dial .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .RE .PP \fBSee also:\fP .RS 4 \fBlineWidth()\fP, \fBframeShadow()\fP .RE .PP .SS "void QwtDial::drawNeedle (QPainter *painter, const QPoint ¢er, intradius, doubledirection, QPalette::ColorGroupcg) const\fC [protected]\fP, \fC [virtual]\fP" Draw the needle .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .br \fIcenter\fP Center of the dial .br \fIradius\fP Length for the needle .br \fIdirection\fP Direction of the needle in degrees, counter clockwise .br \fIcg\fP ColorGroup .RE .PP .PP Reimplemented in \fBQwtAnalogClock\fP\&. .SS "void QwtDial::drawScale (QPainter *painter, const QPoint ¢er, intradius, doubleorigin, doubleminArc, doublemaxArc) const\fC [protected]\fP, \fC [virtual]\fP" Draw the scale .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .br \fIcenter\fP Center of the dial .br \fIradius\fP Radius of the scale .br \fIorigin\fP Origin of the scale .br \fIminArc\fP Minimum of the arc .br \fImaxArc\fP Minimum of the arc .RE .PP \fBSee also:\fP .RS 4 QwtAbstractScaleDraw::setAngleRange() .RE .PP .SS "void QwtDial::drawScaleContents (QPainter *painter, const QPoint ¢er, intradius) const\fC [protected]\fP, \fC [virtual]\fP" Draw the contents inside the scale .PP Paints nothing\&. .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .br \fIcenter\fP Center of the contents circle .br \fIradius\fP Radius of the contents circle .RE .PP .PP Reimplemented in \fBQwtCompass\fP\&. .SS "\fBQwtDial::Shadow\fP QwtDial::frameShadow () const" \fBReturns:\fP .RS 4 Frame shadow /sa \fBsetFrameShadow()\fP, \fBlineWidth()\fP, QFrame::frameShadow .RE .PP .SS "void QwtDial::getScrollMode (const QPoint &pos, int &scrollMode, int &direction)\fC [protected]\fP, \fC [virtual]\fP" See \fBQwtAbstractSlider::getScrollMode()\fP .PP \fBParameters:\fP .RS 4 \fIpos\fP point where the mouse was pressed .RE .PP \fBReturn values:\fP .RS 4 \fIscrollMode\fP The scrolling mode .br \fIdirection\fP direction: 1, 0, or \-1\&. .RE .PP \fBSee also:\fP .RS 4 \fBQwtAbstractSlider::getScrollMode()\fP .RE .PP .PP Implements \fBQwtAbstractSlider\fP\&. .SS "double QwtDial::getValue (const QPoint &pos)\fC [protected]\fP, \fC [virtual]\fP" Find the value for a given position .PP \fBParameters:\fP .RS 4 \fIpos\fP Position .RE .PP \fBReturns:\fP .RS 4 Value .RE .PP .PP Implements \fBQwtAbstractSlider\fP\&. .SS "bool QwtDial::hasVisibleBackground () const" true when the area outside of the frame is visible .PP \fBSee also:\fP .RS 4 \fBshowBackground()\fP, setMask() .RE .PP .SS "void QwtDial::keyPressEvent (QKeyEvent *event)\fC [protected]\fP, \fC [virtual]\fP" Handles key events .PP .IP "\(bu" 2 Key_Down, KeyLeft .br Decrement by 1 .IP "\(bu" 2 Key_Prior .br Decrement by \fBpageSize()\fP .IP "\(bu" 2 Key_Home .br Set the value to \fBminValue()\fP .PP .PP .IP "\(bu" 2 Key_Up, KeyRight .br Increment by 1 .IP "\(bu" 2 Key_Next .br Increment by \fBpageSize()\fP .IP "\(bu" 2 Key_End .br Set the value to \fBmaxValue()\fP .PP .PP \fBParameters:\fP .RS 4 \fIevent\fP Key event .RE .PP \fBSee also:\fP .RS 4 \fBisReadOnly()\fP .RE .PP .PP Reimplemented from \fBQwtAbstractSlider\fP\&. .PP Reimplemented in \fBQwtCompass\fP\&. .SS "int QwtDial::lineWidth () const" \fBReturns:\fP .RS 4 Line width of the frame .RE .PP \fBSee also:\fP .RS 4 \fBsetLineWidth()\fP, \fBframeShadow()\fP, \fBlineWidth()\fP .RE .PP .SS "double QwtDial::maxScaleArc () const" \fBReturns:\fP .RS 4 Upper limit of the scale arc .RE .PP .SS "QSize QwtDial::minimumSizeHint () const\fC [virtual]\fP" .PP Return a minimum size hint\&. \fBWarning:\fP .RS 4 The return value of \fBQwtDial::minimumSizeHint()\fP depends on the font and the scale\&. .RE .PP .SS "double QwtDial::minScaleArc () const" \fBReturns:\fP .RS 4 Lower limit of the scale arc .RE .PP .SS "\fBQwtDial::Mode\fP QwtDial::mode () const" \fBReturns:\fP .RS 4 mode of the dial\&. .RE .PP 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\&. .PP The default mode is QwtDial::RotateNeedle\&. .PP \fBSee also:\fP .RS 4 \fBsetMode()\fP, \fBorigin()\fP, \fBsetScaleArc()\fP, \fBvalue()\fP .RE .PP .SS "const \fBQwtDialNeedle\fP * QwtDial::needle () const" \fBReturns:\fP .RS 4 needle .RE .PP \fBSee also:\fP .RS 4 \fBsetNeedle()\fP .RE .PP .SS "\fBQwtDialNeedle\fP * QwtDial::needle ()" \fBReturns:\fP .RS 4 needle .RE .PP \fBSee also:\fP .RS 4 \fBsetNeedle()\fP .RE .PP .SS "double QwtDial::origin () const" The origin is the angle where scale and needle is relative to\&. .PP \fBReturns:\fP .RS 4 Origin of the dial .RE .PP \fBSee also:\fP .RS 4 \fBsetOrigin()\fP .RE .PP .SS "void QwtDial::paintEvent (QPaintEvent *e)\fC [protected]\fP, \fC [virtual]\fP" Paint the dial .PP \fBParameters:\fP .RS 4 \fIe\fP Paint event .RE .PP .SS "void QwtDial::resizeEvent (QResizeEvent *e)\fC [protected]\fP, \fC [virtual]\fP" Resize the dial widget .PP \fBParameters:\fP .RS 4 \fIe\fP Resize event .RE .PP .SS "QRect QwtDial::scaleContentsRect () const\fC [virtual]\fP" \fBReturns:\fP .RS 4 rect inside the scale .RE .PP \fBSee also:\fP .RS 4 \fBsetLineWidth()\fP, \fBboundingRect()\fP, \fBcontentsRect()\fP .RE .PP .SS "\fBQwtText\fP QwtDial::scaleLabel (doublevalue) const\fC [protected]\fP, \fC [virtual]\fP" Find the label for a value .PP \fBParameters:\fP .RS 4 \fIvalue\fP Value .RE .PP \fBReturns:\fP .RS 4 label .RE .PP .PP Reimplemented in \fBQwtAnalogClock\fP, and \fBQwtCompass\fP\&. .SS "void QwtDial::setDirection (\fBDirection\fPdirection)" Set the direction of the dial (clockwise/counterclockwise) .PP Direction direction .PP \fBSee also:\fP .RS 4 \fBdirection()\fP .RE .PP .SS "void QwtDial::setFrameShadow (\fBShadow\fPshadow)" Sets the frame shadow value from the frame style\&. .PP \fBParameters:\fP .RS 4 \fIshadow\fP Frame shadow .RE .PP \fBSee also:\fP .RS 4 \fBsetLineWidth()\fP, QFrame::setFrameShadow() .RE .PP .SS "void QwtDial::setLineWidth (intlineWidth)" Sets the line width .PP \fBParameters:\fP .RS 4 \fIlineWidth\fP Line width .RE .PP \fBSee also:\fP .RS 4 \fBsetFrameShadow()\fP .RE .PP .SS "void QwtDial::setMode (\fBMode\fPmode)" .PP Change the mode of the meter\&. \fBParameters:\fP .RS 4 \fImode\fP New mode .RE .PP 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\&. .PP The default mode is QwtDial::RotateNeedle\&. .PP \fBSee also:\fP .RS 4 \fBmode()\fP, \fBsetValue()\fP, \fBsetOrigin()\fP .RE .PP .SS "void QwtDial::setNeedle (\fBQwtDialNeedle\fP *needle)\fC [virtual]\fP" Set a needle for the dial .PP Qwt is missing a set of good looking needles\&. Contributions are very welcome\&. .PP \fBParameters:\fP .RS 4 \fIneedle\fP Needle .RE .PP \fBWarning:\fP .RS 4 The needle will be deleted, when a different needle is set or in \fB~QwtDial()\fP .RE .PP .SS "void QwtDial::setOrigin (doubleorigin)\fC [virtual]\fP" .PP Change the origin\&. The origin is the angle where scale and needle is relative to\&. .PP \fBParameters:\fP .RS 4 \fIorigin\fP New origin .RE .PP \fBSee also:\fP .RS 4 \fBorigin()\fP .RE .PP .SS "void QwtDial::setScale (intmaxMajIntv, intmaxMinIntv, doublestep = \fC0\&.0\fP)\fC [virtual]\fP" Change the intervals of the scale .PP \fBSee also:\fP .RS 4 QwtAbstractScaleDraw::setScale() .RE .PP .SS "void QwtDial::setScaleArc (doubleminArc, doublemaxArc)" Change the arc of the scale .PP \fBParameters:\fP .RS 4 \fIminArc\fP Lower limit .br \fImaxArc\fP Upper limit .RE .PP .SS "void QwtDial::setScaleDraw (\fBQwtDialScaleDraw\fP *scaleDraw)\fC [virtual]\fP" Set an individual scale draw .PP \fBParameters:\fP .RS 4 \fIscaleDraw\fP Scale draw .RE .PP \fBWarning:\fP .RS 4 The previous scale draw is deleted .RE .PP .SS "void QwtDial::setScaleOptions (intoptions)" A wrapper method for accessing the scale draw\&. .PP .IP "\(bu" 2 options == 0 .br No visible scale: setScaleDraw(NULL) .IP "\(bu" 2 options & ScaleBackbone .br En/disable the backbone of the scale\&. .IP "\(bu" 2 options & ScaleTicks .br En/disable the ticks of the scale\&. .IP "\(bu" 2 options & ScaleLabel .br En/disable scale labels .PP .PP \fBSee also:\fP .RS 4 \fBQwtAbstractScaleDraw::enableComponent()\fP .RE .PP .SS "void QwtDial::setScaleTicks (intminLen, intmedLen, intmajLen, intpenWidth = \fC1\fP)" Assign length and width of the ticks .PP \fBParameters:\fP .RS 4 \fIminLen\fP Length of the minor ticks .br \fImedLen\fP Length of the medium ticks .br \fImajLen\fP Length of the major ticks .br \fIpenWidth\fP Width of the pen for all ticks .RE .PP \fBSee also:\fP .RS 4 \fBQwtAbstractScaleDraw::setTickLength()\fP, \fBQwtDialScaleDraw::setPenWidth()\fP .RE .PP .SS "void QwtDial::setWrapping (boolwrapping)\fC [virtual]\fP" Sets whether it is possible to step the value from the highest value to the lowest value and vice versa to on\&. .PP \fBParameters:\fP .RS 4 \fIwrapping\fP en/disables wrapping .RE .PP \fBSee also:\fP .RS 4 \fBwrapping()\fP, \fBQwtDoubleRange::periodic()\fP .RE .PP \fBNote:\fP .RS 4 The meaning of wrapping is like the wrapping property of QSpinBox, but not like it is used in QDial\&. .RE .PP .SS "void QwtDial::showBackground (boolshow)" Show/Hide the area outside of the frame .PP \fBParameters:\fP .RS 4 \fIshow\fP Show if true, hide if false .RE .PP \fBSee also:\fP .RS 4 \fBhasVisibleBackground()\fP, setMask() .RE .PP \fBWarning:\fP .RS 4 When \fBQwtDial\fP is a toplevel widget the window border might disappear too\&. .RE .PP .SS "QSize QwtDial::sizeHint () const\fC [virtual]\fP" \fBReturns:\fP .RS 4 Size hint .RE .PP .SS "void QwtDial::updateMask ()\fC [protected]\fP, \fC [virtual]\fP" .PP Update the mask of the dial\&. In case of 'hasVisibleBackground() == false', the backgound is transparent by a mask\&. .PP \fBSee also:\fP .RS 4 \fBshowBackground()\fP, \fBhasVisibleBackground()\fP .RE .PP .SS "void QwtDial::updateScale ()\fC [protected]\fP" Update the scale with the current attributes .PP \fBSee also:\fP .RS 4 \fBsetScale()\fP .RE .PP .SS "bool QwtDial::wrapping () const" \fBwrapping()\fP holds whether it is possible to step the value from the highest value to the lowest value and vice versa\&. .PP \fBSee also:\fP .RS 4 \fBsetWrapping()\fP, \fBQwtDoubleRange::setPeriodic()\fP .RE .PP \fBNote:\fP .RS 4 The meaning of wrapping is like the wrapping property of QSpinBox, but not like it is used in QDial\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for Qwt User's Guide from the source code\&.