16 #ifndef QGSCOMPOSERSCALEBAR_H
17 #define QGSCOMPOSERSCALEBAR_H
58 void paint( QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
override;
62 void setNumSegments(
int nSegments );
65 void setNumSegmentsLeft(
int nSegmentsLeft );
68 void setNumUnitsPerSegment(
double units );
77 void setFont(
const QFont& font );
98 QPen
pen()
const {
return mPen;}
105 void setPen(
const QPen& pen ) {mPen = pen;}
113 QBrush
brush()
const {
return mBrush;}
121 void setBrush(
const QBrush& brush ) {mBrush = brush;}
137 void setBrush2(
const QBrush& brush ) {mBrush2 = brush;}
149 void setBoxContentSpace(
double space );
156 void setAlignment( Alignment a );
160 void setUnits( ScaleBarUnits u );
174 void setLineJoinStyle( Qt::PenJoinStyle style );
188 void setLineCapStyle( Qt::PenCapStyle style );
191 void applyDefaultSettings();
193 void applyDefaultSize( ScaleBarUnits u = Meters );
197 void setStyle(
const QString& styleName );
200 QString style()
const;
206 void segmentPositions( QList<QPair<double, double> >& posWidthList )
const;
209 void adjustBoxSize();
215 QString firstLabelString()
const;
221 bool writeXML( QDomElement& elem, QDomDocument & doc )
const override;
227 bool readXML(
const QDomElement& itemElem,
const QDomDocument& doc )
override;
230 void correctXPositionAlignment(
double width,
double widthAfter );
236 void updateSegmentSize();
238 void invalidateCurrentMap();
286 void refreshSegmentMillimeters();
289 double mapWidth()
const;
292 #endif //QGSCOMPOSERSCALEBAR_H