QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 void draw (QPainter *p, double xOffset=0) const =0
 Draws the style. More...
 
virtual void drawLabels (QPainter *p) const
 
virtual QRectF calculateBoxSize () 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.

Constructor & Destructor Documentation

QgsScaleBarStyle::QgsScaleBarStyle ( const QgsComposerScaleBar bar)
QgsScaleBarStyle::~QgsScaleBarStyle ( )
virtual

Member Function Documentation

QRectF QgsScaleBarStyle::calculateBoxSize ( ) const
virtual

Reimplemented in QgsNumericScaleBarStyle.

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.

void QgsScaleBarStyle::drawLabels ( QPainter *  p) const
virtual
virtual QString QgsScaleBarStyle::name ( ) const
pure virtual

Member Data Documentation

const QgsComposerScaleBar* QgsScaleBarStyle::mScaleBar
protected

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