16 #ifndef QGSCOMPOSERSCALEBAR_H
17 #define QGSCOMPOSERSCALEBAR_H
60 void paint( QPainter* painter,
const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );
64 void setNumSegments(
int nSegments );
67 void setNumSegmentsLeft(
int nSegmentsLeft );
70 void setNumUnitsPerSegment(
double units );
83 void setFont(
const QFont& font );
85 QPen
pen()
const {
return mPen;}
86 void setPen(
const QPen& pen ) {mPen = pen;}
88 QBrush
brush()
const {
return mBrush;}
89 void setBrush(
const QBrush& brush ) {mBrush = brush;}
91 double height()
const {
return mHeight;}
101 void setBoxContentSpace(
double space );
110 void setAlignment( Alignment a );
116 void setUnits( ScaleBarUnits u );
119 void applyDefaultSettings();
122 void applyDefaultSize( ScaleBarUnits u = Meters );
126 void setStyle(
const QString& styleName );
129 QString style()
const;
135 void segmentPositions( QList<QPair<double, double> >& posWidthList )
const;
138 void adjustBoxSize();
144 QString firstLabelString()
const;
150 bool writeXML( QDomElement& elem, QDomDocument & doc )
const;
156 bool readXML(
const QDomElement& itemElem,
const QDomDocument& doc );
159 void correctXPositionAlignment(
double width,
double widthAfter );
162 void updateSegmentSize();
164 void invalidateCurrentMap();
207 void refreshSegmentMillimeters();
210 double mapWidth()
const;
214 #endif //QGSCOMPOSERSCALEBAR_H