QGIS API Documentation  3.8.0-Zanzibar (11aff65)
Public Member Functions | List of all members
QgsNumericScaleBarRenderer Class Reference

A scale bar style that draws text in the form of '1:XXXXX'. More...

#include <qgsnumericscalebarrenderer.h>

Inheritance diagram for QgsNumericScaleBarRenderer:
Inheritance graph
[legend]

Public Member Functions

 QgsNumericScaleBarRenderer ()=default
 Constructor for QgsNumericScaleBarRenderer. More...
 
QSizeF calculateBoxSize (const QgsScaleBarSettings &settings, const QgsScaleBarRenderer::ScaleBarContext &scaleContext) const override
 Calculates the required box size (in millimeters) for a scalebar using the specified settings and scaleContext. 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...
 
QString name () const override
 Returns the unique name for this style. More...
 
- Public Member Functions inherited from QgsScaleBarRenderer
 QgsScaleBarRenderer ()=default
 Constructor for QgsScaleBarRenderer. More...
 
virtual ~QgsScaleBarRenderer ()=default
 

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
 Returns the x-offset (in render context painter units) used for the first label in the scalebar. More...
 
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 > segmentWidths (const QgsScaleBarRenderer::ScaleBarContext &scaleContext, const QgsScaleBarSettings &settings) const
 Returns a list of widths of each segment of the scalebar. More...
 

Detailed Description

A scale bar style that draws text in the form of '1:XXXXX'.

Since
QGIS 3.0

Definition at line 30 of file qgsnumericscalebarrenderer.h.

Constructor & Destructor Documentation

◆ QgsNumericScaleBarRenderer()

QgsNumericScaleBarRenderer::QgsNumericScaleBarRenderer ( )
default

Constructor for QgsNumericScaleBarRenderer.

Member Function Documentation

◆ calculateBoxSize()

QSizeF QgsNumericScaleBarRenderer::calculateBoxSize ( const QgsScaleBarSettings settings,
const QgsScaleBarRenderer::ScaleBarContext scaleContext 
) const
overridevirtual

Calculates the required box size (in millimeters) for a scalebar using the specified settings and scaleContext.

Reimplemented from QgsScaleBarRenderer.

Definition at line 60 of file qgsnumericscalebarrenderer.cpp.

◆ draw()

void QgsNumericScaleBarRenderer::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 23 of file qgsnumericscalebarrenderer.cpp.

◆ name()

QString QgsNumericScaleBarRenderer::name ( ) const
inlineoverridevirtual

Returns the unique name for this style.

Implements QgsScaleBarRenderer.

Definition at line 39 of file qgsnumericscalebarrenderer.h.


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