Quantum GIS API Documentation  1.7.4
Public Member Functions | Private Member Functions
QgsNumericScaleBarStyle Class Reference

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

#include <qgsnumericscalebarstyle.h>

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

List of all members.

Public Member Functions

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

Private Member Functions

 QgsNumericScaleBarStyle ()
QString scaleText () const
 Returns the text for the scale bar or an empty string in case of error.

Detailed Description

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

Definition at line 25 of file qgsnumericscalebarstyle.h.


Constructor & Destructor Documentation

Definition at line 23 of file qgsnumericscalebarstyle.cpp.

Definition at line 33 of file qgsnumericscalebarstyle.cpp.

Definition at line 28 of file qgsnumericscalebarstyle.cpp.


Member Function Documentation

QRectF QgsNumericScaleBarStyle::calculateBoxSize ( ) const [virtual]
void QgsNumericScaleBarStyle::draw ( QPainter *  p,
double  xOffset = 0 
) const [virtual]

Draws the style.

Parameters:
ppainter object
xOffsetoffset to account for centered labeling

Implements QgsScaleBarStyle.

Definition at line 43 of file qgsnumericscalebarstyle.cpp.

References QgsComposerScaleBar::boxContentSpace(), QgsComposerItem::drawText(), QgsComposerScaleBar::font(), QgsComposerItem::fontAscentMillimeters(), QgsScaleBarStyle::mScaleBar, QgsComposerScaleBar::pen(), and scaleText().

QString QgsNumericScaleBarStyle::name ( ) const [virtual]

Implements QgsScaleBarStyle.

Definition at line 38 of file qgsnumericscalebarstyle.cpp.

QString QgsNumericScaleBarStyle::scaleText ( ) const [private]

Returns the text for the scale bar or an empty string in case of error.

Definition at line 74 of file qgsnumericscalebarstyle.cpp.

References QgsComposerScaleBar::composerMap(), QgsScaleBarStyle::mScaleBar, and QgsComposerMap::scale().

Referenced by calculateBoxSize(), and draw().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines