16 #ifndef QGSCOMPOSERSCALEBAR_H
17 #define QGSCOMPOSERSCALEBAR_H
59 void paint( QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );
63 void setNumSegments(
int nSegments );
66 void setNumSegmentsLeft(
int nSegmentsLeft );
69 void setNumUnitsPerSegment(
double units );
82 void setFont(
const QFont& font );
84 QPen
pen()
const {
return mPen;}
85 void setPen(
const QPen& pen ) {mPen = pen;}
87 QBrush
brush()
const {
return mBrush;}
88 void setBrush(
const QBrush& brush ) {mBrush = brush;}
90 double height()
const {
return mHeight;}
100 void setBoxContentSpace(
double space );
109 void setAlignment( Alignment a );
115 void setUnits( ScaleBarUnits u );
118 void applyDefaultSettings();
121 void applyDefaultSize();
125 void setStyle(
const QString& styleName );
128 QString style()
const;
132 void segmentPositions( QList<QPair<double, double> >& posWidthList )
const;
135 void adjustBoxSize();
141 QString firstLabelString()
const;
147 bool writeXML( QDomElement& elem, QDomDocument & doc )
const;
153 bool readXML(
const QDomElement& itemElem,
const QDomDocument& doc );
156 void correctXPositionAlignment(
double width,
double widthAfter );
159 void updateSegmentSize();
161 void invalidateCurrentMap();
204 void refreshSegmentMillimeters();
207 double mapWidth()
const;
210 #endif //QGSCOMPOSERSCALEBAR_H