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

QwtDial class provides a rounded range control. Más...

#include <qwt_dial.h>

Diagrama de herencias de QwtDial
QwtAbstractSlider QWidget QwtDoubleRange QObject QPaintDevice QObject QPaintDevice Qt Qt Qt Qt QwtAnalogClock QwtCompass

Lista de todos los miembros.

Clases

class  PrivateData

Tipos públicos

enum  Shadow { Plain = QFrame::Plain, Raised = QFrame::Raised, Sunken = QFrame::Sunken }
 Frame shadow. Más...
enum  ScaleOptions { ScaleBackbone = 1, ScaleTicks = 2, ScaleLabel = 4 }
 see QwtDial::setScaleOptions Más...
enum  Mode { RotateNeedle, RotateScale }

Métodos públicos

 QwtDial (QWidget *parent=NULL)
 Constructor.
 QwtDial (QWidget *parent, const char *name)
 Constructor.
virtual ~QwtDial ()
 Destructor.
void setFrameShadow (Shadow)
Shadow frameShadow () const
bool hasVisibleBackground () const
void showBackground (bool)
void setLineWidth (int)
int lineWidth () const
void setMode (Mode)
 Change the mode of the meter.
Mode mode () const
virtual void setWrapping (bool)
bool wrapping () const
virtual void setScale (int maxMajIntv, int maxMinIntv, double step=0.0)
void setScaleArc (double min, double max)
void setScaleOptions (int)
void setScaleTicks (int minLen, int medLen, int majLen, int penWidth=1)
 See: QwtAbstractScaleDraw::setTickLength, QwtDialScaleDraw::setPenWidth.
double minScaleArc () const
double maxScaleArc () const
virtual void setOrigin (double)
 Change the origin.
double origin () const
virtual void setNeedle (QwtDialNeedle *)
const QwtDialNeedleneedle () const
QwtDialNeedleneedle ()
QRect boundingRect () const
QRect contentsRect () const
virtual QRect scaleContentsRect () const
virtual QSize sizeHint () const
virtual QSize minimumSizeHint () const
 Return a minimum size hint.
virtual void setScaleDraw (QwtDialScaleDraw *)
QwtDialScaleDrawscaleDraw ()
 Return the scale draw.
const QwtDialScaleDrawscaleDraw () const
 Return the scale draw.

Métodos protegidos

virtual void paintEvent (QPaintEvent *)
virtual void resizeEvent (QResizeEvent *)
virtual void keyPressEvent (QKeyEvent *)
virtual void updateMask ()
 Update the mask of the dial.
virtual void drawFrame (QPainter *p)
virtual void drawContents (QPainter *) const
 Draw the contents inside the frame.
virtual void drawFocusIndicator (QPainter *) const
virtual void drawScale (QPainter *, const QPoint &center, int radius, double origin, double arcMin, double arcMax) const
virtual void drawScaleContents (QPainter *painter, const QPoint &center, int radius) const
virtual void drawNeedle (QPainter *, const QPoint &, int radius, double direction, QPalette::ColorGroup) const
virtual QwtText scaleLabel (double) const
void updateScale ()
virtual void rangeChange ()
 QwtDoubleRange update hook.
virtual void valueChange ()
 QwtDoubleRange update hook.
virtual double getValue (const QPoint &)
virtual void getScrollMode (const QPoint &, int &scrollMode, int &direction)

Propiedades

bool visibleBackground
int lineWidth
Shadow frameShadow
Mode mode
double origin
bool wrapping

Amigas

class QwtDialScaleDraw

Descripción detallada

QwtDial class provides a rounded range control.

QwtDial is intended as base class for dial widgets like speedometers, compass widgets, clocks ...

dials2.png

A dial contains a scale and a needle indicating the current value of the dial. Depending on Mode one of them is fixed and the other is rotating. If not isReadOnly() the dial can be rotated by dragging the mouse or using keyboard inputs (see keyPressEvent()). A dial might be wrapping, what means a rotation below/above one limit continues on the other limit (f.e compass). The scale might cover any arc of the dial, its values are related to the origin() of the dial.

Qwt is missing a set of good looking needles (QwtDialNeedle). Contributions are very welcome.

Ver también:
QwtCompass, QwtAnalogClock, QwtDialNeedle
Nota:
The examples/dials example shows different types of dials.

Documentación de las enumeraciones miembro de la clase

In case of RotateNeedle the needle is rotating, in case of RotateScale, the needle points to origin() and the scale is rotating.

Valores de enumeraciones:
RotateNeedle 
RotateScale 

see QwtDial::setScaleOptions

Valores de enumeraciones:
ScaleBackbone 
ScaleTicks 
ScaleLabel 

Frame shadow.

Unfortunately it is not possible to use QFrame::Shadow as a property of a widget that is not derived from QFrame. The following enum is made for the designer only. It is safe to use QFrame::Shadow instead.

Valores de enumeraciones:
Plain 
Raised 
Sunken 

Documentación del constructor y destructor

QwtDial::QwtDial ( QWidget parent = NULL) [explicit]

Constructor.

Parámetros:
parentParent widget

Create a dial widget with no scale and no needle. The default origin is 90.0 with no valid value. It accepts mouse and keyboard inputs and has no step size. The default mode is QwtDial::RotateNeedle.

QwtDial::QwtDial ( QWidget parent,
const char *  name 
) [explicit]

Constructor.

Parámetros:
parentParent widget
nameObject name

Create a dial widget with no scale and no needle. The default origin is 90.0 with no valid value. It accepts mouse and keyboard inputs and has no step size. The default mode is QwtDial::RotateNeedle.

QwtDial::~QwtDial ( ) [virtual]

Destructor.


Documentación de las funciones miembro

QRect QwtDial::boundingRect ( ) const
Devuelve:
bounding rect of the dial including the frame
Ver también:
setLineWidth(), scaleContentsRect(), contentsRect()
QRect QwtDial::contentsRect ( ) const
Devuelve:
bounding rect of the circle inside the frame
Ver también:
setLineWidth(), scaleContentsRect(), boundingRect()
void QwtDial::drawContents ( QPainter painter) const [protected, virtual]

Draw the contents inside the frame.

QColorGroup::Background is the background color outside of the frame. QColorGroup::Base is the background color inside the frame. QColorGroup::Foreground is the background color inside the scale.

Parámetros:
painterPainter
Ver también:
boundingRect(), contentsRect(), scaleContentsRect(), QWidget::setPalette
void QwtDial::drawFocusIndicator ( QPainter painter) const [protected, virtual]

Draw a dotted round circle, if !isReadOnly()

Parámetros:
painterPainter
void QwtDial::drawFrame ( QPainter painter) [protected, virtual]

Draw the frame around the dial

Parámetros:
painterPainter
Ver también:
lineWidth(), frameShadow()
void QwtDial::drawNeedle ( QPainter painter,
const QPoint center,
int  radius,
double  direction,
QPalette::ColorGroup  cg 
) const [protected, virtual]

Draw the needle

Parámetros:
painterPainter
centerCenter of the dial
radiusLength for the needle
directionDirection of the needle in degrees, counter clockwise
cgColorGroup

Reimplementado en QwtAnalogClock.

void QwtDial::drawScale ( QPainter painter,
const QPoint center,
int  radius,
double  origin,
double  minArc,
double  maxArc 
) const [protected, virtual]

Draw the scale

Parámetros:
painterPainter
centerCenter of the dial
radiusRadius of the scale
originOrigin of the scale
minArcMinimum of the arc
maxArcMinimum of the arc
Ver también:
QwtAbstractScaleDraw::setAngleRange
void QwtDial::drawScaleContents ( QPainter painter,
const QPoint center,
int  radius 
) const [protected, virtual]

Draw the contents inside the scale

Paints nothing.

Parámetros:
painterPainter
centerCenter of the contents circle
radiusRadius of the contents circle

Reimplementado en QwtCompass.

Shadow QwtDial::frameShadow ( ) const
void QwtDial::getScrollMode ( const QPoint p,
int scrollMode,
int direction 
) [protected, virtual]
double QwtDial::getValue ( const QPoint pos) [protected, virtual]

Find the value for a given position

Parámetros:
posPosition
Devuelve:
Value

Implementa QwtAbstractSlider.

bool QwtDial::hasVisibleBackground ( ) const

true when the area outside of the frame is visible

Ver también:
showBackground(), setMask()
void QwtDial::keyPressEvent ( QKeyEvent e) [protected, virtual]

Handles key events

Ver también:
isReadOnly()

Reimplementado de QwtAbstractSlider.

Reimplementado en QwtCompass.

int QwtDial::lineWidth ( ) const
double QwtDial::maxScaleArc ( ) const
Devuelve:
Upper limit of the scale arc
QSize QwtDial::minimumSizeHint ( ) const [virtual]

Return a minimum size hint.

Atención:
The return value of QwtDial::minimumSizeHint() depends on the font and the scale.

Reimplementado de QWidget.

double QwtDial::minScaleArc ( ) const
Devuelve:
Lower limit of the scale arc
Mode QwtDial::mode ( ) const
QwtDialNeedle * QwtDial::needle ( )
Devuelve:
needle
Ver también:
setNeedle()
const QwtDialNeedle * QwtDial::needle ( ) const
Devuelve:
needle
Ver también:
setNeedle()
double QwtDial::origin ( ) const
void QwtDial::paintEvent ( QPaintEvent e) [protected, virtual]

Paint the dial

Parámetros:
ePaint event

Reimplementado de QWidget.

void QwtDial::rangeChange ( ) [protected, virtual]

QwtDoubleRange update hook.

Reimplementado de QwtDoubleRange.

void QwtDial::resizeEvent ( QResizeEvent e) [protected, virtual]

Resize the dial widget

Parámetros:
eResize event

Reimplementado de QWidget.

QRect QwtDial::scaleContentsRect ( ) const [virtual]
Devuelve:
rect inside the scale
Ver también:
setLineWidth(), boundingRect(), contentsRect()
const QwtDialScaleDraw * QwtDial::scaleDraw ( ) const

Return the scale draw.

QwtDialScaleDraw * QwtDial::scaleDraw ( )

Return the scale draw.

QwtText QwtDial::scaleLabel ( double  value) const [protected, virtual]

Find the label for a value

Parámetros:
valueValue
Devuelve:
label

Reimplementado en QwtAnalogClock y QwtCompass.

void QwtDial::setFrameShadow ( Shadow  shadow)

Sets the frame shadow value from the frame style.

Parámetros:
shadowFrame shadow
Ver también:
setLineWidth(), QFrame::setFrameShadow()
void QwtDial::setLineWidth ( int  lineWidth)

Sets the line width

Parámetros:
lineWidthLine width
Ver también:
setFrameShadow()
void QwtDial::setMode ( Mode  mode)

Change the mode of the meter.

Parámetros:
modeNew mode

The value of the meter is indicated by the difference between north of the scale and the direction of the needle. In case of QwtDial::RotateNeedle north is pointing to the origin() and the needle is rotating, in case of QwtDial::RotateScale, the needle points to origin() and the scale is rotating.

The default mode is QwtDial::RotateNeedle.

Ver también:
mode(), setValue(), setOrigin()
void QwtDial::setNeedle ( QwtDialNeedle needle) [virtual]

Set a needle for the dial

Qwt is missing a set of good looking needles. Contributions are very welcome.

Parámetros:
needleNeedle
Atención:
The needle will be deleted, when a different needle is set or in ~QwtDial()
void QwtDial::setOrigin ( double  origin) [virtual]

Change the origin.

The origin is the angle where scale and needle is relative to.

Parámetros:
originNew origin
Ver también:
origin()
void QwtDial::setScale ( int  maxMajIntv,
int  maxMinIntv,
double  step = 0.0 
) [virtual]

Change the intervals of the scale

Ver también:
QwtAbstractScaleDraw::setScale
void QwtDial::setScaleArc ( double  minArc,
double  maxArc 
)

Change the arc of the scale

Parámetros:
minArcLower limit
maxArcUpper limit
void QwtDial::setScaleDraw ( QwtDialScaleDraw scaleDraw) [virtual]

Set an individual scale draw

Parámetros:
scaleDrawScale draw
Atención:
The previous scale draw is deleted
void QwtDial::setScaleOptions ( int  options)

A wrapper method for accessing the scale draw.

  • options == 0
    No visible scale: setScaleDraw(NULL)
  • options & ScaleBackbone
    En/disable the backbone of the scale.
  • options & ScaleTicks
    En/disable the ticks of the scale.
  • options & ScaleLabel
    En/disable scale labels
Ver también:
QwtAbstractScaleDraw::enableComponent
void QwtDial::setScaleTicks ( int  minLen,
int  medLen,
int  majLen,
int  penWidth = 1 
)
void QwtDial::setWrapping ( bool  wrapping) [virtual]

Sets whether it is possible to step the value from the highest value to the lowest value and vice versa to on.

Parámetros:
wrappingen/disables wrapping
Ver también:
wrapping(), QwtDoubleRange::periodic()
Nota:
The meaning of wrapping is like the wrapping property of QSpinBox, but not like it is used in QDial.
void QwtDial::showBackground ( bool  show)

Show/Hide the area outside of the frame

Parámetros:
showShow if true, hide if false
Ver también:
hasVisibleBackground(), setMask()
Atención:
When QwtDial is a toplevel widget the window border might disappear too.
QSize QwtDial::sizeHint ( ) const [virtual]
Devuelve:
Size hint

Reimplementado de QWidget.

void QwtDial::updateMask ( ) [protected, virtual]

Update the mask of the dial.

In case of "hasVisibleBackground() == false", the backgound is transparent by a mask.

Ver también:
showBackground(), hasVisibleBackground()

Reimplementado de QWidget.

void QwtDial::updateScale ( ) [protected]

Update the scale with the current attributes

Ver también:
setScale()
void QwtDial::valueChange ( ) [protected, virtual]

QwtDoubleRange update hook.

Reimplementado de QwtAbstractSlider.

bool QwtDial::wrapping ( ) const

Documentación de las funciones relacionadas y clases amigas

friend class QwtDialScaleDraw [friend]

Documentación de propiedades

QwtDial::Shadow QwtDial::frameShadow [read, write]
Devuelve:
Frame shadow /sa setFrameShadow(), lineWidth(), QFrame::frameShadow
int QwtDial::lineWidth [read, write]
Devuelve:
Line width of the frame
Ver también:
setLineWidth(), frameShadow(), lineWidth()
QwtDial::Mode QwtDial::mode [read, write]
Devuelve:
mode of the dial.

The value of the dial is indicated by the difference between the origin and the direction of the needle. In case of QwtDial::RotateNeedle the scale arc is fixed to the origin() and the needle is rotating, in case of QwtDial::RotateScale, the needle points to origin() and the scale is rotating.

The default mode is QwtDial::RotateNeedle.

Ver también:
setMode(), origin(), setScaleArc(), value()
double QwtDial::origin [read, write]

The origin is the angle where scale and needle is relative to.

Devuelve:
Origin of the dial
Ver también:
setOrigin()
bool QwtDial::visibleBackground [read, write]
bool QwtDial::wrapping [read, write]

wrapping() holds whether it is possible to step the value from the highest value to the lowest value and vice versa.

Ver también:
setWrapping(), QwtDoubleRange::setPeriodic()
Nota:
The meaning of wrapping is like the wrapping property of QSpinBox, but not like it is used in QDial.

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'