QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Member Functions | Protected Attributes | List of all members
QgsScaleBarStyle Class Referenceabstract

Abstraction of composer scale bar style. More...

#include <qgsscalebarstyle.h>

Inheritance diagram for QgsScaleBarStyle:
Inheritance graph
[legend]

Public Member Functions

 QgsScaleBarStyle (const QgsComposerScaleBar *bar)
 
virtual ~QgsScaleBarStyle ()
 
virtual QRectF calculateBoxSize () const
 
virtual void draw (QPainter *p, double xOffset=0) const =0
 Draws the style. More...
 
virtual void drawLabels (QPainter *p) const
 
virtual QString name () const =0
 

Protected Attributes

const QgsComposerScaleBarmScaleBar
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ QgsScaleBarStyle()

QgsScaleBarStyle::QgsScaleBarStyle ( const QgsComposerScaleBar bar)

Definition at line 23 of file qgsscalebarstyle.cpp.

◆ ~QgsScaleBarStyle()

QgsScaleBarStyle::~QgsScaleBarStyle ( )
virtual

Definition at line 33 of file qgsscalebarstyle.cpp.

Member Function Documentation

◆ calculateBoxSize()

QRectF QgsScaleBarStyle::calculateBoxSize ( ) const
virtual

Reimplemented in QgsNumericScaleBarStyle.

Definition at line 105 of file qgsscalebarstyle.cpp.

◆ draw()

virtual void QgsScaleBarStyle::draw ( QPainter p,
double  xOffset = 0 
) const
pure virtual

Draws the style.

Parameters
ppainter object
xOffsetoffset to account for centered labeling

Implemented in QgsTicksScaleBarStyle, QgsSingleBoxScaleBarStyle, QgsDoubleBoxScaleBarStyle, and QgsNumericScaleBarStyle.

◆ drawLabels()

void QgsScaleBarStyle::drawLabels ( QPainter p) const
virtual

Definition at line 38 of file qgsscalebarstyle.cpp.

◆ name()

virtual QString QgsScaleBarStyle::name ( ) const
pure virtual

Member Data Documentation

◆ mScaleBar

const QgsComposerScaleBar* QgsScaleBarStyle::mScaleBar
protected

Definition at line 48 of file qgsscalebarstyle.h.


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