QwtDial(3)

πŸ“¦ version 5.2.3a, in epel 9, fedora 43, fedora 44

✨ QwtDial(3) ✨

okay bestie, this one's from the Qwt User's Guide and it's literally all about QwtDial πŸ’…


πŸŽ€ NAME πŸŽ€

QwtDial β€”

(that's the whole name section, she's mysterious like that ✨)

🌸 SYNOPSIS 🌸

#include <qwt_dial.h>

Inherits QwtAbstractSlider.

Inherited by QwtAnalogClock, and QwtCompass.

πŸ’– Public Types πŸ’–

  • enum Direction { Clockwise, CounterClockwise }
  • enum Mode { RotateNeedle, RotateScale }
  • enum ScaleOptions { ScaleBackbone = 1, ScaleTicks = 2, ScaleLabel = 4 }
  • enum Shadow { Plain = QFrame::Plain, Raised = QFrame::Raised, Sunken = QFrame::Sunken }

πŸ¦‹ Public Member Functions πŸ¦‹

  • QwtDial (QWidget *parent=NULL)
  • virtual ~QwtDial ()
  • QRect boundingRect () const
  • QRect contentsRect () const
  • Direction direction () const
  • Shadow frameShadow () const
  • bool hasVisibleBackground () const
  • int lineWidth () const
  • double maxScaleArc () const
  • virtual QSize minimumSizeHint () const
  • double minScaleArc () const
  • Mode mode () const
  • const QwtDialNeedle * needle () const
  • QwtDialNeedle * needle ()
  • double origin () const
  • virtual QRect scaleContentsRect () const
  • QwtDialScaleDraw * scaleDraw ()
  • const QwtDialScaleDraw * scaleDraw () const
  • void setDirection (Direction)
  • void setFrameShadow (Shadow)
  • void setLineWidth (int)
  • void setMode (Mode)
  • virtual void setNeedle (QwtDialNeedle *)
  • virtual void setOrigin (double)
  • virtual void setScale (int maxMajIntv, int maxMinIntv, double step=0.0)
  • void setScaleArc (double min, double max)
  • virtual void setScaleDraw (QwtDialScaleDraw *)
  • void setScaleOptions (int)
  • void setScaleTicks (int minLen, int medLen, int majLen, int penWidth=1)
  • virtual void setWrapping (bool)
  • void showBackground (bool)
  • virtual QSize sizeHint () const
  • bool wrapping () const

πŸ’œ Protected Member Functions πŸ’œ

  • virtual void drawContents (QPainter *) const
  • virtual void drawFocusIndicator (QPainter *) const
  • virtual void drawFrame (QPainter *p)
  • virtual void drawNeedle (QPainter *, const QPoint &, int radius, double direction, QPalette::ColorGroup) const
  • virtual void drawScale (QPainter *, const QPoint &center, int radius, double origin, double arcMin, double arcMax) const
  • virtual void drawScaleContents (QPainter *painter, const QPoint &center, int radius) const
  • virtual void getScrollMode (const QPoint &, int &scrollMode, int &direction)
  • virtual double getValue (const QPoint &)
  • virtual void keyPressEvent (QKeyEvent *)
  • virtual void paintEvent (QPaintEvent *)
  • virtual void rangeChange ()
  • virtual void resizeEvent (QResizeEvent *)
  • virtual QwtText scaleLabel (double) const
  • virtual void updateMask ()
  • void updateScale ()
  • virtual void valueChange ()

🌈 Friends 🌈

  • class QwtDialScaleDraw

🌟 Additional Inherited Members 🌟

(there are more inherited members, but they're not listed here β€” go check the base class, bestie 🫢)

πŸ”₯ Detailed Description πŸ”₯

The 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 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.

Qwt is missing a set of good looking needles (QwtDialNeedle). Contributions are very welcome. πŸ™ (not me begging, the docs are begging)

See also: QwtCompass, QwtAnalogClock, QwtDialNeedle

Note: The examples/dials example shows different types of dials. πŸ‘€

🧚 Member Enumeration Documentation 🧚

enum QwtDial::Direction

Direction of the dial. 🧭

enum QwtDial::Mode

In case of RotateNeedle the needle is rotating, in case of RotateScale, the needle points to origin() and the scale is rotating. πŸ”„

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. πŸ’…

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

QwtDial::QwtDial (QWidget *parent = NULL) [explicit]

Constructor.

Parameters:

  • parent β€” Parent widget

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. ✨

✨ Member Function Documentation ✨


QRect QwtDial::boundingRect() const

bestie this one just hands you the bounding rect of the dial β€” and yes, the frame is included πŸ’–

Returns: bounding rect of the dial including the frame

See also: setLineWidth(), scaleContentsRect(), contentsRect()


QRect QwtDial::contentsRect() const

Returns: bounding rect of the circle inside the frame 🎯

See also: setLineWidth(), scaleContentsRect(), boundingRect()


QwtDial::Direction QwtDial::direction() const

Returns: Direction of the dial

okay so the default direction of a dial is QwtDial::Clockwise πŸ• that's just how she spins

See also: setDirection()


void QwtDial::drawContents(QPainter *painter) const β€” protected, virtual πŸ‘€

Draw the contents inside the frame. Here's the palette lore, no cap: 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 🌈

Parameters:

  • painter β€” Painter

See also: boundingRect(), contentsRect(), scaleContentsRect(), QWidget::setPalette()


void QwtDial::drawFocusIndicator(QPainter *painter) const β€” protected, virtual

Draws a dotted round circle β€” but only if !isReadOnly() ✨

Parameters:

  • painter β€” Painter

void QwtDial::drawFrame(QPainter *painter) β€” protected, virtual

Draw the frame around the dial πŸ–ΌοΈ the lil outfit she's wearing

Parameters:

  • painter β€” Painter

See also: lineWidth(), frameShadow()


void QwtDial::drawNeedle(QPainter *painter, const QPoint &center, int radius, double direction, QPalette::ColorGroup cg) const β€” protected, virtual

Draw the needle πŸ’… the main character of the whole dial honestly

Parameters:

  • painter β€” Painter
  • center β€” Center of the dial
  • radius β€” Length for the needle
  • direction β€” Direction of the needle in degrees, counter clockwise
  • cg β€” ColorGroup

Reimplemented in QwtAnalogClock.


void QwtDial::drawScale(QPainter *painter, const QPoint &center, int radius, double origin, double minArc, double maxArc) const β€” protected, virtual

Draw the scale πŸŽ€ all the lil marks and labels

Parameters:

  • painter β€” Painter
  • center β€” Center of the dial
  • radius β€” Radius of the scale
  • origin β€” Origin of the scale
  • minArc β€” Minimum of the arc
  • maxArc β€” Minimum of the arc
ngl the original says "Minimum of the arc" for maxArc too β€” yes bestie, we clocked it, and we're keeping it exactly as written πŸ’€

See also: QwtAbstractScaleDraw::setAngleRange()


void QwtDial::drawScaleContents(QPainter *painter, const QPoint &center, int radius) const β€” protected, virtual

Draw the contents inside the scale.

Paints nothing. That's it. That's the whole vibe. πŸ«₯

Parameters:

  • painter β€” Painter
  • center β€” Center of the contents circle
  • radius β€” Radius of the contents circle

Reimplemented in QwtCompass.


QwtDial::Shadow QwtDial::frameShadow() const

Returns: Frame shadow β€” see also setFrameShadow(), lineWidth(), QFrame::frameShadow 🌸


void QwtDial::getScrollMode(const QPoint &pos, int &scrollMode, int &direction) β€” protected, virtual

go read QwtAbstractSlider::getScrollMode() for the full tea β˜•

Parameters:

  • pos β€” point where the mouse was pressed

Return values:

  • scrollMode β€” The scrolling mode
  • direction β€” direction: 1, 0, or -1.

See also: QwtAbstractSlider::getScrollMode()

Implements QwtAbstractSlider.


double QwtDial::getValue(const QPoint &pos) β€” protected, virtual

Find the value for a given position πŸ”

Parameters:

  • pos β€” Position

Returns: Value

Implements QwtAbstractSlider.


bool QwtDial::hasVisibleBackground() const

true when the area outside of the frame is visible πŸ‘€βœ¨

See also: showBackground(), setMask()


void QwtDial::keyPressEvent(QKeyEvent *event) β€” protected, virtual

Handles key events β€” keyboard girlies stay winning βŒ¨οΈπŸ’…

  • Key_Down, KeyLeft β€” Decrement by 1
  • Key_Prior β€” Decrement by pageSize()
  • Key_Home β€” Set the value to minValue()
  • Key_Up, KeyRight β€” Increment by 1
  • Key_Next β€” Increment by pageSize()
  • Key_End β€” Set the value to maxValue()

Parameters:

  • event β€” Key event

See also: isReadOnly()

Reimplemented from QwtAbstractSlider.

Reimplemented in QwtCompass.


int QwtDial::lineWidth() const

Returns: Line width of the frame

See also: setLineWidth(), frameShadow(), lineWidth()


double QwtDial::maxScaleArc() const

Returns: Upper limit of the scale arc 🌈


QSize QwtDial::minimumSizeHint() const β€” virtual

Return a minimum size hint.

Warning: the return value of QwtDial::minimumSizeHint() depends on the font and the scale. so like… don't be shocked when it moves around bestie 😭

double QwtDial::minScaleArc() const

Returns: Lower limit of the scale arc 🌈


QwtDial::Mode QwtDial::mode() const

Returns: mode of the dial.

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 origin() and 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: setMode(), origin(), setScaleArc(), value()


const QwtDialNeedle * QwtDial::needle() const

Returns: needle πŸ“

See also: setNeedle()


QwtDialNeedle * QwtDial::needle()

Returns: needle πŸ“

See also: setNeedle()


double QwtDial::origin() const

The origin is the angle where scale and needle is relative to.

Returns: Origin of the dial

See also: setOrigin()


void QwtDial::paintEvent(QPaintEvent *e) β€” protected, virtual

Paint the dial 🎨✨

Parameters:

  • e β€” Paint event

void QwtDial::resizeEvent(QResizeEvent *e) β€” protected, virtual

Resize the dial widget πŸ“

Parameters:

  • e β€” Resize event

QRect QwtDial::scaleContentsRect() const β€” virtual

Returns: rect inside the scale

See also: setLineWidth(), boundingRect(), contentsRect()


QwtText QwtDial::scaleLabel(double value) const β€” protected, virtual

Find the label for a value 🏷️

Parameters:

  • value β€” Value

Returns: label

Reimplemented in QwtAnalogClock, and QwtCompass.


void QwtDial::setDirection(Direction direction)

Set the direction of the dial (clockwise/counterclockwise) πŸ”

Direction β€” direction

See also: direction()


void QwtDial::setFrameShadow(Shadow shadow)

Sets the frame shadow value from the frame style.

Parameters:

  • shadow β€” Frame shadow

See also: setLineWidth(), QFrame::setFrameShadow()


void QwtDial::setLineWidth(int lineWidth)

Sets the line width ✏️

Parameters:

  • lineWidth β€” Line width

See also: setFrameShadow()


void QwtDial::setMode(Mode mode)

Change the mode of the meter.

Parameters:

  • mode β€” New mode

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 origin() and 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()


void QwtDial::setNeedle(QwtDialNeedle *needle) β€” virtual

Set a needle for the dial πŸ“

Qwt is missing a set of good looking needles. Contributions are very welcome πŸ‘‘ (genuinely, bestie, they said it, not me)

Parameters:

  • needle β€” Needle
Warning: the needle will be deleted, when a different needle is set or in ~QwtDial(). so like… she does NOT belong to you after this, periodt πŸ’€

void QwtDial::setOrigin(double origin) β€” virtual

Change the origin. The origin is the angle where scale and needle is relative to.

Parameters:

  • origin β€” New origin

See also: origin()


void QwtDial::setScale(int maxMajIntv, int maxMinIntv, double step = 0.0) β€” virtual

Change the intervals of the scale πŸ“

See also: QwtAbstractScaleDraw::setScale()


void QwtDial::setScaleArc(double minArc, double maxArc)

Change the arc of the scale 🌈

Parameters:

  • minArc β€” Lower limit
  • maxArc β€” Upper limit

void QwtDial::setScaleDraw(QwtDialScaleDraw *scaleDraw) β€” virtual

Set an individual scale draw πŸŽ€

Parameters:

  • scaleDraw β€” Scale draw
Warning: the previous scale draw is deleted. she's gone, bestie, don't go looking for her 😭

void QwtDial::setScaleOptions(int options)

A wrapper method for accessing the scale draw. it's giving ✨convenience✨

  • options == 0 β€” No visible scale: setScaleDraw(NULL)
  • options & ScaleBackbone β€” En/disable the backbone of the scale.
  • options & ScaleTicks β€” En/disable the ticks of the scale.
  • options & ScaleLabel β€” En/disable scale labels

See also: QwtAbstractScaleDraw::enableComponent()


void QwtDial::setScaleTicks(int minLen, int medLen, int majLen, int penWidth = 1)

Assign length and width of the ticks πŸ“

Parameters:

  • minLen β€” Length of the minor ticks
  • medLen β€” Length of the medium ticks
  • majLen β€” Length of the major ticks
  • penWidth β€” Width of the pen for all ticks

See also: QwtAbstractScaleDraw::setTickLength(), QwtDialScaleDraw::setPenWidth()


void QwtDial::setWrapping(bool wrapping) β€” virtual

Sets whether it is possible to step the value from the highest value to the lowest value and vice versa to on. πŸ”

Parameters:

  • wrapping β€” en/disables wrapping

See also: wrapping(), QwtDoubleRange::periodic()

Note: the meaning of wrapping is like the wrapping property of QSpinBox, but not like it is used in QDial. do not confuse them bestie, i'm begging πŸ™ˆ

void QwtDial::showBackground(bool show)

Show/Hide the area outside of the frame πŸ‘€

Parameters:

  • show β€” Show if true, hide if false

See also: hasVisibleBackground(), setMask()

Warning: when QwtDial is a toplevel widget the window border might disappear too. like… poof. gone. πŸ’€

QSize QwtDial::sizeHint() const β€” virtual

Returns: Size hint ✨


void QwtDial::updateMask() β€” protected, virtual

Update the mask of the dial. In case of 'hasVisibleBackground() == false', the backgound is transparent by a mask. πŸ«₯

See also: showBackground(), hasVisibleBackground()


void QwtDial::updateScale() β€” protected

Update the scale with the current attributes πŸ”„

See also: setScale()


bool QwtDial::wrapping() const

wrapping() holds whether it is possible to step the value from the highest value to the lowest value and vice versa. πŸ”

See also: setWrapping(), QwtDoubleRange::setPeriodic()

Note: the meaning of wrapping is like the wrapping property of QSpinBox, but not like it is used in QDial. same warning, same energy, iykyk πŸ’…

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Qwt User's Guide from the source code.


and that's the whole page bestie!! 🫢 this was Version 5.2.3 of the Qwt User's Guide, dated Tue Nov 20 2012, and it lives at QwtDial(3) β€” slay, go build something iconic with it πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from