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
A scale bar item that can be added to a map composition.
ScaleBarUnits
Added in version 1.9.
double mLabelBarSpace
Space between bar and Text labels.
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)=0
sets state from Dom document
double mHeight
Height of bars/lines.
double mNumUnitsPerSegment
Size of a segment (in map units)
double mNumMapUnitsPerScaleBarUnit
Number of map units per scale bar units (e.g.
void setPen(const QPen &pen)
double boxContentSpace() const
void setUnitLabeling(const QString &label)
A item that forms part of a map composition.
Alignment alignment() const
Left / Middle/ Right.
ScaleBarUnits units() const
QgsScaleBarStyle * mStyle
Scalebar style.
void setNumMapUnitsPerScaleBarUnit(double d)
double numMapUnitsPerScaleBarUnit() const
double mSegmentMillimeters
Width of a segment (in mm)
int numSegmentsLeft() const
double labelBarSpace() const
virtual int type() const
return correct graphics item type.
QString unitLabeling() const
Alignment
Added in version 1.8.
double segmentMillimeters() const
int mNumSegmentsLeft
Number of segments on left side.
Abstraction of composer scale bar style.
const QgsComposerMap * composerMap() const
void setLabelBarSpace(double space)
Graphics scene for map printing.
Object representing map window.
int mNumSegments
Number of segments on right side.
void setFontColor(const QColor &c)
double numUnitsPerSegment() const
double mBoxContentSpace
Space between content and item box.
QString mUnitLabeling
Labeling of map units.
const QgsComposerMap * mComposerMap
Reference to composer map object.
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const =0
stores state in Dom element
void setBrush(const QBrush &brush)