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
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)