121 angle1 = qBound( -360.0, angle1, 360.0 );
122 angle2 = qBound( -360.0, angle2, 360.0 );
168 const QSizeF sz = label.
textSize( painter->font() );
172 ( radius + sz.width() / 2.0 ) * std::sin( arc );
174 ( radius + sz.height() / 2.0 ) * std::cos( arc );
176 const QRectF r( x - sz.width() / 2, y - sz.height() / 2,
177 sz.width(), sz.height() );
178 label.
draw( painter, r );
206 const double sinArc = std::sin( arc );
207 const double cosArc = std::cos( arc );
209 const double x1 = cx + radius * sinArc;
210 const double x2 = cx + ( radius +
len ) * sinArc;
211 const double y1 = cy - radius * cosArc;
212 const double y2 = cy - ( radius +
len ) * cosArc;
229 const int a1 = qRound(
qwtMinF( deg1, deg2 ) - 90 );
230 const int a2 = qRound(
qwtMaxF( deg1, deg2 ) - 90 );
236 painter->drawArc( QRectF( x, y, 2 * radius, 2 * radius ),
237 -a2 * 16, ( a2 - a1 + 1 ) * 16 );
263 for (
int i = 0; i < ticks.count(); i++ )
265 const double value = ticks[i];
279 const QSizeF sz = label.
textSize( font );
280 const double off = qMax( sz.width(), sz.height() );
282 double x = off * std::sin( arc );
283 double y = off * std::cos( arc );
285 const double dist = std::sqrt( x * x + y * y );
virtual void drawBackbone(QPainter *) const QWT_OVERRIDE
enum MQTTPropertyCodes value
static void drawLine(QPainter *, qreal x1, qreal y1, qreal x2, qreal y2)
Wrapper for QPainter::drawLine()
QWT_CONSTEXPR float qwtMaxF(float a, float b)
virtual ~QwtRoundScaleDraw()
Destructor.
void draw(QPainter *painter, const QRectF &rect) const
A class representing a scale division.
const QwtScaleMap & scaleMap() const
QWT_CONSTEXPR float qwtMinF(float a, float b)
double minimumExtent() const
virtual void drawLabel(QPainter *, double value) const QWT_OVERRIDE
void moveCenter(double x, double y)
Move the center of the scale draw, leaving the radius unchanged.
QPointF center() const
Get the center of the scale.
bool contains(double value) const
double qwtRadians(double degrees)
Translate degrees into radians.
const QwtScaleDiv & scaleDiv() const
void setPaintInterval(double p1, double p2)
Specify the borders of the paint device interval.
A class representing a text.
QwtRoundScaleDraw()
Constructor.
double maxTickLength() const
Backbone = the line where the ticks are located.
virtual QwtText label(double) const
Convert a value into its representing label.
virtual double extent(const QFont &) const QWT_OVERRIDE
void setAngleRange(double angle1, double angle2)
Adjust the baseline circle segment for round scales.
const QwtText & tickLabel(const QFont &, double value) const
Convert a value into its representing label and cache it.
virtual void drawTick(QPainter *, double value, double len) const QWT_OVERRIDE
bool hasComponent(ScaleComponent) const
void setRadius(double radius)
double transform(double s) const
QList< double > ticks(int tickType) const
double tickLength(QwtScaleDiv::TickType) const
double spacing() const
Get the spacing.