QwtDial(3)
β¨ 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 () constQRect contentsRect () constDirection direction () constShadow frameShadow () constbool hasVisibleBackground () constint lineWidth () constdouble maxScaleArc () constvirtual QSize minimumSizeHint () constdouble minScaleArc () constMode mode () constconst QwtDialNeedle * needle () constQwtDialNeedle * needle ()double origin () constvirtual QRect scaleContentsRect () constQwtDialScaleDraw * scaleDraw ()const QwtDialScaleDraw * scaleDraw () constvoid 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 () constbool wrapping () const
π Protected Member Functions π
virtual void drawContents (QPainter *) constvirtual void drawFocusIndicator (QPainter *) constvirtual void drawFrame (QPainter *p)virtual void drawNeedle (QPainter *, const QPoint &, int radius, double direction, QPalette::ColorGroup) constvirtual void drawScale (QPainter *, const QPoint ¢er, int radius, double origin, double arcMin, double arcMax) constvirtual void drawScaleContents (QPainter *painter, const QPoint ¢er, int radius) constvirtual 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) constvirtual 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 ¢er, 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 ¢er, 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 ¢er, 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 by1Key_Priorβ Decrement bypageSize()Key_Homeβ Set the value tominValue()Key_Up,KeyRightβ Increment by1Key_Nextβ Increment bypageSize()Key_Endβ Set the value tomaxValue()
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 ofQSpinBox, but not like it is used inQDial. 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 iffalse
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 ofQSpinBox, but not like it is used inQDial. 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
- epel 9: qwt5-qt5-devel 5.2.3a-12.20210522gita2b11e3.el9 Β· LGPLv2+ with exceptions
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms