16 #ifndef QGSCOMPOSERSCALEBAR_H
17 #define QGSCOMPOSERSCALEBAR_H
58 void paint( QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );
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();
194 void applyDefaultSize( ScaleBarUnits u = Meters );
198 void setStyle(
const QString& styleName );
201 QString style()
const;
207 void segmentPositions( QList<QPair<double, double> >& posWidthList )
const;
210 void adjustBoxSize();
216 QString firstLabelString()
const;
222 bool writeXML( QDomElement& elem, QDomDocument & doc )
const;
228 bool readXML(
const QDomElement& itemElem,
const QDomDocument& doc );
231 void correctXPositionAlignment(
double width,
double widthAfter );
237 void updateSegmentSize();
239 void invalidateCurrentMap();
287 void refreshSegmentMillimeters();
290 double mapWidth()
const;
293 #endif //QGSCOMPOSERSCALEBAR_H