Eneboo - Documentación para desarrolladores
Clases | Tipos públicos | Slots públicos | Señales | Métodos públicos | Métodos protegidos | Propiedades
Referencia de la Clase QwtAbstractSlider

An abstract base class for slider widgets. Más...

#include <qwt_abstract_slider.h>

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

Lista de todos los miembros.

Clases

class  PrivateData

Tipos públicos

enum  ScrollMode {
  ScrNone, ScrMouse, ScrTimer, ScrDirect,
  ScrPage
}

Slots públicos

virtual void setValue (double val)
 Move the slider to a specified value.
virtual void fitValue (double val)
 Set the slider's value to the nearest integer multiple of the step size.
virtual void incValue (int steps)
 Increment the value by a specified number of steps.
virtual void setReadOnly (bool)

Señales

void valueChanged (double value)
 Notify a change of value.
void sliderPressed ()
void sliderReleased ()
void sliderMoved (double value)

Métodos públicos

 QwtAbstractSlider (Qt::Orientation, QWidget *parent=NULL)
 Constructor.
virtual ~QwtAbstractSlider ()
 Destructor.
void setUpdateTime (int t)
 Specify the update interval for automatic scrolling.
void stopMoving ()
 Stop updating if automatic scrolling is active.
void setTracking (bool enable)
 Enables or disables tracking.
virtual void setMass (double val)
 Set the slider's mass for flywheel effect.
virtual double mass () const
virtual void setOrientation (Orientation o)
 Set the orientation.
Orientation orientation () const
bool isReadOnly () const
bool isValid () const
void setValid (bool valid)

Métodos protegidos

virtual void setPosition (const QPoint &)
virtual void valueChange ()
virtual void timerEvent (QTimerEvent *e)
virtual void mousePressEvent (QMouseEvent *e)
 Mouse press event handler.
virtual void mouseReleaseEvent (QMouseEvent *e)
 Mouse Release Event handler.
virtual void mouseMoveEvent (QMouseEvent *e)
virtual void keyPressEvent (QKeyEvent *e)
virtual void wheelEvent (QWheelEvent *e)
virtual double getValue (const QPoint &p)=0
 Determine the value corresponding to a specified poind.
virtual void getScrollMode (const QPoint &p, int &scrollMode, int &direction)=0
 Determine what to do when the user presses a mouse button.
void setMouseOffset (double)
double mouseOffset () const
int scrollMode () const

Propiedades

bool readOnly
bool valid
double mass
Orientation orientation

Descripción detallada

An abstract base class for slider widgets.

QwtAbstractSlider is a base class for slider widgets. It handles mouse events and updates the slider's value accordingly. Derived classes only have to implement the getValue() and getScrollMode() members, and should react to a valueChange(), which normally requires repainting.


Documentación de las enumeraciones miembro de la clase

Scroll mode

Ver también:
getScrollMode()
Valores de enumeraciones:
ScrNone 
ScrMouse 
ScrTimer 
ScrDirect 
ScrPage 

Documentación del constructor y destructor

QwtAbstractSlider::QwtAbstractSlider ( Qt::Orientation  orientation,
QWidget parent = NULL 
) [explicit]

Constructor.

Parámetros:
orientationOrientation
parentParent widget
QwtAbstractSlider::~QwtAbstractSlider ( ) [virtual]

Destructor.


Documentación de las funciones miembro

void QwtAbstractSlider::fitValue ( double  value) [virtual, slot]

Set the slider's value to the nearest integer multiple of the step size.

Parámetros:
valeuValue
Ver también:
setValue(), incValue()

Reimplementado de QwtDoubleRange.

virtual void QwtAbstractSlider::getScrollMode ( const QPoint p,
int scrollMode,
int direction 
) [protected, pure virtual]

Determine what to do when the user presses a mouse button.

This function is abstract and has to be implemented by derived classes. It is called on a mousePress event. The derived class can determine what should happen next in dependence of the position where the mouse was pressed by returning scrolling mode and direction. QwtAbstractSlider knows the following modes:

QwtAbstractSlider::ScrNone
Scrolling switched off. Don't change the value.
QwtAbstractSlider::ScrMouse
Change the value while the user keeps the button pressed and moves the mouse.
QwtAbstractSlider::ScrTimer
Automatic scrolling. Increment the value in the specified direction as long as the user keeps the button pressed.
QwtAbstractSlider::ScrPage
Automatic scrolling. Same as ScrTimer, but increment by page size.
Parámetros:
ppoint where the mouse was pressed
Valores devueltos:
scrollModeThe scrolling mode
directiondirection: 1, 0, or -1.

Implementado en QwtDial, QwtSlider y QwtWheel.

virtual double QwtAbstractSlider::getValue ( const QPoint p) [protected, pure virtual]

Determine the value corresponding to a specified poind.

This is an abstract virtual function which is called when the user presses or releases a mouse button or moves the mouse. It has to be implemented by the derived class.

Parámetros:
ppoint

Implementado en QwtDial, QwtSlider y QwtWheel.

void QwtAbstractSlider::incValue ( int  steps) [virtual, slot]

Increment the value by a specified number of steps.

Parámetros:
stepsnumber of steps
Ver también:
setValue()

Reimplementado de QwtDoubleRange.

bool QwtAbstractSlider::isReadOnly ( ) const

In read only mode the slider can't be controlled by mouse or keyboard.

Devuelve:
true if read only
Ver también:
setReadOnly()
bool QwtAbstractSlider::isValid ( void  ) const [inline]
Ver también:
QwtDblRange::isValid

Reimplementado de QwtDoubleRange.

void QwtAbstractSlider::keyPressEvent ( QKeyEvent e) [protected, virtual]

Handles key events

  • Key_Down, KeyLeft
    Decrement by 1
  • Key_Up, Key_Right
    Increment by 1
Parámetros:
eKey event
Ver también:
isReadOnly()

Reimplementado de QWidget.

Reimplementado en QwtCompass y QwtDial.

virtual double QwtAbstractSlider::mass ( ) const [virtual]

Reimplementado en QwtWheel.

void QwtAbstractSlider::mouseMoveEvent ( QMouseEvent e) [protected, virtual]

Mouse Move Event handler

Parámetros:
eMouse event

Reimplementado de QWidget.

double QwtAbstractSlider::mouseOffset ( ) const [protected]
void QwtAbstractSlider::mousePressEvent ( QMouseEvent e) [protected, virtual]

Mouse press event handler.

Reimplementado de QWidget.

void QwtAbstractSlider::mouseReleaseEvent ( QMouseEvent e) [protected, virtual]

Mouse Release Event handler.

Reimplementado de QWidget.

Orientation QwtAbstractSlider::orientation ( ) const
int QwtAbstractSlider::scrollMode ( ) const [protected]
void QwtAbstractSlider::setMass ( double  val) [virtual]

Set the slider's mass for flywheel effect.

If the slider's mass is greater then 0, it will continue to move after the mouse button has been released. Its speed decreases with time at a rate depending on the slider's mass. A large mass means that it will continue to move for a long time.

Derived widgets may overload this function to make it public.

Parámetros:
valNew mass in kg
Bug:
If the mass is smaller than 1g, it is set to zero. The maximal mass is limited to 100kg.
Ver también:
mass()

Reimplementado en QwtWheel.

void QwtAbstractSlider::setMouseOffset ( double  offset) [protected]
void QwtAbstractSlider::setOrientation ( Qt::Orientation  o) [virtual]

Set the orientation.

Parámetros:
oOrientation. Allowed values are Qt::Horizontal and Qt::Vertical.

Reimplementado en QwtSlider y QwtWheel.

void QwtAbstractSlider::setPosition ( const QPoint p) [protected, virtual]

Move the slider to a specified point, adjust the value and emit signals if necessary.

void QwtAbstractSlider::setReadOnly ( bool  readOnly) [virtual, slot]

En/Disable read only mode

In read only mode the slider can't be controlled by mouse or keyboard.

Parámetros:
readOnlyEnables in case of true
Ver también:
isReadOnly()
void QwtAbstractSlider::setTracking ( bool  enable)

Enables or disables tracking.

If tracking is enabled, the slider emits a valueChanged() signal whenever its value changes (the default behaviour). If tracking is disabled, the value changed() signal will only be emitted if:

  • the user releases the mouse button and the value has changed or
  • at the end of automatic scrolling.

Tracking is enabled by default.

Parámetros:
enabletrue (enable) or false (disable) tracking.
void QwtAbstractSlider::setUpdateTime ( int  t)

Specify the update interval for automatic scrolling.

Parámetros:
tupdate interval in milliseconds
Ver también:
getScrollMode()
void QwtAbstractSlider::setValid ( bool  valid) [inline]
Ver también:
QwtDblRange::isValid

Reimplementado de QwtDoubleRange.

void QwtAbstractSlider::setValue ( double  val) [virtual, slot]

Move the slider to a specified value.

This function can be used to move the slider to a value which is not an integer multiple of the step size.

Parámetros:
valnew value
Ver también:
fitValue()

Reimplementado de QwtDoubleRange.

void QwtAbstractSlider::sliderMoved ( double  value) [signal]

This signal is emitted when the user moves the slider with the mouse.

Parámetros:
valuenew value
void QwtAbstractSlider::sliderPressed ( ) [signal]

This signal is emitted when the user presses the movable part of the slider (start ScrMouse Mode).

void QwtAbstractSlider::sliderReleased ( ) [signal]

This signal is emitted when the user releases the movable part of the slider.

void QwtAbstractSlider::stopMoving ( )

Stop updating if automatic scrolling is active.

void QwtAbstractSlider::timerEvent ( QTimerEvent e) [protected, virtual]

Qt timer event

Parámetros:
eTimer event

Reimplementado de QObject.

void QwtAbstractSlider::valueChange ( ) [protected, virtual]

Notify change of value

This function can be reimplemented by derived classes in order to keep track of changes, i.e. repaint the widget. The default implementation emits a valueChanged() signal if tracking is enabled.

Reimplementado de QwtDoubleRange.

Reimplementado en QwtDial, QwtSlider y QwtWheel.

void QwtAbstractSlider::valueChanged ( double  value) [signal]

Notify a change of value.

In the default setting (tracking enabled), this signal will be emitted every time the value changes ( see setTracking() ).

Parámetros:
valuenew value
void QwtAbstractSlider::wheelEvent ( QWheelEvent e) [protected, virtual]

Wheel Event handler

Parámetros:
eWhell event

Reimplementado de QWidget.


Documentación de propiedades

double QwtAbstractSlider::mass [read, write]
Devuelve:
mass
Ver también:
setMass()

Reimplementado en QwtWheel.

Qt::Orientation QwtAbstractSlider::orientation [read, write]
Devuelve:
Orientation
Ver también:
setOrientation()
bool QwtAbstractSlider::readOnly [read, write]
bool QwtAbstractSlider::valid [read, write]

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'