16 #ifndef QGSCOMPOSERSCALEBAR_H 17 #define QGSCOMPOSERSCALEBAR_H 56 SegmentSizeFitWidth = 1
70 void setNumSegments(
int nSegments );
73 void setNumSegmentsLeft(
int nSegmentsLeft );
76 void setNumUnitsPerSegment(
double units );
114 void setMinBarWidth(
double minWidth );
135 void setMaxBarWidth(
double maxWidth );
144 void setFont(
const QFont& font );
216 void setBoxContentSpace(
double space );
241 void setLineJoinStyle( Qt::PenJoinStyle style );
255 void setLineCapStyle( Qt::PenCapStyle style );
258 void applyDefaultSettings();
264 void setStyle(
const QString& styleName );
276 void adjustBoxSize();
282 QString firstLabelString()
const;
297 void correctXPositionAlignment(
double width,
double widthAfter );
303 void updateSegmentSize();
305 void invalidateCurrentMap();
359 void refreshSegmentMillimeters();
362 double mapWidth()
const;
365 #endif //QGSCOMPOSERSCALEBAR_H ScaleBarUnits units() const
A scale bar item that can be added to a map composition.
double numUnitsPerSegment() const
double mLabelBarSpace
Space between bar and Text labels.
double mHeight
Height of bars/lines.
double numMapUnitsPerScaleBarUnit() const
double mNumUnitsPerSegment
Size of a segment (in map units)
QPen pen() const
Returns the pen used for drawing the scalebar.
double mNumMapUnitsPerScaleBarUnit
Number of map units per scale bar units (e.g.
SegmentSizeMode segmentSizeMode() const
Returns the size mode for scale bar segments.
QColor fontColor() const
Returns the color used for drawing text in the scalebar.
void setPen(const QPen &pen)
Sets the pen used for drawing the scalebar.
Qt::PenJoinStyle mLineJoinStyle
void setUnitLabeling(const QString &label)
QBrush brush2() const
Returns the secondary brush for the scalebar.
A item that forms part of a map composition.
double mMinBarWidth
Minimum allowed bar width, when mSegmentSizeMode is FitWidth.
QgsScaleBarStyle * mStyle
Scalebar style.
QBrush mBrush2
Secondary fill.
virtual bool writeXML(QDomElement &elem, QDomDocument &doc) const
Stores item state in DOM element.
int numSegmentsLeft() const
SegmentSizeMode
Modes for setting size for scale bar segments.
void update(const QRectF &rect)
void setNumMapUnitsPerScaleBarUnit(double d)
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
double mSegmentMillimeters
Width of a segment (in mm)
QBrush brush() const
Returns the primary brush for the scalebar.
Qt::PenCapStyle mLineCapStyle
void setBrush2(const QBrush &brush)
Sets secondary brush for the scalebar.
Qt::PenCapStyle lineCapStyle() const
Returns the cap style used for drawing lines in the scalebar.
double labelBarSpace() const
int mNumSegmentsLeft
Number of segments on left side.
Abstraction of composer scale bar style.
void setLabelBarSpace(double space)
Graphics scene for map printing.
Object representing map window.
Qt::PenJoinStyle lineJoinStyle() const
Returns the join style used for drawing lines in the scalebar.
const QgsComposerMap * composerMap() const
int mNumSegments
Number of segments on right side.
double segmentMillimeters() const
double mMaxBarWidth
Maximum allowed bar width, when mSegmentSizeMode is FitWidth.
void setFontColor(const QColor &c)
Sets the color used for drawing text in the scalebar.
SegmentSizeMode mSegmentSizeMode
Either fixed (i.e.
virtual bool readXML(const QDomElement &itemElem, const QDomDocument &doc)
Sets item state from DOM element.
QString unitLabeling() const
double boxContentSpace() const
virtual void setSceneRect(const QRectF &rectangle)
Sets this items bound in scene coordinates such that 1 item size units corresponds to 1 scene size un...
Alignment alignment() const
Left / Middle/ Right.
double mBoxContentSpace
Space between content and item box.
QString mUnitLabeling
Labeling of map units.
const QgsComposerMap * mComposerMap
Reference to composer map object.
void setBrush(const QBrush &brush)
Sets primary brush for the scalebar.
double minBarWidth() const
Returns the minimum size (in millimeters) for scale bar segments.
double maxBarWidth() const
Returns the maximum size (in millimeters) for scale bar segments.
virtual int type() const override
Return correct graphics item type.