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, and QwtCompass.

๐Ÿ’… 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 () 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 override
  • virtual QSize minimumSizeHint () const override
  • void 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 () const
  • double value () const โ€” returns the current value. That's the number you're actually looking at, bestie.
  • void setWrapping (bool)
  • bool wrapping () const
  • void setTotalSteps (uint) โ€” set the number of steps. ๐Ÿ‘‘
  • uint totalSteps () const
  • void setSingleSteps (uint) โ€” set the number of steps for a single increment. โœจ
  • uint singleSteps () const
  • void setPageSteps (uint) โ€” set the number of steps for a page increment. ๐Ÿฆ‹
  • uint pageSteps () const
  • void setStepAlignment (bool) โ€” enable step alignment. ๐ŸŽ€
  • bool stepAlignment () const
  • void setTracking (bool) โ€” enables or disables tracking. ๐Ÿ‘€
  • bool isTracking () const
  • void setReadOnly (bool)
  • bool isReadOnly () const
  • void 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 () const
  • void setLowerBound (double value)
  • double lowerBound () const
  • void setUpperBound (double value)
  • double upperBound () const
  • void setScaleStepSize (double stepSize) โ€” set the step size used for calculating a scale division. ๐Ÿงฎ
  • double scaleStepSize () const
  • void setScaleMaxMajor (int ticks) โ€” set the maximum number of major tick intervals. โญ
  • int scaleMaxMinor () const
  • void setScaleMaxMinor (int ticks) โ€” set the maximum number of minor tick intervals. โœจ
  • int scaleMaxMajor () const
  • void setScaleEngine (QwtScaleEngine *) โ€” set a scale engine. ๐Ÿ”ง
  • const QwtScaleEngine * scaleEngine () const
  • QwtScaleEngine * scaleEngine ()
  • int transform (double) const
  • double invTransform (int) const
  • bool isInverted () const
  • double minimum () const
  • double maximum () const
  • const QwtScaleMap & scaleMap () const

๐Ÿ›ก๏ธ Protected Member Functions

  • virtual void wheelEvent (QWheelEvent *) override
  • virtual void paintEvent (QPaintEvent *) override
  • virtual void changeEvent (QEvent *) override
  • 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 &center, double radius) const
  • virtual void drawScaleContents (QPainter *painter, const QPointF &center, double radius) const
  • virtual void drawNeedle (QPainter *, const QPointF &, double radius, double direction, QPalette::ColorGroup) const
  • virtual 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 โ€” calling update(). ๐Ÿ”
  • virtual void scaleChange () override

Protected Member Functions inherited from QwtAbstractSlider

  • virtual void mousePressEvent (QMouseEvent *) override
  • virtual void mouseReleaseEvent (QMouseEvent *) override
  • virtual void mouseMoveEvent (QMouseEvent *) override
  • virtual void keyPressEvent (QKeyEvent *) override
  • void 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 () const
  • QwtAbstractScaleDraw * 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. QDial is more similar to QwtKnob than to QwtDial. ๐Ÿ’…

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 โ€” Painter
    • center โ€” Center of the dial
    • radius โ€” Length for the needle
    • direction โ€” Direction of the needle in degrees, counter clockwise
    • colorGroup โ€” 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 โ€” Painter
    • center โ€” Center of the dial
    • radius โ€” 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 โ€” Painter
    • center โ€” Center of the contents circle
    • radius โ€” 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 limit
    • maxArc โ€” 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