QGIS API Documentation
2.2.0-Valmiera
|
Abstraction of composer scale bar style. More...
#include <qgsscalebarstyle.h>
Public Member Functions | |
QgsScaleBarStyle (const QgsComposerScaleBar *bar) | |
virtual | ~QgsScaleBarStyle () |
virtual void | draw (QPainter *p, double xOffset=0) const =0 |
Draws the style. | |
virtual void | drawLabels (QPainter *p) const |
virtual QRectF | calculateBoxSize () const |
virtual QString | name () const =0 |
Protected Attributes | |
const QgsComposerScaleBar * | mScaleBar |
Private Member Functions | |
QgsScaleBarStyle () |
Abstraction of composer scale bar style.
Subclasses draw themselves, have the possibility to implement custom labeling and calculate corresponding box size.
Definition at line 30 of file qgsscalebarstyle.h.
QgsScaleBarStyle::QgsScaleBarStyle | ( | const QgsComposerScaleBar * | bar | ) |
Definition at line 22 of file qgsscalebarstyle.cpp.
|
virtual |
Definition at line 32 of file qgsscalebarstyle.cpp.
|
private |
Definition at line 27 of file qgsscalebarstyle.cpp.
|
virtual |
Reimplemented in QgsNumericScaleBarStyle.
Definition at line 102 of file qgsscalebarstyle.cpp.
References QgsComposerScaleBar::boxContentSpace(), QgsComposerScaleBar::firstLabelString(), QgsComposerScaleBar::font(), QgsComposerItem::fontAscentMillimeters(), QgsComposerScaleBar::height(), QgsComposerScaleBar::labelBarSpace(), mScaleBar, QgsComposerScaleBar::numMapUnitsPerScaleBarUnit(), QgsComposerScaleBar::numSegments(), QgsComposerScaleBar::numUnitsPerSegment(), QgsComposerScaleBar::pen(), QgsComposerScaleBar::segmentPositions(), QgsComposerItem::textWidthMillimeters(), and QgsComposerScaleBar::unitLabeling().
Referenced by QgsComposerScaleBar::adjustBoxSize(), QgsComposerScaleBar::setBoxContentSpace(), QgsComposerScaleBar::setNumSegments(), QgsComposerScaleBar::setNumSegmentsLeft(), QgsComposerScaleBar::setNumUnitsPerSegment(), and QgsComposerScaleBar::updateSegmentSize().
|
pure virtual |
Draws the style.
p | painter object |
xOffset | offset to account for centered labeling |
Implemented in QgsTicksScaleBarStyle, QgsSingleBoxScaleBarStyle, QgsDoubleBoxScaleBarStyle, and QgsNumericScaleBarStyle.
Referenced by QgsComposerScaleBar::paint().
|
virtual |
Definition at line 37 of file qgsscalebarstyle.cpp.
References QgsComposerScaleBar::boxContentSpace(), QgsComposerItem::drawText(), QgsComposerScaleBar::firstLabelString(), QgsComposerScaleBar::font(), QgsComposerItem::fontAscentMillimeters(), QgsComposerScaleBar::fontColor(), mScaleBar, QgsComposerScaleBar::numMapUnitsPerScaleBarUnit(), QgsComposerScaleBar::numSegmentsLeft(), QgsComposerScaleBar::numUnitsPerSegment(), QgsComposerScaleBar::segmentMillimeters(), QgsComposerScaleBar::segmentPositions(), QgsComposerItem::textWidthMillimeters(), and QgsComposerScaleBar::unitLabeling().
Referenced by QgsDoubleBoxScaleBarStyle::draw(), QgsSingleBoxScaleBarStyle::draw(), and QgsTicksScaleBarStyle::draw().
|
pure virtual |
|
protected |
Definition at line 48 of file qgsscalebarstyle.h.
Referenced by QgsNumericScaleBarStyle::calculateBoxSize(), calculateBoxSize(), QgsNumericScaleBarStyle::draw(), QgsDoubleBoxScaleBarStyle::draw(), QgsSingleBoxScaleBarStyle::draw(), QgsTicksScaleBarStyle::draw(), drawLabels(), and QgsNumericScaleBarStyle::scaleText().