169 const QPalette& palette )
const 173 QPen pen = painter->pen();
175 pen.setCosmetic(
false );
176 painter->setPen( pen );
181 painter->setPen( palette.color( QPalette::Text ) );
183 const QList<double> &majorTicks =
186 for (
int i = 0;
i < majorTicks.count();
i++ )
188 const double v = majorTicks[
i];
200 QPen pen = painter->pen();
201 pen.setColor( palette.color( QPalette::WindowText ) );
202 pen.setCapStyle( Qt::FlatCap );
204 painter->setPen( pen );
210 if ( tickLen <= 0.0 )
214 for (
int i = 0;
i < ticks.count();
i++ )
216 const double v = ticks[
i];
229 QPen pen = painter->pen();
230 pen.setColor( palette.color( QPalette::WindowText ) );
231 pen.setCapStyle( Qt::FlatCap );
233 painter->setPen( pen );
290 if ( minExtent < 0.0 )
326 const double maxTickLen = 1000.0;
327 if ( length > maxTickLen )
376 return QLocale().toString( value );
393 const QFont &font,
double value )
const 395 QMap<double, QwtText>::const_iterator it =
d_data->
labelCache.constFind( value );
virtual ~QwtAbstractScaleDraw()
Destructor.
virtual void drawBackbone(QPainter *painter) const =0
ScaleComponents components
QwtAbstractScaleDraw()
Constructor.
virtual void drawTick(QPainter *painter, double value, double len) const =0
void setSpacing(double margin)
Set the spacing between tick and labels.
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
QSizeF textSize(const QFont &=QFont()) const
bool contains(double value) const
void setRenderFlags(int flags)
Change the render flags.
const QwtScaleDiv & scaleDiv() const
double lowerBound() const
void setTransformation(QwtTransform *)
void setLayoutAttribute(LayoutAttribute, bool on=true)
A class representing a text.
double maxTickLength() const
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.
void setPenWidth(int width)
Specify the width of the scale pen.
void setScaleDiv(const QwtScaleDiv &s)
bool hasComponent(ScaleComponent) const
void setTransformation(QwtTransform *)
QList< double > ticks(int tickType) const
double tickLength(QwtScaleDiv::TickType) const
double spacing() const
Get the spacing.
QFlags< ScaleComponent > ScaleComponents
Scale components.