Classes | Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes
QwtAbstractSlider Class Reference

An abstract base class for slider widgets with a scale. More...

#include <qwt_abstract_slider.h>

Inheritance diagram for QwtAbstractSlider:
Inheritance graph
[legend]

List of all members.

Classes

class  PrivateData

Public Slots

void setValue (double val)

Signals

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

Public Member Functions

bool invertedControls () const
bool isReadOnly () const
bool isTracking () const
bool isValid () const
uint pageSteps () const
 QwtAbstractSlider (QWidget *parent=NULL)
 Constructor.
void setInvertedControls (bool)
void setPageSteps (uint)
 Set the number of steps for a page increment.
void setReadOnly (bool)
void setSingleSteps (uint)
 Set the number of steps for a single increment.
void setStepAlignment (bool)
 Enable step alignment.
void setTotalSteps (uint)
 Set the number of steps.
void setTracking (bool)
 Enables or disables tracking.
void setValid (bool)
void setWrapping (bool)
uint singleSteps () const
bool stepAlignment () const
uint totalSteps () const
double value () const
bool wrapping () const
virtual ~QwtAbstractSlider ()
 Destructor.

Protected Member Functions

double incrementedValue (double value, int stepCount) const
void incrementValue (int numSteps)
virtual bool isScrollPosition (const QPoint &pos) const =0
 Determine what to do when the user presses a mouse button.
virtual void keyPressEvent (QKeyEvent *)
virtual void mouseMoveEvent (QMouseEvent *)
virtual void mousePressEvent (QMouseEvent *)
virtual void mouseReleaseEvent (QMouseEvent *)
virtual void scaleChange ()
virtual double scrolledTo (const QPoint &pos) const =0
 Determine the value for a new position of the movable part of the slider.
virtual void sliderChange ()
 Calling update()
virtual void wheelEvent (QWheelEvent *)

Properties

bool invertedControls
uint pageSteps
bool readOnly
uint singleSteps
bool stepAlignment
uint totalSteps
bool tracking
double value
 Returns the current value.
bool wrapping

Private Member Functions

double alignedValue (double) const
double boundedValue (double) const

Private Attributes

PrivateDatad_data

Detailed Description

An abstract base class for slider widgets with a scale.

A slider widget displays a value according to a scale. The class is designed as a common super class for widgets like QwtKnob, QwtDial and QwtSlider.

When the slider is nor readOnly() its value can be modified by keyboard, mouse and wheel inputs.

The range of the slider is divided into a number of steps from which the value increments according to user inputs depend. Only for linear scales the number of steps correspond with a fixed step size.

Definition at line 32 of file qwt_abstract_slider.h.


Constructor & Destructor Documentation

QwtAbstractSlider::QwtAbstractSlider ( QWidget *  parent = NULL) [explicit]

Constructor.

The scale is initialized to [0.0, 100.0], the number of steps is set to 100 with 1 and 10 and single an page step sizes. Step alignment is enabled.

The initial value is invalid.

Parameters:
parentParent widget

Definition at line 94 of file qwt_abstract_slider.cpp.

Destructor.

Definition at line 104 of file qwt_abstract_slider.cpp.


Member Function Documentation

double QwtAbstractSlider::alignedValue ( double  value) const [private]

Definition at line 747 of file qwt_abstract_slider.cpp.

double QwtAbstractSlider::boundedValue ( double  value) const [private]

Definition at line 707 of file qwt_abstract_slider.cpp.

double QwtAbstractSlider::incrementedValue ( double  value,
int  stepCount 
) const [protected]

Increment a value

Parameters:
valueValue
stepCountNumber of steps
Returns:
Incremented value

Definition at line 665 of file qwt_abstract_slider.cpp.

void QwtAbstractSlider::incrementValue ( int  stepCount) [protected]

Increment the slider

The step size depends on the number of totalSteps()

Parameters:
stepCountNumber of steps
See also:
setTotalSteps(), incrementedValue()

Definition at line 645 of file qwt_abstract_slider.cpp.

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

Returns:
true if read only
See also:
setReadOnly()

Definition at line 162 of file qwt_abstract_slider.cpp.

virtual bool QwtAbstractSlider::isScrollPosition ( const QPoint &  pos) const [protected, pure virtual]

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

Parameters:
posMouse position
Return values:
True,whenpos is a valid scroll position
See also:
scrolledTo()

Implemented in QwtKnob, QwtDial, and QwtSlider.

Returns:
True, when tracking has been enabled
See also:
setTracking()

Definition at line 189 of file qwt_abstract_slider.cpp.

Returns:
True, when the value is invalid

Definition at line 128 of file qwt_abstract_slider.cpp.

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

Handles key events

QwtAbstractSlider handles the following keys:

Parameters:
eventKey event
See also:
isReadOnly()

Reimplemented in QwtCompass.

Definition at line 365 of file qwt_abstract_slider.cpp.

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

Mouse Move Event handler

Parameters:
eventMouse event

Definition at line 223 of file qwt_abstract_slider.cpp.

void QwtAbstractSlider::mousePressEvent ( QMouseEvent *  event) [protected, virtual]

Mouse press event handler

Parameters:
eventMouse event

Reimplemented in QwtSlider.

Definition at line 198 of file qwt_abstract_slider.cpp.

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

Mouse Release Event handler

Parameters:
eventMouse event

Reimplemented in QwtSlider.

Definition at line 268 of file qwt_abstract_slider.cpp.

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

Update the slider according to modifications of the scale

Reimplemented from QwtAbstractScale.

Reimplemented in QwtDial, and QwtSlider.

Definition at line 801 of file qwt_abstract_slider.cpp.

virtual double QwtAbstractSlider::scrolledTo ( const QPoint &  pos) const [protected, pure virtual]

Determine the value for a new position of the movable part of the slider.

Parameters:
posMouse position
Returns:
Value for the mouse position
See also:
isScrollPosition()

Implemented in QwtKnob, QwtDial, and QwtSlider.

Invert wheel and key events

Usually scrolling the mouse wheel "up" and using keys like page up will increase the slider's value towards its maximum. When invertedControls() is enabled the value is scrolled towards its minimum.

Inverting the controls might be f.e. useful for a vertical slider with an inverted scale ( decreasing from top to bottom ).

Parameters:
onInvert controls, when true
See also:
invertedControls(), keyEvent(), wheelEvent()

Definition at line 623 of file qwt_abstract_slider.cpp.

void QwtAbstractSlider::setPageSteps ( uint  stepCount)

Set the number of steps for a page increment.

The range of the slider is divided into a number of steps from which the value increments according to user inputs depend.

Parameters:
stepCountNumber of steps
See also:
pageSteps(), setTotalSteps(), setSingleSteps()

Definition at line 519 of file qwt_abstract_slider.cpp.

void QwtAbstractSlider::setReadOnly ( bool  on)

En/Disable read only mode

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

Parameters:
onEnables in case of true
See also:
isReadOnly()
Warning:
The focus policy is set to Qt::StrongFocus or Qt::NoFocus

Definition at line 144 of file qwt_abstract_slider.cpp.

void QwtAbstractSlider::setSingleSteps ( uint  stepCount)

Set the number of steps for a single increment.

The range of the slider is divided into a number of steps from which the value increments according to user inputs depend.

Parameters:
stepCountNumber of steps
See also:
singleSteps(), setTotalSteps(), setPageSteps()

Definition at line 494 of file qwt_abstract_slider.cpp.

Enable step alignment.

When step alignment is enabled values resulting from slider movements are aligned to the step size.

Parameters:
onEnable step alignment when true
See also:
stepAlignment()

Definition at line 542 of file qwt_abstract_slider.cpp.

void QwtAbstractSlider::setTotalSteps ( uint  stepCount)

Set the number of steps.

The range of the slider is divided into a number of steps from which the value increments according to user inputs depend.

The default setting is 100.

Parameters:
stepCountNumber of steps
See also:
totalSteps(), setSingleSteps(), setPageSteps()

Definition at line 469 of file qwt_abstract_slider.cpp.

void QwtAbstractSlider::setTracking ( bool  on)

Enables or disables tracking.

If tracking is enabled, the slider emits the valueChanged() signal while the movable part of the slider is being dragged. If tracking is disabled, the slider emits the valueChanged() signal only when the user releases the slider.

Tracking is enabled by default.

Parameters:
ontrue (enable) or false (disable) tracking.
See also:
isTracking(), sliderMoved()

Definition at line 180 of file qwt_abstract_slider.cpp.

void QwtAbstractSlider::setValid ( bool  on)

Set the value to be valid/invalid

Parameters:
onWhen true, the value is invalidated
See also:
setValue()

Definition at line 116 of file qwt_abstract_slider.cpp.

void QwtAbstractSlider::setValue ( double  value) [slot]

Set the slider to the specified value

Parameters:
valueNew value
See also:
setValid(), sliderChange(), valueChanged()

Definition at line 565 of file qwt_abstract_slider.cpp.

void QwtAbstractSlider::setWrapping ( bool  on)

If wrapping is true stepping up from upperBound() value will take you to the minimum() value and vice versa.

Parameters:
onEn/Disable wrapping
See also:
wrapping()

Definition at line 594 of file qwt_abstract_slider.cpp.

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

Calling update()

Reimplemented in QwtDial.

Definition at line 819 of file qwt_abstract_slider.cpp.

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

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

Parameters:
valueNew value
See also:
valueChanged()

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

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

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

Notify a change of value.

When tracking is enabled (default setting), this signal will be emitted every time the value changes.

Parameters:
valueNew value
See also:
setTracking(), sliderMoved()
void QwtAbstractSlider::wheelEvent ( QWheelEvent *  event) [protected, virtual]

Wheel Event handler

In/decreases the value by s number of steps. The direction depends on the invertedControls() property.

When the control or shift modifier is pressed the wheel delta ( divided by 120 ) is mapped to an increment according to pageSteps(). Otherwise it is mapped to singleSteps().

Parameters:
eventWheel event

Reimplemented in QwtDial.

Definition at line 299 of file qwt_abstract_slider.cpp.


Member Data Documentation

Reimplemented from QwtAbstractScale.

Reimplemented in QwtKnob, QwtDial, QwtSlider, and QwtCompass.

Definition at line 163 of file qwt_abstract_slider.h.


Property Documentation

Returns:
True, when the controls are inverted
See also:
setInvertedControls()

Definition at line 47 of file qwt_abstract_slider.h.

uint QwtAbstractSlider::pageSteps [read, write]
Returns:
Number of steps
See also:
setPageSteps(), totalSteps(), singleSteps()

Definition at line 40 of file qwt_abstract_slider.h.

bool QwtAbstractSlider::readOnly [read, write]

Definition at line 43 of file qwt_abstract_slider.h.

uint QwtAbstractSlider::singleSteps [read, write]
Returns:
Number of steps
See also:
setSingleSteps(), totalSteps(), pageSteps()

Definition at line 39 of file qwt_abstract_slider.h.

Returns:
True, when step alignment is enabled
See also:
setStepAlignment()

Definition at line 41 of file qwt_abstract_slider.h.

uint QwtAbstractSlider::totalSteps [read, write]
Returns:
Number of steps
See also:
setTotalSteps(), singleSteps(), pageSteps()

Definition at line 38 of file qwt_abstract_slider.h.

bool QwtAbstractSlider::tracking [read, write]

Definition at line 44 of file qwt_abstract_slider.h.

double QwtAbstractSlider::value [read, write]

Returns the current value.

Definition at line 36 of file qwt_abstract_slider.h.

bool QwtAbstractSlider::wrapping [read, write]
Returns:
True, when wrapping is set
See also:
setWrapping()

Definition at line 45 of file qwt_abstract_slider.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Fri Sep 1 2017 02:41:57