171 const QPalette& palette )
const 175 QPen pen = painter->pen();
178 painter->setPen( pen );
183 painter->setPen( palette.color( QPalette::Text ) );
188 for (
int i = 0; i < majorTicks.count(); i++ )
190 const double v = majorTicks[i];
202 pen = painter->pen();
203 pen.setColor( palette.color( QPalette::WindowText ) );
204 pen.setCapStyle( Qt::FlatCap );
206 painter->setPen( pen );
212 if ( tickLen <= 0.0 )
216 for (
int i = 0; i < ticks.count(); i++ )
218 const double v = ticks[i];
231 pen = painter->pen();
232 pen.setColor( palette.color( QPalette::WindowText ) );
233 pen.setCapStyle( Qt::FlatCap );
235 painter->setPen( pen );
292 if ( minExtent < 0.0 )
328 const double maxTickLen = 1000.0;
329 if ( length > maxTickLen )
378 auto str = QLocale().toString( value,
'f', 3 );
379 str.remove( QRegExp(
"0+$") );
380 str.remove( QRegExp(
"\\.$") );
398 const QFont &font,
double value )
const
virtual ~QwtAbstractScaleDraw()
Destructor.
virtual void drawBackbone(QPainter *painter) const =0
ScaleComponents components
enum MQTTPropertyCodes value
QwtAbstractScaleDraw()
Constructor.
void setRenderFlags(int)
Change the render flags.
QWT_CONSTEXPR float qwtMaxF(float a, float b)
virtual void drawTick(QPainter *painter, double value, double len) const =0
A class representing a scale division.
const QwtScaleMap & scaleMap() const
virtual void drawLabel(QPainter *painter, double value) const =0
void setScaleInterval(double s1, double s2)
Specify the borders of the scale interval.
TickType
Scale tick types.
QMap< double, QwtText > labelCache
double minimumExtent() const
double upperBound() const
bool contains(double value) const
const QwtScaleDiv & scaleDiv() const
double lowerBound() const
void setTransformation(QwtTransform *)
void setLayoutAttribute(LayoutAttribute, bool on=true)
A class representing a text.
double maxTickLength() const
void setScaleDiv(const QwtScaleDiv &)
Backbone = the line where the ticks are located.
virtual QwtText label(double) const
Convert a value into its representing label.
Number of valid tick types.
void setTickLength(QwtScaleDiv::TickType, double length)
double tickLength[QwtScaleDiv::NTickTypes]
void enableComponent(ScaleComponent, bool enable=true)
const QwtText & tickLabel(const QFont &, double value) const
Convert a value into its representing label and cache it.
virtual void draw(QPainter *, const QPalette &) const
Draw the scale.
void setMinimumExtent(double)
Set a minimum for the extent.
bool hasComponent(ScaleComponent) const
void setTransformation(QwtTransform *)
void setPenWidthF(qreal width)
Specify the width of the scale pen.
void setSpacing(double)
Set the spacing between tick and labels.
QList< double > ticks(int tickType) const
double tickLength(QwtScaleDiv::TickType) const
double spacing() const
Get the spacing.
QFlags< ScaleComponent > ScaleComponents
Scale components.