170 const QPalette& palette )
const 174 QPen pen = painter->pen();
177 painter->setPen( pen );
182 painter->setPen( palette.color( QPalette::Text ) );
187 for (
int i = 0; i < majorTicks.count(); i++ )
189 const double v = majorTicks[i];
201 pen = painter->pen();
202 pen.setColor( palette.color( QPalette::WindowText ) );
203 pen.setCapStyle( Qt::FlatCap );
205 painter->setPen( pen );
211 if ( tickLen <= 0.0 )
215 for (
int i = 0; i < ticks.count(); i++ )
217 const double v = ticks[i];
230 pen = painter->pen();
231 pen.setColor( palette.color( QPalette::WindowText ) );
232 pen.setCapStyle( Qt::FlatCap );
234 painter->setPen( pen );
291 if ( minExtent < 0.0 )
327 const double maxTickLen = 1000.0;
328 if ( length > maxTickLen )
377 auto str = QLocale().toString( value,
'f', 6 );
378 str.remove( QRegExp(
"0+$") );
379 str.remove( QRegExp(
"\\.$") );
397 const QFont& font,
double value )
const
virtual ~QwtAbstractScaleDraw()
Destructor.
virtual void drawBackbone(QPainter *painter) const =0
double lowerBound() const
ScaleComponents components
virtual void draw(QPainter *, const QPalette &) const
Draw the scale.
double tickLength(QwtScaleDiv::TickType) const
const QwtText & tickLabel(const QFont &, double value) const
Convert a value into its representing label and cache it.
QList< double > ticks(int tickType) const
QwtAbstractScaleDraw()
Constructor.
void setRenderFlags(int)
Change the render flags.
QWT_CONSTEXPR float qwtMaxF(float a, float b)
bool contains(double value) const
virtual void drawTick(QPainter *painter, double value, double len) const =0
A class representing a scale division.
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.
bool hasComponent(ScaleComponent) const
const QwtScaleDiv & scaleDiv() const
virtual QwtText label(double) const
Convert a value into its representing label.
void setTransformation(QwtTransform *)
void setLayoutAttribute(LayoutAttribute, bool on=true)
QMap< double, QwtText > labelCache
A class representing a text.
double minimumExtent() const
void setScaleDiv(const QwtScaleDiv &)
Backbone = the line where the ticks are located.
Number of valid tick types.
void setTickLength(QwtScaleDiv::TickType, double length)
double tickLength[QwtScaleDiv::NTickTypes]
void enableComponent(ScaleComponent, bool enable=true)
void setMinimumExtent(double)
Set a minimum for the extent.
void setTransformation(QwtTransform *)
const QwtScaleMap & scaleMap() const
double upperBound() const
void setPenWidthF(qreal width)
Specify the width of the scale pen.
void setSpacing(double)
Set the spacing between tick and labels.
double maxTickLength() const
double spacing() const
Get the spacing.