QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
QgsHollowScaleBarRenderer Class Reference

Scalebar style that draws a single box with alternating color for the segments, with horizontal lines through alternating segments. More...

#include <qgshollowscalebarrenderer.h>

Inheritance diagram for QgsHollowScaleBarRenderer:
Inheritance graph
[legend]

Public Member Functions

 QgsHollowScaleBarRenderer ()=default
 
bool applyDefaultSettings (QgsScaleBarSettings &settings) const override
 Applies any default settings relating to the scalebar to the passed settings object.
 
QgsHollowScaleBarRendererclone () const override
 Returns a clone of the renderer.
 
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.
 
Flags flags () const override
 Returns the scalebar rendering flags, which dictates the renderer's behavior.
 
QString id () const override
 Returns the unique ID for this renderer.
 
int sortKey () const override
 Returns a sorting key value, where renderers with a lower sort key will be shown earlier in lists.
 
QString visibleName () const override
 Returns the user friendly, translated name for the renderer.
 
- Public Member Functions inherited from QgsScaleBarRenderer
 QgsScaleBarRenderer ()=default
 
virtual ~QgsScaleBarRenderer ()=default
 
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.
 
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.
 
Q_DECL_DEPRECATED QString name () const
 Returns the unique name for this style.
 

Additional Inherited Members

- Public Types inherited from QgsScaleBarRenderer
enum class  Flag : int {
  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...
 
typedef QFlags< FlagFlags
 
- 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.
 
QString firstLabelString (const QgsScaleBarSettings &settings) const
 Returns the text used for the first label in the scalebar.
 
Q_DECL_DEPRECATED double firstLabelXOffset (const QgsScaleBarSettings &settings) const
 Returns the x-offset (in millimeters) used for the first label in the scalebar.
 
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.
 
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.
 
QList< double > segmentPositions (QgsRenderContext &context, const QgsScaleBarRenderer::ScaleBarContext &scaleContext, const QgsScaleBarSettings &settings) const
 Returns a list of positions for each segment within the scalebar.
 
QList< double > segmentWidths (const QgsScaleBarRenderer::ScaleBarContext &scaleContext, const QgsScaleBarSettings &settings) const
 Returns a list of widths of each segment of the scalebar.
 

Detailed Description

Scalebar style that draws a single box with alternating color for the segments, with horizontal lines through alternating segments.

AKA "South African" style.

Since
QGIS 3.14

Definition at line 31 of file qgshollowscalebarrenderer.h.

Constructor & Destructor Documentation

◆ QgsHollowScaleBarRenderer()

QgsHollowScaleBarRenderer::QgsHollowScaleBarRenderer ( )
default

Member Function Documentation

◆ applyDefaultSettings()

bool QgsHollowScaleBarRenderer::applyDefaultSettings ( QgsScaleBarSettings settings) const
overridevirtual

Applies any default settings relating to the scalebar to the passed settings object.

Returns true if settings were applied.

Since
QGIS 3.14

Reimplemented from QgsScaleBarRenderer.

Definition at line 178 of file qgshollowscalebarrenderer.cpp.

◆ clone()

QgsHollowScaleBarRenderer * QgsHollowScaleBarRenderer::clone ( ) const
overridevirtual

Returns a clone of the renderer.

The caller takes ownership of the returned value.

Implements QgsScaleBarRenderer.

Definition at line 56 of file qgshollowscalebarrenderer.cpp.

◆ draw()

void QgsHollowScaleBarRenderer::draw ( QgsRenderContext context,
const QgsScaleBarSettings settings,
const QgsScaleBarRenderer::ScaleBarContext scaleContext 
) const
overridevirtual

Draws the scalebar using the specified settings and scaleContext to a destination render context.

Implements QgsScaleBarRenderer.

Definition at line 61 of file qgshollowscalebarrenderer.cpp.

◆ flags()

QgsScaleBarRenderer::Flags QgsHollowScaleBarRenderer::flags ( ) const
overridevirtual

Returns the scalebar rendering flags, which dictates the renderer's behavior.

Since
QGIS 3.14

Reimplemented from QgsScaleBarRenderer.

Definition at line 37 of file qgshollowscalebarrenderer.cpp.

◆ id()

QString QgsHollowScaleBarRenderer::id ( ) const
overridevirtual

Returns the unique ID for this renderer.

Since
QGIS 3.14

Implements QgsScaleBarRenderer.

Definition at line 27 of file qgshollowscalebarrenderer.cpp.

◆ sortKey()

int QgsHollowScaleBarRenderer::sortKey ( ) const
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 51 of file qgshollowscalebarrenderer.cpp.

◆ visibleName()

QString QgsHollowScaleBarRenderer::visibleName ( ) const
overridevirtual

Returns the user friendly, translated name for the renderer.

Since
QGIS 3.14

Implements QgsScaleBarRenderer.

Definition at line 32 of file qgshollowscalebarrenderer.cpp.


The documentation for this class was generated from the following files: