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 );
130 void setLineJoinStyle( Qt::PenJoinStyle style );
144 void setLineCapStyle( Qt::PenCapStyle style );
147 void applyDefaultSettings();
150 void applyDefaultSize( ScaleBarUnits u = Meters );
154 void setStyle(
const QString& styleName );
157 QString style()
const;
163 void segmentPositions( QList<QPair<double, double> >& posWidthList )
const;
166 void adjustBoxSize();
172 QString firstLabelString()
const;
178 bool writeXML( QDomElement& elem, QDomDocument & doc )
const;
184 bool readXML(
const QDomElement& itemElem,
const QDomDocument& doc );
187 void correctXPositionAlignment(
double width,
double widthAfter );
190 void updateSegmentSize();
192 void invalidateCurrentMap();
238 void refreshSegmentMillimeters();
241 double mapWidth()
const;
245 #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
Qt::PenJoinStyle mLineJoinStyle
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
Qt::PenCapStyle mLineCapStyle
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.
Qt::PenCapStyle lineCapStyle() const
Returns the cap style used for drawing lines in the scalebar.
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
Qt::PenJoinStyle lineJoinStyle() const
Returns the join style used for drawing lines in the scalebar.
void setBrush(const QBrush &brush)