Go to the documentation of this file.
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 void draw(QPainter *, const QPalette &) const
Draw the scale.
QwtAbstractScaleDraw()
Constructor.
void setTransformation(QwtTransform *)
virtual void drawTick(QPainter *painter, double value, double len) const =0
bool hasComponent(ScaleComponent) const
void setSpacing(double)
Set the spacing between tick and labels.
@ MediumTick
Medium ticks.
const QwtText & tickLabel(const QFont &, double value) const
Convert a value into its representing label and cache it.
double maxTickLength() const
const QwtScaleMap & scaleMap() const
void setScaleDiv(const QwtScaleDiv &)
const QwtScaleDiv & scaleDiv() const
double lowerBound() const
void setRenderFlags(int)
Change the render flags.
QMap< double, QwtText > labelCache
virtual void drawBackbone(QPainter *painter) const =0
bool contains(double value) const
double minimumExtent() const
QList< double > ticks(int tickType) const
void setTransformation(QwtTransform *)
@ Backbone
Backbone = the line where the ticks are located.
@ NTickTypes
Number of valid tick types.
void enableComponent(ScaleComponent, bool enable=true)
A class representing a text.
void setMinimumExtent(double)
Set a minimum for the extent.
QWT_CONSTEXPR float qwtMaxF(float a, float b)
double upperBound() const
void setTickLength(QwtScaleDiv::TickType, double length)
virtual QwtText label(double) const
Convert a value into its representing label.
virtual void drawLabel(QPainter *painter, double value) const =0
virtual ~QwtAbstractScaleDraw()
Destructor.
TickType
Scale tick types.
void setPenWidthF(qreal width)
Specify the width of the scale pen.
double tickLength[QwtScaleDiv::NTickTypes]
void setLayoutAttribute(LayoutAttribute, bool on=true)
void setScaleInterval(double s1, double s2)
Specify the borders of the scale interval.
double spacing() const
Get the spacing.
A class representing a scale division.
ScaleComponents components
double tickLength(QwtScaleDiv::TickType) const
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45