QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
QwtAbstractScaleDraw Class Referenceabstract

An abstract base class for drawing scales. More...

#include <qwt_abstract_scale_draw.h>

Inheritance diagram for QwtAbstractScaleDraw:
QwtRoundScaleDraw QwtScaleDraw QwtCompassScaleDraw QwtDateScaleDraw

Classes

class  PrivateData
 

Public Types

enum  ScaleComponent { Backbone = 0x01 , Ticks = 0x02 , Labels = 0x04 }
 Components of a scale. More...
 

Public Member Functions

 QwtAbstractScaleDraw ()
 Constructor for QwtAbstractScaleDraw.
 
virtual ~QwtAbstractScaleDraw ()
 Destructor for QwtAbstractScaleDraw .
 
void setScaleDiv (const QwtScaleDiv &)
 Set the scale division.
 
const QwtScaleDivscaleDiv () const
 Return the scale division.
 
void setTransformation (QwtTransform *)
 Set the scale transformation.
 
const QwtScaleMapscaleMap () const
 Return the scale map (const version)
 
QwtScaleMapscaleMap ()
 Return the scale map (non-const version)
 
void enableComponent (ScaleComponent, bool enable=true)
 Enable or disable a scale component.
 
bool hasComponent (ScaleComponent) const
 Check if a component is enabled.
 
void setTickLength (QwtScaleDiv::TickType, double length)
 Set the length of the ticks.
 
double tickLength (QwtScaleDiv::TickType) const
 Get the length of the ticks.
 
double maxTickLength () const
 Get the length of the longest tick.
 
void setSpacing (double)
 Set the spacing between tick and labels.
 
double spacing () const
 Get the spacing.
 
void setPenWidthF (qreal width)
 Specify the width of the scale pen.
 
qreal penWidthF () const
 Get the scale pen width.
 
void setSelected (bool on)
 Set whether the scale draw is selected.
 
bool isSelected () const
 Check if the scale draw is selected.
 
void setSelectedPenWidthOffset (qreal offset=1)
 Set the pen width offset for the axis when it is in selected state.
 
qreal selectedPenWidthOffset () const
 Get the current pen width offset for the axis when it is in selected state.
 
virtual void draw (QPainter *, const QPalette &) const
 Draw the scale.
 
virtual QwtText label (double) const
 Convert a value into its representing label.
 
virtual double extent (const QFont &font) const =0
 
void setMinimumExtent (double)
 Set a minimum for the extent.
 
double minimumExtent () const
 Get the minimum extent.
 
void invalidateCache ()
 Invalidate the cache used by tickLabel()
 

Protected Member Functions

virtual void drawTick (QPainter *painter, double value, double len) const =0
 Draw a tick.
 
virtual void drawBackbone (QPainter *painter) const =0
 Draws the baseline of the scale.
 
virtual void drawLabel (QPainter *painter, double value) const =0
 Draws the label for a major scale tick.
 
const QwtTexttickLabel (const QFont &, double value) const
 Convert a value into its representing label and cache it.
 

Detailed Description

An abstract base class for drawing scales.

Member Enumeration Documentation

◆ ScaleComponent

Components of a scale.

Enumerator
Backbone 

Backbone = the line where the ticks are located

Ticks 

Ticks

Labels 

Labels

Constructor & Destructor Documentation

◆ QwtAbstractScaleDraw()

QwtAbstractScaleDraw::QwtAbstractScaleDraw ( )

Constructor for QwtAbstractScaleDraw.

◆ ~QwtAbstractScaleDraw()

QwtAbstractScaleDraw::~QwtAbstractScaleDraw ( )
virtual

Destructor for QwtAbstractScaleDraw .

Member Function Documentation

◆ draw()

void QwtAbstractScaleDraw::draw ( QPainter *  painter,
const QPalette &  palette 
) const
virtual

Draw the scale.

◆ drawBackbone()

virtual void QwtAbstractScaleDraw::drawBackbone ( QPainter *  painter) const
protectedpure virtual

Draws the baseline of the scale.

Implemented in QwtRoundScaleDraw, and QwtScaleDraw.

◆ drawLabel()

virtual void QwtAbstractScaleDraw::drawLabel ( QPainter *  painter,
double  value 
) const
protectedpure virtual

Draws the label for a major scale tick.

Implemented in QwtRoundScaleDraw, and QwtScaleDraw.

◆ drawTick()

virtual void QwtAbstractScaleDraw::drawTick ( QPainter *  painter,
double  value,
double  len 
) const
protectedpure virtual

Draw a tick.

Implemented in QwtRoundScaleDraw, and QwtScaleDraw.

◆ enableComponent()

void QwtAbstractScaleDraw::enableComponent ( ScaleComponent  component,
bool  enable = true 
)

Enable or disable a scale component.

◆ extent()

virtual double QwtAbstractScaleDraw::extent ( const QFont &  font) const
pure virtual

Implemented in QwtRoundScaleDraw, and QwtScaleDraw.

◆ hasComponent()

bool QwtAbstractScaleDraw::hasComponent ( ScaleComponent  component) const

Check if a component is enabled.

◆ invalidateCache()

void QwtAbstractScaleDraw::invalidateCache ( )

Invalidate the cache used by tickLabel()

◆ isSelected()

bool QwtAbstractScaleDraw::isSelected ( ) const

Check if the scale draw is selected.

◆ label()

QwtText QwtAbstractScaleDraw::label ( double  value) const
virtual

Convert a value into its representing label.

Reimplemented in QwtCompassScaleDraw, and QwtDateScaleDraw.

◆ maxTickLength()

double QwtAbstractScaleDraw::maxTickLength ( ) const

Get the length of the longest tick.

◆ minimumExtent()

double QwtAbstractScaleDraw::minimumExtent ( ) const

Get the minimum extent.

◆ penWidthF()

qreal QwtAbstractScaleDraw::penWidthF ( ) const

Get the scale pen width.

◆ scaleDiv()

const QwtScaleDiv & QwtAbstractScaleDraw::scaleDiv ( ) const

Return the scale division.

◆ scaleMap() [1/2]

QwtScaleMap & QwtAbstractScaleDraw::scaleMap ( )

Return the scale map (non-const version)

◆ scaleMap() [2/2]

const QwtScaleMap & QwtAbstractScaleDraw::scaleMap ( ) const

Return the scale map (const version)

◆ selectedPenWidthOffset()

qreal QwtAbstractScaleDraw::selectedPenWidthOffset ( ) const

Get the current pen width offset for the axis when it is in selected state.

◆ setMinimumExtent()

void QwtAbstractScaleDraw::setMinimumExtent ( double  minExtent)

Set a minimum for the extent.

◆ setPenWidthF()

void QwtAbstractScaleDraw::setPenWidthF ( qreal  width)

Specify the width of the scale pen.

◆ setScaleDiv()

void QwtAbstractScaleDraw::setScaleDiv ( const QwtScaleDiv scaleDiv)

Set the scale division.

◆ setSelected()

void QwtAbstractScaleDraw::setSelected ( bool  on)

Set whether the scale draw is selected.

◆ setSelectedPenWidthOffset()

void QwtAbstractScaleDraw::setSelectedPenWidthOffset ( qreal  offset = 1)

Set the pen width offset for the axis when it is in selected state.

◆ setSpacing()

void QwtAbstractScaleDraw::setSpacing ( double  spacing)

Set the spacing between tick and labels.

◆ setTickLength()

void QwtAbstractScaleDraw::setTickLength ( QwtScaleDiv::TickType  tickType,
double  length 
)

Set the length of the ticks.

◆ setTransformation()

void QwtAbstractScaleDraw::setTransformation ( QwtTransform transformation)

Set the scale transformation.

◆ spacing()

double QwtAbstractScaleDraw::spacing ( ) const

Get the spacing.

◆ tickLabel()

const QwtText & QwtAbstractScaleDraw::tickLabel ( const QFont &  font,
double  value 
) const
protected

Convert a value into its representing label and cache it.

◆ tickLength()

double QwtAbstractScaleDraw::tickLength ( QwtScaleDiv::TickType  tickType) const

Get the length of the ticks.


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