QGIS API Documentation  3.4.15-Madeira (e83d02e274)
Public Types | Public Member Functions | List of all members
QgsTicksScaleBarRenderer Class Reference

A scale bar that draws segments using short ticks. More...

#include <qgsticksscalebarrenderer.h>

Inheritance diagram for QgsTicksScaleBarRenderer:
Inheritance graph
[legend]

Public Types

enum  TickPosition { TicksUp, TicksDown, TicksMiddle }
 Tick positions. More...
 

Public Member Functions

 QgsTicksScaleBarRenderer ()=default
 Constructor for QgsTicksScaleBarRenderer. 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...
 
void setTickPosition (TickPosition position)
 Sets the position for tick marks in the scalebar. More...
 
TickPosition tickPosition () const
 Returns the position for tick marks in the scalebar. More...
 
- Public Member Functions inherited from QgsScaleBarRenderer
 QgsScaleBarRenderer ()=default
 Constructor for QgsScaleBarRenderer. More...
 
virtual ~QgsScaleBarRenderer ()=default
 
virtual 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...
 

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 that draws segments using short ticks.

Since
QGIS 3.0

Definition at line 29 of file qgsticksscalebarrenderer.h.

Member Enumeration Documentation

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.

Constructor & Destructor Documentation

QgsTicksScaleBarRenderer::QgsTicksScaleBarRenderer ( )
default

Constructor for QgsTicksScaleBarRenderer.

Member Function Documentation

void QgsTicksScaleBarRenderer::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 36 of file qgsticksscalebarrenderer.cpp.

QString QgsTicksScaleBarRenderer::name ( ) const
overridevirtual

Returns the unique name for this style.

Implements QgsScaleBarRenderer.

Definition at line 22 of file qgsticksscalebarrenderer.cpp.

void QgsTicksScaleBarRenderer::setTickPosition ( TickPosition  position)
inline

Sets the position for tick marks in the scalebar.

See also
tickPosition()

Definition at line 56 of file qgsticksscalebarrenderer.h.

TickPosition QgsTicksScaleBarRenderer::tickPosition ( ) const
inline

Returns the position for tick marks in the scalebar.

See also
setTickPosition()

Definition at line 62 of file qgsticksscalebarrenderer.h.


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