54 QList<QPair<double, double> > segmentInfo;
61 QList<QPair<double, double> >::const_iterator segmentIt = segmentInfo.constBegin();
62 for ( ; segmentIt != segmentInfo.constEnd(); ++segmentIt )
71 p->setBrush( QColor( 255, 255, 255 ) );
74 QRectF segmentRectTop( segmentIt->first + xOffset, barTopPosition, segmentIt->second, segmentHeight );
75 p->drawRect( segmentRectTop );
80 p->setBrush( QColor( 255, 255, 255 ) );
87 QRectF segmentRectBottom( segmentIt->first + xOffset, barTopPosition + segmentHeight, segmentIt->second, segmentHeight );
88 p->drawRect( segmentRectBottom );
A scale bar item that can be added to a map composition.
virtual void drawLabels(QPainter *p) const
QgsDoubleBoxScaleBarStyle()
double boxContentSpace() 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...
void draw(QPainter *p, double xOffset=0) const
Draws the style.
double labelBarSpace() const
Abstraction of composer scale bar style.
const QgsComposerScaleBar * mScaleBar
~QgsDoubleBoxScaleBarStyle()
double fontAscentMillimeters(const QFont &font) const
Returns the font ascent in Millimeters (considers upscaling and downscaling with FONT_WORKAROUND_SCAL...