QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
QgsScaleBarStyle Class Reference

Abstraction of composer scale bar style. More...

#include <qgsscalebarstyle.h>

Inheritance diagram for QgsScaleBarStyle:
Inheritance graph
[legend]
Collaboration diagram for QgsScaleBarStyle:
Collaboration graph
[legend]

Public Member Functions

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

Protected Attributes

const QgsComposerScaleBarmScaleBar

Private Member Functions

 QgsScaleBarStyle ()

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 ( const QgsComposerScaleBar bar)

Definition at line 22 of file qgsscalebarstyle.cpp.

QgsScaleBarStyle::~QgsScaleBarStyle ( )
virtual

Definition at line 32 of file qgsscalebarstyle.cpp.

QgsScaleBarStyle::QgsScaleBarStyle ( )
private

Definition at line 27 of file qgsscalebarstyle.cpp.

Member Function Documentation

QRectF QgsScaleBarStyle::calculateBoxSize ( ) const
virtual
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.

Referenced by QgsComposerScaleBar::paint().

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: