QGIS API Documentation 3.30.0-'s-Hertogenbosch (f186b8efe0)
|
A scale bar that draws segments using short ticks. More...
#include <qgsticksscalebarrenderer.h>
Public Types | |
enum | TickPosition { TicksUp , TicksDown , TicksMiddle } |
Tick positions. More... | |
Public Types inherited from QgsScaleBarRenderer | |
enum class | Flag { FlagUsesLineSymbol = 1 << 0 , FlagUsesFillSymbol = 1 << 1 , FlagUsesAlternateFillSymbol = 1 << 2 , FlagRespectsUnits = 1 << 3 , FlagRespectsMapUnitsPerScaleBarUnit = 1 << 4 , FlagUsesUnitLabel = 1 << 5 , FlagUsesSegments = 1 << 6 , FlagUsesLabelBarSpace = 1 << 7 , FlagUsesLabelVerticalPlacement = 1 << 8 , FlagUsesLabelHorizontalPlacement = 1 << 8 , FlagUsesAlignment = 1 << 9 , FlagUsesSubdivisions = 1 << 10 , FlagUsesDivisionSymbol = 1 << 11 , FlagUsesSubdivisionSymbol = 1 << 12 , FlagUsesSubdivisionsHeight = 1 << 13 } |
Flags which control scalebar renderer behavior. More... | |
Public Member Functions | |
QgsTicksScaleBarRenderer (TickPosition position=TicksMiddle) | |
Constructor for QgsTicksScaleBarRenderer. More... | |
QgsTicksScaleBarRenderer * | clone () const override |
Returns a clone of the renderer. More... | |
void | draw (QgsRenderContext &context, const QgsScaleBarSettings &settings, const QgsScaleBarRenderer::ScaleBarContext &scaleContext) const override |
Draws the scalebar using the specified settings and scaleContext to a destination render context. More... | |
Flags | flags () const override |
Returns the scalebar rendering flags, which dictates the renderer's behavior. More... | |
QString | id () const override |
Returns the unique ID for this renderer. More... | |
void | setTickPosition (TickPosition position) |
Sets the position for tick marks in the scalebar. More... | |
int | sortKey () const override |
Returns a sorting key value, where renderers with a lower sort key will be shown earlier in lists. More... | |
TickPosition | tickPosition () const |
Returns the position for tick marks in the scalebar. More... | |
QString | visibleName () const override |
Returns the user friendly, translated name for the renderer. More... | |
Public Member Functions inherited from QgsScaleBarRenderer | |
QgsScaleBarRenderer ()=default | |
Constructor for QgsScaleBarRenderer. More... | |
virtual | ~QgsScaleBarRenderer ()=default |
virtual bool | applyDefaultSettings (QgsScaleBarSettings &settings) const |
Applies any default settings relating to the scalebar to the passed settings object. More... | |
virtual Q_DECL_DEPRECATED QSizeF | calculateBoxSize (const QgsScaleBarSettings &settings, const QgsScaleBarRenderer::ScaleBarContext &scaleContext) const |
Calculates the required box size (in millimeters) for a scalebar using the specified settings and scaleContext. More... | |
virtual QSizeF | calculateBoxSize (QgsRenderContext &context, const QgsScaleBarSettings &settings, const QgsScaleBarRenderer::ScaleBarContext &scaleContext) const |
Calculates the required box size (in millimeters) for a scalebar using the specified settings and scaleContext. More... | |
virtual QgsScaleBarRenderer * | clone () const =0 |
Returns a clone of the renderer. More... | |
virtual void | draw (QgsRenderContext &context, const QgsScaleBarSettings &settings, const QgsScaleBarRenderer::ScaleBarContext &scaleContext) const =0 |
Draws the scalebar using the specified settings and scaleContext to a destination render context. More... | |
virtual Flags | flags () const |
Returns the scalebar rendering flags, which dictates the renderer's behavior. More... | |
virtual QString | id () const =0 |
Returns the unique ID for this renderer. More... | |
Q_DECL_DEPRECATED QString | name () const |
Returns the unique name for this style. More... | |
virtual int | sortKey () const |
Returns a sorting key value, where renderers with a lower sort key will be shown earlier in lists. More... | |
virtual QString | visibleName () const =0 |
Returns the user friendly, translated name for the renderer. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from QgsScaleBarRenderer | |
void | drawDefaultLabels (QgsRenderContext &context, const QgsScaleBarSettings &settings, const QgsScaleBarRenderer::ScaleBarContext &scaleContext) const |
Draws default scalebar labels using the specified settings and scaleContext to a destination render context. More... | |
QString | firstLabelString (const QgsScaleBarSettings &settings) const |
Returns the text used for the first label in the scalebar. More... | |
Q_DECL_DEPRECATED double | firstLabelXOffset (const QgsScaleBarSettings &settings) const |
Returns the x-offset (in millimeters) used for the first label in the scalebar. More... | |
double | firstLabelXOffset (const QgsScaleBarSettings &settings, const QgsRenderContext &context, const ScaleBarContext &scaleContext) const |
Returns the x-offset (in render context painter units) used for the first label in the scalebar. More... | |
Q_DECL_DEPRECATED QList< double > | segmentPositions (const QgsScaleBarRenderer::ScaleBarContext &scaleContext, const QgsScaleBarSettings &settings) const |
Returns a list of positions for each segment within the scalebar. More... | |
QList< double > | segmentPositions (QgsRenderContext &context, const QgsScaleBarRenderer::ScaleBarContext &scaleContext, const QgsScaleBarSettings &settings) const |
Returns a list of positions for each segment within the scalebar. More... | |
QList< double > | segmentWidths (const QgsScaleBarRenderer::ScaleBarContext &scaleContext, const QgsScaleBarSettings &settings) const |
Returns a list of widths of each segment of the scalebar. More... | |
A scale bar that draws segments using short ticks.
Definition at line 29 of file qgsticksscalebarrenderer.h.
Tick positions.
Enumerator | |
---|---|
TicksUp | Render ticks above line. |
TicksDown | Render ticks below line. |
TicksMiddle | Render ticks crossing line. |
Definition at line 34 of file qgsticksscalebarrenderer.h.
QgsTicksScaleBarRenderer::QgsTicksScaleBarRenderer | ( | QgsTicksScaleBarRenderer::TickPosition | position = TicksMiddle | ) |
Constructor for QgsTicksScaleBarRenderer.
Definition at line 24 of file qgsticksscalebarrenderer.cpp.
|
overridevirtual |
Returns a clone of the renderer.
The caller takes ownership of the returned value.
Implements QgsScaleBarRenderer.
Definition at line 89 of file qgsticksscalebarrenderer.cpp.
|
overridevirtual |
Draws the scalebar using the specified settings and scaleContext to a destination render context.
Implements QgsScaleBarRenderer.
Definition at line 94 of file qgsticksscalebarrenderer.cpp.
|
overridevirtual |
Returns the scalebar rendering flags, which dictates the renderer's behavior.
Reimplemented from QgsScaleBarRenderer.
Definition at line 73 of file qgsticksscalebarrenderer.cpp.
|
overridevirtual |
Returns the unique ID for this renderer.
Implements QgsScaleBarRenderer.
Definition at line 30 of file qgsticksscalebarrenderer.cpp.
|
inline |
Sets the position for tick marks in the scalebar.
Definition at line 60 of file qgsticksscalebarrenderer.h.
|
overridevirtual |
Returns a sorting key value, where renderers with a lower sort key will be shown earlier in lists.
Generally, subclasses should return QgsScaleBarRenderer::sortKey() as their sorting key.
Reimplemented from QgsScaleBarRenderer.
Definition at line 59 of file qgsticksscalebarrenderer.cpp.
|
inline |
Returns the position for tick marks in the scalebar.
Definition at line 66 of file qgsticksscalebarrenderer.h.
|
overridevirtual |
Returns the user friendly, translated name for the renderer.
Implements QgsScaleBarRenderer.
Definition at line 44 of file qgsticksscalebarrenderer.cpp.