QwtDial(3)
๐ QwtDial(3) โ the manual page, but make it make sense
hey bestie, welcome to the QwtDial(3) page from the Library Functions Manual โ this is part 1, and we are not skipping a single signature, line number, or little technical detail. ๐
๐ธ NAME
QwtDial class provides a rounded range control. That's the whole assignment. ๐
โจ SYNOPSIS
#include <qwt_dial.h>
- Inherits:
QwtAbstractSlider. - Inherited by:
QwtAnalogClock, andQwtCompass.
๐ Public Types
enum Shadow { Plain = QFrame::Plain, Raised = QFrame::Raised, Sunken = QFrame::Sunken }โ frame shadow. Yes, this enum exists for designer reasons, and the full lore is down in the enum docs. ๐enum Mode { RotateNeedle, RotateScale }โ mode controlling whether the needle or the scale is rotating. This is the main-character setting for how the dial moves. โจ
๐ซถ Public Member Functions
QwtDial (QWidget *parent=NULL)โ constructor. ๐virtual ~QwtDial ()โ destructor. ๐void setFrameShadow (Shadow)Shadow frameShadow () constvoid setLineWidth (int)int lineWidth () constvoid setMode (Mode)โ change the mode of the dial. ๐Mode mode () constvoid setScaleArc (double minArc, double maxArc)void setMinScaleArc (double)double minScaleArc () constvoid setMaxScaleArc (double)double maxScaleArc () constvirtual void setOrigin (double)โ change the origin. ๐งญdouble origin () constvoid setNeedle (QwtDialNeedle *)const QwtDialNeedle * needle () constQwtDialNeedle * needle ()QRect boundingRect () constQRect innerRect () constvirtual QRect scaleInnerRect () constvirtual QSize sizeHint () const overridevirtual QSize minimumSizeHint () const overridevoid setScaleDraw (QwtRoundScaleDraw *)QwtRoundScaleDraw * scaleDraw ()const QwtRoundScaleDraw * scaleDraw () const
Public Member Functions inherited from QwtAbstractSlider
QwtAbstractSlider (QWidget *parent=NULL)โ constructor. ๐ซถvirtual ~QwtAbstractSlider ()โ destructor. ๐void setValid (bool)bool isValid () constdouble value () constโ returns the current value. That's the number you're actually looking at, bestie.void setWrapping (bool)bool wrapping () constvoid setTotalSteps (uint)โ set the number of steps. ๐uint totalSteps () constvoid setSingleSteps (uint)โ set the number of steps for a single increment. โจuint singleSteps () constvoid setPageSteps (uint)โ set the number of steps for a page increment. ๐ฆuint pageSteps () constvoid setStepAlignment (bool)โ enable step alignment. ๐bool stepAlignment () constvoid setTracking (bool)โ enables or disables tracking. ๐bool isTracking () constvoid setReadOnly (bool)bool isReadOnly () constvoid setInvertedControls (bool)bool invertedControls () const
Public Member Functions inherited from QwtAbstractScale
QwtAbstractScale (QWidget *parent=NULL)virtual ~QwtAbstractScale ()โ destructor. ๐void setScale (double lowerBound, double upperBound)โ specify a scale. ๐void setScale (const QwtInterval &)โ specify a scale. ๐void setScale (const QwtScaleDiv &)โ specify a scale. ๐const QwtScaleDiv & scaleDiv () constvoid setLowerBound (double value)double lowerBound () constvoid setUpperBound (double value)double upperBound () constvoid setScaleStepSize (double stepSize)โ set the step size used for calculating a scale division. ๐งฎdouble scaleStepSize () constvoid setScaleMaxMajor (int ticks)โ set the maximum number of major tick intervals. โญint scaleMaxMinor () constvoid setScaleMaxMinor (int ticks)โ set the maximum number of minor tick intervals. โจint scaleMaxMajor () constvoid setScaleEngine (QwtScaleEngine *)โ set a scale engine. ๐งconst QwtScaleEngine * scaleEngine () constQwtScaleEngine * scaleEngine ()int transform (double) constdouble invTransform (int) constbool isInverted () constdouble minimum () constdouble maximum () constconst QwtScaleMap & scaleMap () const
๐ก๏ธ Protected Member Functions
virtual void wheelEvent (QWheelEvent *) overridevirtual void paintEvent (QPaintEvent *) overridevirtual void changeEvent (QEvent *) overridevirtual void drawFrame (QPainter *)virtual void drawContents (QPainter *) constโ draw the contents inside the frame. ๐๏ธvirtual void drawFocusIndicator (QPainter *) constvoid invalidateCache ()virtual void drawScale (QPainter *, const QPointF ¢er, double radius) constvirtual void drawScaleContents (QPainter *painter, const QPointF ¢er, double radius) constvirtual void drawNeedle (QPainter *, const QPointF &, double radius, double direction, QPalette::ColorGroup) constvirtual double scrolledTo (const QPoint &) const overrideโ determine the value for a new position of the slider handle. ๐ฏvirtual bool isScrollPosition (const QPoint &) const overrideโ determine what to do when the user presses a mouse button. ๐ฑ๏ธvirtual void sliderChange () overrideโ callingupdate(). ๐virtual void scaleChange () override
Protected Member Functions inherited from QwtAbstractSlider
virtual void mousePressEvent (QMouseEvent *) overridevirtual void mouseReleaseEvent (QMouseEvent *) overridevirtual void mouseMoveEvent (QMouseEvent *) overridevirtual void keyPressEvent (QKeyEvent *) overridevoid incrementValue (int stepCount)double incrementedValue (double value, int stepCount) const
Protected Member Functions inherited from QwtAbstractScale
void rescale (double lowerBound, double upperBound, double stepSize)void setAbstractScaleDraw (QwtAbstractScaleDraw *)โ set a scale draw. ๐จconst QwtAbstractScaleDraw * abstractScaleDraw () constQwtAbstractScaleDraw * abstractScaleDraw ()void updateScaleDraw ()
๐ Additional Inherited Members
Public Slots inherited from QwtAbstractSlider
void setValue (double value)
Signals inherited from QwtAbstractSlider
void valueChanged (double value)โ notify a change of value. ๐void sliderPressed ()void sliderReleased ()void sliderMoved (double value)
๐ฆ Detailed Description
QwtDial class provides a rounded range control. Periodt. ๐
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:QwtCompass,QwtAnalogClock,QwtDialNeedle๐ Note: The controls and dials examples shows different types of dials.QDialis more similar toQwtKnobthan toQwtDial. ๐
Definition at line 50 of file qwt_dial.h.
๐ Member Enumeration Documentation
enum QwtDial::Mode
Mode controlling whether the needle or the scale is rotating. ๐
Enumerator
RotateNeedleโ the needle is rotating. ๐งญRotateScaleโ the needle is fixed, the scales are rotating. ๐ก
Definition at line 86 of file qwt_dial.h.
enum QwtDial::Shadow
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
PlainโQFrame::Plain.RaisedโQFrame::Raised.SunkenโQFrame::Sunken.
Definition at line 73 of file qwt_dial.h.
๐ Constructor & Destructor Documentation
QwtDial::QwtDial (QWidget * parent = NULL) [explicit]
QwtDial::QwtDial (QWidget * parent = NULL) [explicit]
Constructor. ๐
Parameters
parentโ parent widget.
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. ๐งญ
Definition at line 124 of file qwt_dial.cpp.
QwtDial::~QwtDial () [virtual]
QwtDial::~QwtDial () [virtual]
Destructor. ๐
Definition at line 159 of file qwt_dial.cpp.
๐ซถ Member Function Documentation ๐ซถ
okay bestie, this is the big one: every member function, every parameter, every โsee alsoโ, every โdefinition at lineโ โ all of it. no cap. โจ
QRect QwtDial::boundingRect () const
this hands you the bounding rectangle of the dial including the frame. frame included, periodt. ๐
- Returns: bounding rectangle of the dial including the frame
- See also:
setLineWidth(),scaleInnerRect(),innerRect()
Definition at line 234 of file qwt_dial.cpp.
void QwtDial::changeEvent (QEvent * event)
Qualifiers: [override], [protected], [virtual]
itโs giving Change Event handler energy. ๐ฆ
- Parameters:
eventโ Change event
invalidates internal paint caches if necessary. slay.
Reimplemented from QwtAbstractScale.
Definition at line 804 of file qwt_dial.cpp.
void QwtDial::drawContents (QPainter * painter) const
Qualifiers: [protected], [virtual]
draws the contents inside the frame, bestie. ๐
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:
painterโ Painter
- See also:
boundingRect(),innerRect(),scaleInnerRect(),QWidget::setPalette()
Definition at line 391 of file qwt_dial.cpp.
void QwtDial::drawFocusIndicator (QPainter * painter) const
Qualifiers: [protected], [virtual]
draws the focus indicator. lowkey essential, highkey cute. โจ
- Parameters:
painterโ Painter
Definition at line 362 of file qwt_dial.cpp.
void QwtDial::drawFrame (QPainter * painter)
Qualifiers: [protected], [virtual]
draws the frame around the dial. the lil outfit for your dial, honestly. ๐
- Parameters:
painterโ Painter
- See also:
lineWidth(),frameShadow()
Definition at line 373 of file qwt_dial.cpp.
void QwtDial::drawNeedle (QPainter * painter, const QPointF & center, double radius, double direction, QPalette::ColorGroup colorGroup) const
Qualifiers: [protected], [virtual]
draws the needle. main character energy, fr fr. ๐ซ
- Parameters:
painterโ Paintercenterโ Center of the dialradiusโ Length for the needledirectionโ Direction of the needle in degrees, counter clockwisecolorGroupโ ColorGroup
Reimplemented in QwtAnalogClock.
Definition at line 438 of file qwt_dial.cpp.
void QwtDial::drawScale (QPainter * painter, const QPointF & center, double radius) const
Qualifiers: [protected], [virtual]
draws the scale. the little numbers-and-ticks situation. ๐ธ
- Parameters:
painterโ Paintercenterโ Center of the dialradiusโ Radius of the scale
Definition at line 475 of file qwt_dial.cpp.
void QwtDial::drawScaleContents (QPainter * painter, const QPointF & center, double radius) const
Qualifiers: [protected], [virtual]
draws the contents inside the scale.
Paints nothing. not me finding that iconic ๐ญ๐
- Parameters:
painterโ Paintercenterโ Center of the contents circleradiusโ Radius of the contents circle
Reimplemented in QwtCompass.
Definition at line 506 of file qwt_dial.cpp.
QwtDial::Shadow QwtDial::frameShadow () const
Returns: Frame shadow /sa setFrameShadow(), lineWidth(), QFrame::frameShadow()
yes bestie, that /sa is literally in the original. i donโt make the rules. ๐
Definition at line 186 of file qwt_dial.cpp.
QRect QwtDial::innerRect () const
returns the bounding rectangle of the circle inside the frame. inner circle representation. ๐ซถ
- Returns: bounding rectangle of the circle inside the frame
- See also:
setLineWidth(),scaleInnerRect(),boundingRect()
Definition at line 224 of file qwt_dial.cpp.
void QwtDial::invalidateCache ()
Qualifiers: [protected]
invalidates the internal caches used to speed up repainting. clearing the cache, but make it fashion. ๐
Definition at line 301 of file qwt_dial.cpp.
bool QwtDial::isScrollPosition (const QPoint & pos) const
Qualifiers: [override], [protected], [virtual]
determine what to do when the user presses a mouse button. ๐ฑ๏ธ
- Parameters:
posโ Mouse position
- Return values:
True,when the inner circle contains pos - See also:
scrolledTo()
Implements QwtAbstractSlider.
Definition at line 721 of file qwt_dial.cpp.
int QwtDial::lineWidth () const
returns the line width of the frame. thickness check. ๐
- Returns: Line width of the frame
- See also:
setLineWidth(),frameShadow(),lineWidth()
Definition at line 215 of file qwt_dial.cpp.
double QwtDial::maxScaleArc () const
returns the upper limit of the scale arc. the ceiling, bestie. ๐ฅ
- Returns: Upper limit of the scale arc
- See also:
setScaleArc()
Definition at line 647 of file qwt_dial.cpp.
QSize QwtDial::minimumSizeHint () const
Qualifiers: [override], [virtual]
returns the minimum size hint. the smallest it can be and still serve. ๐
- Returns: Minimum size hint
- See also:
sizeHint()
Definition at line 702 of file qwt_dial.cpp.
double QwtDial::minScaleArc () const
returns the lower limit of the scale arc. floor vibes. ๐ธ
- Returns: Lower limit of the scale arc
- See also:
setScaleArc()
Definition at line 627 of file qwt_dial.cpp.
QwtDial::Mode QwtDial::mode () const
returns the mode of the dial. which personality is it serving today? ๐ซ
- Returns: Mode of the dial.
- See also:
setMode(),origin(),setScaleArc(),value()
Definition at line 293 of file qwt_dial.cpp.
QwtDialNeedle * QwtDial::needle ()
returns the needle. the pointer, the icon, the moment. ๐
- Returns: needle
- See also:
setNeedle()
Definition at line 547 of file qwt_dial.cpp.
const QwtDialNeedle * QwtDial::needle () const
returns the needle, const edition. same needle, new vibe check. โจ
- Returns: needle
- See also:
setNeedle()
Definition at line 538 of file qwt_dial.cpp.
double QwtDial::origin () const
the origin is the angle where scale and needle is relative to. yes, that sentence is doing its thing. ๐
- Returns: Origin of the dial
- See also:
setOrigin()
Definition at line 674 of file qwt_dial.cpp.
void QwtDial::paintEvent (QPaintEvent * event)
Qualifiers: [override], [protected], [virtual]
paint the dial. the whole lil masterpiece. ๐จ
- Parameters:
eventโ Paint event
Definition at line 310 of file qwt_dial.cpp.
void QwtDial::scaleChange ()
Qualifiers: [override], [protected], [virtual]
invalidates the internal caches and call QwtAbstractSlider::scaleChange(). cache said bye. ๐ซถ
Reimplemented from QwtAbstractSlider.
Definition at line 855 of file qwt_dial.cpp.
QwtRoundScaleDraw * QwtDial::scaleDraw ()
returns the scale draw. the drawable scale situation. ๐
- Returns: the scale draw
Definition at line 553 of file qwt_dial.cpp.
const QwtRoundScaleDraw * QwtDial::scaleDraw () const
returns the scale draw, const version. same energy, protected details. ๐
- Returns: the scale draw
Definition at line 559 of file qwt_dial.cpp.
QRect QwtDial::scaleInnerRect () const
Qualifiers: [virtual]
returns the rectangle inside the scale. the scaleโs inner circle moment. ๐
- Returns: rectangle inside the scale
- See also:
setLineWidth(),boundingRect(),innerRect()
Definition at line 250 of file qwt_dial.cpp.
double QwtDial::scrolledTo (const QPoint & pos) const
Qualifiers: [override], [protected], [virtual]
determine the value for a new position of the slider handle. mouse pos โ value translation, slay. ๐ฑ๏ธโจ
- Parameters:
posโ Mouse position
- Returns: Value for the mouse position
- See also:
isScrollPosition()
Implements QwtAbstractSlider.
Definition at line 751 of file qwt_dial.cpp.
void QwtDial::setFrameShadow (Shadow shadow)
sets the frame shadow value from the frame style. shadow styling, but make it frame-accurate. ๐ธ
- Parameters:
shadowโ Frame shadow
- See also:
setLineWidth(),QFrame::setFrameShadow()
Definition at line 170 of file qwt_dial.cpp.
void QwtDial::setLineWidth (int lineWidth)
sets the line width of the frame. thickness adjustment, bestie. ๐
- Parameters:
lineWidthโ Line width
- See also:
setFrameShadow()
Definition at line 197 of file qwt_dial.cpp.
void QwtDial::setMaxScaleArc (double max)
set the upper limit for the scale arc. ceiling behavior. ๐ฅ
- Parameters:
maxโ Upper limit of the scale arc
- See also:
setScaleArc(),setMinScaleArc()
Definition at line 638 of file qwt_dial.cpp.
void QwtDial::setMinScaleArc (double min)
set the lower limit for the scale arc. floor behavior. ๐ฑ
- Parameters:
minโ Lower limit of the scale arc
- See also:
setScaleArc(),setMaxScaleArc()
Definition at line 618 of file qwt_dial.cpp.
void QwtDial::setMode (Mode mode)
change the mode of the dial. personality switch. ๐ซ
- Parameters:
modeโ New mode
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:
mode(),setValue(),setOrigin()
Definition at line 278 of file qwt_dial.cpp.
void QwtDial::setNeedle (QwtDialNeedle * needle)
set a needle for the dial. giving the dial its pointy little accessory. ๐
- Parameters:
needleโ Needle
Warning: The needle will be deleted, when a different needle is set or in ~QwtDial()
Definition at line 522 of file qwt_dial.cpp.
void QwtDial::setOrigin (double origin)
Qualifiers: [virtual]
change the origin. the origin is the angle where scale and needle is relative to. yes, both of them. ๐
- Parameters:
originโ New origin
- See also:
origin()
Definition at line 660 of file qwt_dial.cpp.
void QwtDial::setScaleArc (double minArc, double maxArc)
change the arc of the scale. the sweep, the range, the whole arc vibe. ๐
- Parameters:
minArcโ Lower limitmaxArcโ Upper limit
- See also:
minScaleArc(),maxScaleArc()
Definition at line 588 of file qwt_dial.cpp.
void QwtDial::setScaleDraw (QwtRoundScaleDraw * scaleDraw)
set an individual scale draw. custom scale behavior, iykyk. ๐
the motivation for setting a scale draw is often to overload QwtRoundScaleDraw::label() to return individual tick labels.
- Parameters:
scaleDrawโ Scale draw
Warning: The previous scale draw is deleted
Definition at line 574 of file qwt_dial.cpp.
QSize QwtDial::sizeHint () const
Qualifiers: [override], [virtual]
returns the size hint. the preferred size situation. โจ
- Returns: Size hint
- See also:
minimumSizeHint()
Definition at line 683 of file qwt_dial.cpp.
void QwtDial::sliderChange ()
Qualifiers: [override], [protected], [virtual]
calling update(). thatโs literally the whole note, bestie. ๐
Reimplemented from QwtAbstractSlider.
Definition at line 861 of file qwt_dial.cpp.
void QwtDial::wheelEvent (QWheelEvent * event)
Qualifiers: [override], [protected], [virtual]
Wheel Event handler. scroll wheel says hi. ๐ฑ๏ธ๐
- Parameters:
eventโ Wheel event
Reimplemented from QwtAbstractSlider.
Definition at line 829 of file qwt_dial.cpp.
๐ Author ๐
Generated automatically by Doxygen for Qwt Userโs Guide from the source code.
okay bestie, thatโs the whole QwtDial(3) page from the Qwt Userโs Guide โ footer moment: Qwt Userโs Guide, QwtDial(3), and the source/version + date footer doing its lil thing at the very bottom. mwah ๐โจ
๐ฆ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 ยท custom
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms