Eneboo - Documentación para desarrolladores
Clases | Tipos públicos | Métodos públicos | Métodos protegidos
Referencia de la Clase QwtAbstractScaleDraw

A abstract base class for drawing scales. Más...

#include <qwt_abstract_scale_draw.h>

Diagrama de herencias de QwtAbstractScaleDraw
QwtRoundScaleDraw QwtScaleDraw QwtDialScaleDraw

Lista de todos los miembros.

Clases

class  PrivateData

Tipos públicos

enum  ScaleComponent { Backbone = 1, Ticks = 2, Labels = 4 }

Métodos públicos

 QwtAbstractScaleDraw ()
 Constructor.
 QwtAbstractScaleDraw (const QwtAbstractScaleDraw &)
 Copy constructor.
virtual ~QwtAbstractScaleDraw ()
 Destructor.
QwtAbstractScaleDrawoperator= (const QwtAbstractScaleDraw &)
 Assignment operator.
void setScaleDiv (const QwtScaleDiv &s)
const QwtScaleDivscaleDiv () const
void setTransformation (QwtScaleTransformation *)
const QwtScaleMapmap () const
void enableComponent (ScaleComponent, bool enable=true)
bool hasComponent (ScaleComponent) const
void setTickLength (QwtScaleDiv::TickType, int length)
int tickLength (QwtScaleDiv::TickType) const
int majTickLength () const
void setSpacing (int margin)
 Set the spacing between tick and labels.
int spacing () const
 Get the spacing.
virtual void draw (QPainter *, const QColorGroup &) const
 Draw the scale.
virtual QwtText label (double) const
 Convert a value into its representing label.
virtual int extent (const QPen &, const QFont &) const =0
void setMinimumExtent (int)
 Set a minimum for the extent.
int minimumExtent () const
QwtScaleMapscaleMap ()

Métodos protegidos

virtual void drawTick (QPainter *painter, double value, int len) const =0
virtual void drawBackbone (QPainter *painter) const =0
virtual void drawLabel (QPainter *painter, double value) const =0
void invalidateCache ()
const QwtTexttickLabel (const QFont &, double value) const
 Convert a value into its representing label and cache it.

Descripción detallada

A abstract base class for drawing scales.

QwtAbstractScaleDraw can be used to draw linear or logarithmic scales.

After a scale division has been specified as a QwtScaleDiv object using QwtAbstractScaleDraw::setScaleDiv(const QwtScaleDiv &s), the scale can be drawn with the QwtAbstractScaleDraw::draw() member.


Documentación de las enumeraciones miembro de la clase

Components of a scale

  • Backbone
  • Ticks
  • Labels
Ver también:
QwtAbstractScaleDraw::enableComponent, QwtAbstractScaleDraw::hasComponent
Valores de enumeraciones:
Backbone 
Ticks 
Labels 

Documentación del constructor y destructor

QwtAbstractScaleDraw::QwtAbstractScaleDraw ( )

Constructor.

The range of the scale is initialized to [0, 100], The spacing (distance between ticks and labels) is set to 4, the tick lengths are set to 4,6 and 8 pixels

QwtAbstractScaleDraw::QwtAbstractScaleDraw ( const QwtAbstractScaleDraw other)

Copy constructor.

QwtAbstractScaleDraw::~QwtAbstractScaleDraw ( ) [virtual]

Destructor.


Documentación de las funciones miembro

void QwtAbstractScaleDraw::draw ( QPainter painter,
const QColorGroup colorGroup 
) const [virtual]

Draw the scale.

Parámetros:
painterThe painter
colorGroupColor group, text color is used for the labels, foreground color for ticks and backbone
virtual void QwtAbstractScaleDraw::drawBackbone ( QPainter painter) const [protected, pure virtual]

Draws the baseline of the scale

Parámetros:
painterPainter
Ver también:
drawTick(), drawLabel()

Implementado en QwtRoundScaleDraw y QwtScaleDraw.

virtual void QwtAbstractScaleDraw::drawLabel ( QPainter painter,
double  value 
) const [protected, pure virtual]

Draws the label for a major scale tick

Parámetros:
painterPainter
valueValue
Ver también:
drawTick, drawBackbone

Implementado en QwtRoundScaleDraw y QwtScaleDraw.

virtual void QwtAbstractScaleDraw::drawTick ( QPainter painter,
double  value,
int  len 
) const [protected, pure virtual]

Draw a tick

Parámetros:
painterPainter
valueValue of the tick
lenLenght of the tick
Ver también:
drawBackbone(), drawLabel()

Implementado en QwtRoundScaleDraw y QwtScaleDraw.

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

En/Disable a component of the scale

Parámetros:
componentScale component
enableOn/Off
Ver también:
QwtAbstractScaleDraw::hasComponent
virtual int QwtAbstractScaleDraw::extent ( const QPen ,
const QFont  
) const [pure virtual]

Calculate the extent

The extent is the distcance from the baseline to the outermost pixel of the scale draw in opposite to its orientation. It is at least minimumExtent() pixels.

Ver también:
setMinimumExtent(), minimumExtent()

Implementado en QwtRoundScaleDraw y QwtScaleDraw.

bool QwtAbstractScaleDraw::hasComponent ( ScaleComponent  component) const

Check if a component is enabled

Ver también:
QwtAbstractScaleDraw::enableComponent
void QwtAbstractScaleDraw::invalidateCache ( ) [protected]

Invalidate the cache used by QwtAbstractScaleDraw::tickLabel

The cache is invalidated, when a new QwtScaleDiv is set. If the labels need to be changed. while the same QwtScaleDiv is set, QwtAbstractScaleDraw::invalidateCache needs to be called manually.

QwtText QwtAbstractScaleDraw::label ( double  value) const [virtual]

Convert a value into its representing label.

The value is converted to a plain text using QLocale::system().toString(value). This method is often overloaded by applications to have individual labels.

Parámetros:
valueValue
Devuelve:
Label string.

Reimplementado en QwtDialScaleDraw.

int QwtAbstractScaleDraw::majTickLength ( ) const

The same as QwtAbstractScaleDraw::tickLength(QwtScaleDiv::MajorTick).

const QwtScaleMap & QwtAbstractScaleDraw::map ( ) const
Devuelve:
Map how to translate between scale and pixel values
int QwtAbstractScaleDraw::minimumExtent ( ) const

Get the minimum extent

Ver también:
extent(), setMinimumExtent()
QwtAbstractScaleDraw & QwtAbstractScaleDraw::operator= ( const QwtAbstractScaleDraw other)

Assignment operator.

const QwtScaleDiv & QwtAbstractScaleDraw::scaleDiv ( ) const
Devuelve:
scale division
QwtScaleMap & QwtAbstractScaleDraw::scaleMap ( )
Devuelve:
Map how to translate between scale and pixel values
void QwtAbstractScaleDraw::setMinimumExtent ( int  minExtent)

Set a minimum for the extent.

The extent is calculated from the coomponents of the scale draw. In situations, where the labels are changing and the layout depends on the extent (f.e scrolling a scale), setting an upper limit as minimum extent will avoid jumps of the layout.

Parámetros:
minExtentMinimum extent
Ver también:
extent(), minimumExtent()
void QwtAbstractScaleDraw::setScaleDiv ( const QwtScaleDiv sd)

Change the scale division

Parámetros:
sdNew scale division
void QwtAbstractScaleDraw::setSpacing ( int  spacing)

Set the spacing between tick and labels.

The spacing is the distance between ticks and labels. The default spacing is 4 pixels.

Parámetros:
spacingSpacing
Ver también:
QwtAbstractScaleDraw::spacing
void QwtAbstractScaleDraw::setTickLength ( QwtScaleDiv::TickType  tickType,
int  length 
)

Set the length of the ticks

Parámetros:
tickTypeTick type
lengthNew length
Atención:
the length is limited to [0..1000]
void QwtAbstractScaleDraw::setTransformation ( QwtScaleTransformation transformation)

Change the transformation of the scale

Parámetros:
transformationNew scale transformation
int QwtAbstractScaleDraw::spacing ( ) const

Get the spacing.

The spacing is the distance between ticks and labels. The default spacing is 4 pixels.

Ver también:
QwtAbstractScaleDraw::setSpacing
const QwtText & QwtAbstractScaleDraw::tickLabel ( const QFont font,
double  value 
) const [protected]

Convert a value into its representing label and cache it.

The conversion between value and label is called very often in the layout and painting code. Unfortunately the calculation of the label sizes might be slow (really slow for rich text in Qt4), so it's necessary to cache the labels.

Parámetros:
fontFont
valueValue
Devuelve:
Tick label
int QwtAbstractScaleDraw::tickLength ( QwtScaleDiv::TickType  tickType) const

Return the length of the ticks

Ver también:
QwtAbstractScaleDraw::setTickLength, QwtAbstractScaleDraw::majTickLength

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'