QwtDial(3) | Qwt User's Guide | QwtDial(3) |
QwtDial - QwtDial class provides a rounded range control.
#include <qwt_dial.h>
Inherits QwtAbstractSlider.
Inherited by QwtAnalogClock, and QwtCompass.
enum Shadow { Plain = QFrame::Plain, Raised =
QFrame::Raised, Sunken = QFrame::Sunken }
Frame shadow. enum Mode { RotateNeedle, RotateScale }
Mode controlling whether the needle or the scale is rotating.
QwtDial (QWidget *parent=NULL)
Constructor. virtual ~QwtDial ()
Destructor. void setFrameShadow (Shadow)
Shadow frameShadow () const
void setLineWidth (int)
int lineWidth () const
void setMode (Mode)
Change the mode of the dial. Mode mode () const
void setScaleArc (double minArc, double maxArc)
void setMinScaleArc (double)
double minScaleArc () const
void setMaxScaleArc (double)
double maxScaleArc () const
virtual void setOrigin (double)
Change the origin. double origin () const
void setNeedle (QwtDialNeedle *)
const QwtDialNeedle * needle () const
QwtDialNeedle * needle ()
QRect boundingRect () const
QRect innerRect () const
virtual QRect scaleInnerRect () const
virtual QSize sizeHint () const
virtual QSize minimumSizeHint () const
void setScaleDraw (QwtRoundScaleDraw *)
QwtRoundScaleDraw * scaleDraw ()
const QwtRoundScaleDraw * scaleDraw () const
virtual void wheelEvent (QWheelEvent *)
virtual void paintEvent (QPaintEvent *)
virtual void changeEvent (QEvent *)
virtual void drawFrame (QPainter *)
virtual void drawContents (QPainter *) const
Draw the contents inside the frame. virtual void drawFocusIndicator
(QPainter *) const
void invalidateCache ()
virtual void drawScale (QPainter *, const QPointF ¢er, double
radius) const
virtual void drawScaleContents (QPainter *painter, const QPointF
¢er, double radius) const
virtual void drawNeedle (QPainter *, const QPointF &, double
radius, double direction, QPalette::ColorGroup) const
virtual double scrolledTo (const QPoint &) const
Determine the value for a new position of the slider handle. virtual bool
isScrollPosition (const QPoint &) const
Determine what to do when the user presses a mouse button. virtual void
sliderChange ()
Calling update() virtual void scaleChange ()
QwtDial class provides a rounded range control.
QwtDial is intended as base class for dial widgets like speedometers, compass widgets, clocks ...
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 isReadOnly() the dial can be rotated by dragging the mouse or using keyboard inputs (see QwtAbstractSlider::keyPressEvent()). 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 origin() of the dial.
Often dials have to be updated very often according to values from external devices. For these high refresh rates QwtDial caches as much as possible. For derived classes it might be necessary to clear these caches manually according to attribute changes using invalidateCache().
See also:
Note:
QDial is more similar to QwtKnob than to QwtDial
Mode controlling whether the needle or the scale is rotating.
Enumerator
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.
Enumerator
Constructor.
Parameters:
Create a dial widget with no needle. The scale is initialized to [ 0.0, 360.0 ] and 360 steps ( QwtAbstractSlider::setTotalSteps() ). The origin of the scale is at 90°,
The value is set to 0.0.
The default mode is QwtDial::RotateNeedle.
Returns:
See also:
Change Event handler
Parameters:
Invalidates internal paint caches if necessary
Draw the contents inside the frame. QPalette::Window is the background color outside of the frame. QPalette::Base is the background color inside the frame. QPalette::WindowText is the background color inside the scale.
Parameters:
See also:
Draw the focus indicator
Parameters:
Draw the frame around the dial
Parameters:
See also:
Draw the needle
Parameters:
Reimplemented in QwtAnalogClock.
Draw the scale
Parameters:
Draw the contents inside the scale
Paints nothing.
Parameters:
Reimplemented in QwtCompass.
Returns:
Returns:
See also:
Invalidate the internal caches used to speed up repainting
Determine what to do when the user presses a mouse button.
Parameters:
Return values:
See also:
Implements QwtAbstractSlider.
Returns:
See also:
Returns:
See also:
Returns:
See also:
Returns:
See also:
Returns:
See also:
Returns:
See also:
Returns:
See also:
The origin is the angle where scale and needle is relative to.
Returns:
See also:
Paint the dial
Parameters:
Invalidate the internal caches and call QwtAbstractSlider::scaleChange()
Reimplemented from QwtAbstractSlider.
Returns:
Returns:
Returns:
See also:
Determine the value for a new position of the slider handle.
Parameters:
Returns:
See also:
Implements QwtAbstractSlider.
Sets the frame shadow value from the frame style.
Parameters:
See also:
Sets the line width of the frame
Parameters:
See also:
Set the upper limit for the scale arc
Parameters:
See also:
Set the lower limit for the scale arc
Parameters:
See also:
Change the mode of the dial.
Parameters:
In case of QwtDial::RotateNeedle the needle is rotating, in case of QwtDial::RotateScale, the needle points to origin() and the scale is rotating.
The default mode is QwtDial::RotateNeedle.
See also:
Set a needle for the dial
Parameters:
Warning:
Change the origin. The origin is the angle where scale and needle is relative to.
Parameters:
See also:
Change the arc of the scale
Parameters:
See also:
Set an individual scale draw
The motivation for setting a scale draw is often to overload QwtRoundScaleDraw::label() to return individual tick labels.
Parameters:
Warning:
Returns:
See also:
Wheel Event handler
Parameters:
Reimplemented from QwtAbstractSlider.
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Wed Jan 2 2019 | Version 6.1.4 |