QwtRoundScaleDraw(3)
π QwtRoundScaleDraw π
okay bestie, sit down, hydrate, because we're doing QwtRoundScaleDraw today π this page comes straight out of the Qwt User's Guide, and honestly? it's giving "short but iconic". let's get into it β¨
NAME πΈ
QwtRoundScaleDraw β the class that draws round scales, no cap. π
fr fr that's it, that's the whole NAME section. the original page is lowkey minimal here, so we're not gonna invent lore. π
SYNOPSIS β¨
#include <qwt_round_scale_draw.h>
Inherits QwtAbstractScaleDraw.
Inherited by QwtDialScaleDraw.
so it inherits from QwtAbstractScaleDraw, and QwtDialScaleDraw inherits from it. it's a whole family tree, we love a dynasty π
π Public Member Functions
QwtRoundScaleDraw ()QwtRoundScaleDraw (const QwtRoundScaleDraw &)virtual ~QwtRoundScaleDraw ()QPoint center () constvirtual int extent (const QPen &, const QFont &) constvoid moveCenter (int x, int y)void moveCenter (const QPoint &)QwtRoundScaleDraw & operator= (const QwtRoundScaleDraw &other)int radius () constvoid setAngleRange (double angle1, double angle2)void setRadius (int radius)
π«Ά Protected Member Functions
virtual void drawBackbone (QPainter *p) constvirtual void drawLabel (QPainter *p, double val) constvirtual void drawTick (QPainter *p, double val, int len) const
β¨ Additional Inherited Members
and yeah, there's a whole "Additional Inherited Members" situation β they're inherited, bestie, so the page just gestures at them and moves on π
Detailed Description π
A class for drawing round scales. that's the vibe. π
QwtRoundScaleDraw can be used to draw round scales. The circle segment can be adjusted by QwtRoundScaleDraw::setAngleRange(). The geometry of the scale can be specified with QwtRoundScaleDraw::moveCenter() and QwtRoundScaleDraw::setRadius().
After a scale division has been specified as a QwtScaleDiv object using QwtAbstractScaleDraw::setScaleDiv(const QwtScaleDiv &s), the scale can be drawn with the QwtAbstractScaleDraw::draw() member.
so like β set your div, place your circle, angle your arc, draw. that's the whole flow, and it ate. π₯
Constructor & Destructor Documentation π
QwtRoundScaleDraw::QwtRoundScaleDraw ()
Constructor. The range of the scale is initialized to [0, 100], The center is set to (50, 50) with a radius of 50. The angle range is set to [-135, 135].
so the defaults are already giving main character energy β you get a whole usable scale for free, no setup required π«Ά
Member Function Documentation π
void QwtRoundScaleDraw::drawBackbone (QPainter *painter) const [protected], [virtual]
Draws the baseline of the scale.
Parameters:
- painter β Painter
See also: drawTick(), drawLabel()
Implements QwtAbstractScaleDraw.
void QwtRoundScaleDraw::drawLabel (QPainter *painter, double value) const [protected], [virtual]
Draws the label for a major scale tick. π·οΈ
Parameters:
- painter β Painter
- value β Value
See also: drawTick(), drawBackbone()
Implements QwtAbstractScaleDraw.
void QwtRoundScaleDraw::drawTick (QPainter *painter, double value, int len) const [protected], [virtual]
Draw a tick. tiny little mark, huge responsibility β¨
Parameters:
- painter β Painter
- value β Value of the tick
- len β Lenght of the tick
See also: drawBackbone(), drawLabel()
Implements QwtAbstractScaleDraw.
int QwtRoundScaleDraw::extent (const QPen &pen, const QFont &font) const [virtual]
Calculate the extent of the scale.
The extent is the distcance between the baseline to the outermost pixel of the scale draw. radius() + extent() is an upper limit for the radius of the bounding circle.
Parameters:
- pen β Pen that is used for painting backbone and ticks
- font β Font used for painting the labels
See also: setMinimumExtent(), minimumExtent()
Warning β οΈ β The implemented algo is not too smart and calculates only an upper limit, that might be a few pixels too large. bestie it's doing its best, it's just not doing math class π
Implements QwtAbstractScaleDraw.
void QwtRoundScaleDraw::moveCenter (const QPoint ¢er)
Move the center of the scale draw, leaving the radius unchanged.
Parameters:
- center β New center
See also: setRadius()
heads up: the public list also hasvoid moveCenter (int x, int y), but this page only writes up theQPointoverload. both are listed, neither is invented. π
int QwtRoundScaleDraw::radius () const
Get the radius.
Radius is the radius of the backbone without ticks and labels.
See also: setRadius(), extent()
void QwtRoundScaleDraw::setAngleRange (double angle1, double angle2)
Adjust the baseline circle segment for round scales. The baseline will be drawn from min(angle1,angle2) to max(angle1, angle2). The default setting is [ -135, 135 ]. An angle of 0 degrees corresponds to the 12 o'clock position, and positive angles count in a clockwise direction. π
Parameters:
- angle1
- angle2 β boundaries of the angle interval in degrees.
Warning β οΈ β read this twice, bestie: - The angle range is limited to[-360, 360]degrees. Angles exceeding this range will be clipped. - For angles more than359degrees above or belowmin(angle1, angle2), scale marks will not be drawn. - If you need a counterclockwise scale, useQwtScaleDiv::setRange
void QwtRoundScaleDraw::setRadius (int radius)
Change of radius the scale.
Radius is the radius of the backbone without ticks and labels.
Parameters:
- radius β New Radius
See also: moveCenter()
Author π
Generated automatically by Doxygen for Qwt User's Guide from the source code. so like, a robot wrote the skeleton, and i gave it the glow-up π β¨
and that's the page, bestie!! Version 5.2.3, dated Tue Nov 20 2012 β a whole vintage icon, and honestly it still slays. go draw some round scales, you've got this π¦ππ
π¦ 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