49 QList<QPair<double, double> > segmentInfo;
54 QList<QPair<double, double> >::const_iterator segmentIt = segmentInfo.constBegin();
55 for ( ; segmentIt != segmentInfo.constEnd(); ++segmentIt )
63 p->setBrush( QColor( 255, 255, 255 ) );
66 QRectF segmentRect( segmentIt->first + xOffset, barTopPosition, segmentIt->second,
mScaleBar->
height() );
67 p->drawRect( segmentRect );
A scale bar item that can be added to a map composition.
virtual void drawLabels(QPainter *p) const
double boxContentSpace() const
void draw(QPainter *p, double xOffset=0) const
void segmentPositions(QList< QPair< double, double > > &posWidthList) const
Returns the x - positions of the segment borders (in item coordinates) and the width of the segment...
double labelBarSpace() const
Abstraction of composer scale bar style.
QgsSingleBoxScaleBarStyle()
const QgsComposerScaleBar * mScaleBar
~QgsSingleBoxScaleBarStyle()
double fontAscentMillimeters(const QFont &font) const
Returns the font ascent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCAL...