Classes | Public Types | Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
QwtSlider Class Reference

The Slider Widget. More...

#include <qwt_slider.h>

Inheritance diagram for QwtSlider:
Inheritance graph
[legend]

Classes

class  PrivateData
 

Public Types

enum  ScalePosition { NoScale, LeadingScale, TrailingScale }
 

Public Member Functions

int borderWidth () const
 
QSize handleSize () const
 
bool hasGroove () const
 
bool hasTrough () const
 
virtual QSize minimumSizeHint () const
 
Qt::Orientation orientation () const
 
 QwtSlider (QWidget *parent=NULL)
 
 QwtSlider (Qt::Orientation, QWidget *parent=NULL)
 
const QwtScaleDrawscaleDraw () const
 
ScalePosition scalePosition () const
 
void setBorderWidth (int bw)
 Change the slider's border width. More...
 
void setGroove (bool)
 
void setHandleSize (const QSize &)
 Set the slider's handle size. More...
 
void setOrientation (Qt::Orientation)
 Set the orientation. More...
 
void setScaleDraw (QwtScaleDraw *)
 Set a scale draw. More...
 
void setScalePosition (ScalePosition)
 Change the position of the scale. More...
 
void setSpacing (int)
 Change the spacing between trough and scale. More...
 
void setTrough (bool)
 
void setUpdateInterval (int)
 Specify the update interval for automatic scrolling. More...
 
virtual QSize sizeHint () const
 
int spacing () const
 
int updateInterval () const
 
virtual ~QwtSlider ()
 Destructor. More...
 
- Public Member Functions inherited from QwtAbstractSlider
bool invertedControls () const
 
bool isReadOnly () const
 
bool isTracking () const
 
bool isValid () const
 
uint pageSteps () const
 
 QwtAbstractSlider (QWidget *parent=NULL)
 Constructor. More...
 
void setInvertedControls (bool)
 
void setPageSteps (uint)
 Set the number of steps for a page increment. More...
 
void setReadOnly (bool)
 
void setSingleSteps (uint)
 Set the number of steps for a single increment. More...
 
void setStepAlignment (bool)
 Enable step alignment. More...
 
void setTotalSteps (uint)
 Set the number of steps. More...
 
void setTracking (bool)
 Enables or disables tracking. More...
 
void setValid (bool)
 
void setWrapping (bool)
 
uint singleSteps () const
 
bool stepAlignment () const
 
uint totalSteps () const
 
double value () const
 
bool wrapping () const
 
virtual ~QwtAbstractSlider ()
 Destructor. More...
 
- Public Member Functions inherited from QwtAbstractScale
double invTransform (int) const
 
bool isInverted () const
 
double lowerBound () const
 
double maximum () const
 
double minimum () const
 
 QwtAbstractScale (QWidget *parent=NULL)
 
const QwtScaleDivscaleDiv () const
 
const QwtScaleEnginescaleEngine () const
 
QwtScaleEnginescaleEngine ()
 
const QwtScaleMapscaleMap () const
 
int scaleMaxMajor () const
 
int scaleMaxMinor () const
 
double scaleStepSize () const
 
void setLowerBound (double value)
 
void setScale (double lowerBound, double upperBound)
 Specify a scale. More...
 
void setScale (const QwtInterval &)
 Specify a scale. More...
 
void setScale (const QwtScaleDiv &)
 Specify a scale. More...
 
void setScaleEngine (QwtScaleEngine *)
 Set a scale engine. More...
 
void setScaleMaxMajor (int ticks)
 Set the maximum number of major tick intervals. More...
 
void setScaleMaxMinor (int ticks)
 Set the maximum number of minor tick intervals. More...
 
void setScaleStepSize (double stepSize)
 Set the step size used for calculating a scale division. More...
 
void setUpperBound (double value)
 
int transform (double) const
 
double upperBound () const
 
virtual ~QwtAbstractScale ()
 Destructor. More...
 

Protected Member Functions

virtual void changeEvent (QEvent *)
 
virtual void drawHandle (QPainter *, const QRect &, int pos) const
 
virtual void drawSlider (QPainter *, const QRect &) const
 
virtual bool event (QEvent *)
 
QRect handleRect () const
 
virtual bool isScrollPosition (const QPoint &) const
 Determine what to do when the user presses a mouse button. More...
 
virtual void mousePressEvent (QMouseEvent *)
 
virtual void mouseReleaseEvent (QMouseEvent *)
 
virtual void paintEvent (QPaintEvent *)
 
virtual void resizeEvent (QResizeEvent *)
 
virtual void scaleChange ()
 Notify changed scale. More...
 
virtual double scrolledTo (const QPoint &) const
 Determine the value for a new position of the slider handle. More...
 
QRect sliderRect () const
 
virtual void timerEvent (QTimerEvent *)
 
- Protected Member Functions inherited from QwtAbstractSlider
double incrementedValue (double value, int stepCount) const
 
void incrementValue (int numSteps)
 
virtual void keyPressEvent (QKeyEvent *)
 
virtual void mouseMoveEvent (QMouseEvent *)
 
virtual void sliderChange ()
 Calling update() More...
 
virtual void wheelEvent (QWheelEvent *)
 
- Protected Member Functions inherited from QwtAbstractScale
const QwtAbstractScaleDrawabstractScaleDraw () const
 
QwtAbstractScaleDrawabstractScaleDraw ()
 
void rescale (double lowerBound, double upperBound, double stepSize)
 
void setAbstractScaleDraw (QwtAbstractScaleDraw *)
 Set a scale draw. More...
 
void updateScaleDraw ()
 

Properties

int borderWidth
 
bool groove
 
QSize handleSize
 
Qt::Orientation orientation
 
ScalePosition scalePosition
 
int spacing
 
bool trough
 
- Properties inherited from QwtAbstractSlider
bool invertedControls
 
uint pageSteps
 
bool readOnly
 
uint singleSteps
 
bool stepAlignment
 
uint totalSteps
 
bool tracking
 
double value
 Returns the current value. More...
 
bool wrapping
 
- Properties inherited from QwtAbstractScale
double lowerBound
 
int scaleMaxMajor
 
int scaleMaxMinor
 
double scaleStepSize
 
double upperBound
 

Private Member Functions

void initSlider (Qt::Orientation)
 
void layoutSlider (bool)
 
QwtScaleDrawscaleDraw ()
 

Private Attributes

PrivateDatad_data
 

Additional Inherited Members

- Public Slots inherited from QwtAbstractSlider
void setValue (double val)
 
- Signals inherited from QwtAbstractSlider
void sliderMoved (double value)
 
void sliderPressed ()
 
void sliderReleased ()
 
void valueChanged (double value)
 Notify a change of value. More...
 

Detailed Description

The Slider Widget.

QwtSlider is a slider widget which operates on an interval of type double. Its position is related to a scale showing the current value.

The slider can be customized by having a through, a groove - or both.

sliders.png

Definition at line 30 of file qwt_slider.h.

Member Enumeration Documentation

Position of the scale

See also
QwtSlider(), setScalePosition(), setOrientation()
Enumerator
NoScale 

The slider has no scale.

LeadingScale 

The scale is right of a vertical or below a horizontal slider.

TrailingScale 

The scale is left of a vertical or above a horizontal slider.

Definition at line 54 of file qwt_slider.h.

Constructor & Destructor Documentation

QwtSlider::QwtSlider ( QWidget *  parent = NULL)
explicit

Construct vertical slider in QwtSlider::Trough style with a scale to the left.

The scale is initialized to [0.0, 100.0] and the value set to 0.0.

Parameters
parentParent widget
See also
setOrientation(), setScalePosition(), setBackgroundStyle()

Definition at line 118 of file qwt_slider.cpp.

QwtSlider::QwtSlider ( Qt::Orientation  orientation,
QWidget *  parent = NULL 
)
explicit

Construct a slider in QwtSlider::Trough style

When orientation is Qt::Vertical the scale will be aligned to the left - otherwise at the the top of the slider.

The scale is initialized to [0.0, 100.0] and the value set to 0.0.

Parameters
parentParent widget
orientationOrientation of the slider.

Definition at line 135 of file qwt_slider.cpp.

QwtSlider::~QwtSlider ( )
virtual

Destructor.

Definition at line 142 of file qwt_slider.cpp.

Member Function Documentation

int QwtSlider::borderWidth ( ) const
void QwtSlider::changeEvent ( QEvent *  event)
protectedvirtual

Handles QEvent::StyleChange and QEvent::FontChange events

Parameters
eventChange event

Reimplemented from QwtAbstractScale.

Definition at line 723 of file qwt_slider.cpp.

void QwtSlider::drawHandle ( QPainter *  painter,
const QRect &  handleRect,
int  pos 
) const
protectedvirtual

Draw the thumb at a position

Parameters
painterPainter
handleRectBounding rectangle of the handle
posPosition of the handle marker in widget coordinates

Definition at line 472 of file qwt_slider.cpp.

void QwtSlider::drawSlider ( QPainter *  painter,
const QRect &  sliderRect 
) const
protectedvirtual

Draw the slider into the specified rectangle.

Parameters
painterPainter
sliderRectBounding rectangle of the slider

Definition at line 414 of file qwt_slider.cpp.

bool QwtSlider::event ( QEvent *  event)
protectedvirtual

Qt event handler

Parameters
eventEvent
Returns
true, if event was recognized and processed

Definition at line 711 of file qwt_slider.cpp.

QRect QwtSlider::handleRect ( ) const
protected
Returns
Bounding rectangle of the slider handle

Definition at line 990 of file qwt_slider.cpp.

QSize QwtSlider::handleSize ( ) const
bool QwtSlider::hasGroove ( ) const
Returns
True, when the groove is visisble
See also
setGroove(), hasTrough()

Definition at line 903 of file qwt_slider.cpp.

bool QwtSlider::hasTrough ( ) const
Returns
True, when the trough is visisble
See also
setTrough(), hasGroove()

Definition at line 874 of file qwt_slider.cpp.

void QwtSlider::initSlider ( Qt::Orientation  orientation)
private

Definition at line 147 of file qwt_slider.cpp.

bool QwtSlider::isScrollPosition ( const QPoint &  pos) const
protectedvirtual

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

Parameters
posMouse position
Return values
True,whenhandleRect() contains pos
See also
scrolledTo()

Implements QwtAbstractSlider.

Definition at line 502 of file qwt_slider.cpp.

void QwtSlider::layoutSlider ( bool  update_geometry)
private

Recalculate the slider's geometry and layout based on the current geometry and fonts.

Parameters
update_geometrynotify the layout system and call update to redraw the scale

Definition at line 742 of file qwt_slider.cpp.

QSize QwtSlider::minimumSizeHint ( ) const
virtual
Returns
Minimum size hint
See also
sizeHint()

Definition at line 921 of file qwt_slider.cpp.

void QwtSlider::mousePressEvent ( QMouseEvent *  event)
protectedvirtual

Mouse press event handler

Parameters
eventMouse event

Reimplemented from QwtAbstractSlider.

Definition at line 546 of file qwt_slider.cpp.

void QwtSlider::mouseReleaseEvent ( QMouseEvent *  event)
protectedvirtual

Mouse release event handler

Parameters
eventMouse event

Reimplemented from QwtAbstractSlider.

Definition at line 605 of file qwt_slider.cpp.

Qt::Orientation QwtSlider::orientation ( ) const
void QwtSlider::paintEvent ( QPaintEvent *  event)
protectedvirtual

Qt paint event handler

Parameters
eventPaint event

Definition at line 674 of file qwt_slider.cpp.

void QwtSlider::resizeEvent ( QResizeEvent *  event)
protectedvirtual

Qt resize event handler

Parameters
eventResize event

Definition at line 699 of file qwt_slider.cpp.

void QwtSlider::scaleChange ( )
protectedvirtual

Notify changed scale.

Reimplemented from QwtAbstractSlider.

Definition at line 377 of file qwt_slider.cpp.

const QwtScaleDraw * QwtSlider::scaleDraw ( ) const
Returns
the scale draw of the slider
See also
setScaleDraw()

Definition at line 362 of file qwt_slider.cpp.

QwtScaleDraw * QwtSlider::scaleDraw ( )
private
Returns
the scale draw of the slider
See also
setScaleDraw()

Definition at line 371 of file qwt_slider.cpp.

ScalePosition QwtSlider::scalePosition ( ) const
double QwtSlider::scrolledTo ( const QPoint &  pos) const
protectedvirtual

Determine the value for a new position of the slider handle.

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

Implements QwtAbstractSlider.

Definition at line 525 of file qwt_slider.cpp.

void QwtSlider::setBorderWidth ( int  width)

Change the slider's border width.

The border width is used for drawing the slider handle and the trough.

Parameters
widthBorder width
See also
borderWidth()

Definition at line 243 of file qwt_slider.cpp.

void QwtSlider::setGroove ( bool  on)

En/Disable the groove

The slider can be cutomized by showing a groove for the handle.

Parameters
onWhen true, the groove is visible
See also
hasGroove(), setThrough()

Definition at line 888 of file qwt_slider.cpp.

void QwtSlider::setHandleSize ( const QSize &  size)

Set the slider's handle size.

When the size is empty the slider handle will be painted with a default size depending on its orientation() and backgroundStyle().

Parameters
sizeNew size
See also
handleSize()

Definition at line 310 of file qwt_slider.cpp.

void QwtSlider::setOrientation ( Qt::Orientation  orientation)

Set the orientation.

Parameters
orientationAllowed values are Qt::Horizontal and Qt::Vertical.
See also
orientation(), scalePosition()

Definition at line 174 of file qwt_slider.cpp.

void QwtSlider::setScaleDraw ( QwtScaleDraw scaleDraw)

Set a scale draw.

For changing the labels of the scales, it is necessary to derive from QwtScaleDraw and overload QwtScaleDraw::label().

Parameters
scaleDrawScaleDraw object, that has to be created with new and will be deleted in ~QwtSlider() or the next call of setScaleDraw().
See also
scaleDraw()

Definition at line 343 of file qwt_slider.cpp.

void QwtSlider::setScalePosition ( ScalePosition  scalePosition)

Change the position of the scale.

Parameters
scalePositionPosition of the scale.
See also
ScalePosition, scalePosition()

Definition at line 212 of file qwt_slider.cpp.

void QwtSlider::setSpacing ( int  spacing)

Change the spacing between trough and scale.

A spacing of 0 means, that the backbone of the scale is covered by the trough.

The default setting is 4 pixels.

Parameters
spacingNumber of pixels
See also
spacing();

Definition at line 277 of file qwt_slider.cpp.

void QwtSlider::setTrough ( bool  on)

En/Disable the trough

The slider can be cutomized by showing a trough for the handle.

Parameters
onWhen true, the groove is visible
See also
hasTrough(), setGroove()

Definition at line 859 of file qwt_slider.cpp.

void QwtSlider::setUpdateInterval ( int  interval)

Specify the update interval for automatic scrolling.

The minimal accepted value is 50 ms.

Parameters
intervalUpdate interval in milliseconds
See also
setUpdateInterval()

Definition at line 394 of file qwt_slider.cpp.

QSize QwtSlider::sizeHint ( ) const
virtual
Returns
minimumSizeHint()

Definition at line 911 of file qwt_slider.cpp.

QRect QwtSlider::sliderRect ( ) const
protected
Returns
Bounding rectangle of the slider - without the scale

Definition at line 1014 of file qwt_slider.cpp.

int QwtSlider::spacing ( ) const
void QwtSlider::timerEvent ( QTimerEvent *  event)
protectedvirtual

Timer event handler

Handles the timer, when the mouse stays pressed inside the sliderRect().

Parameters
eventMouse event

Definition at line 632 of file qwt_slider.cpp.

int QwtSlider::updateInterval ( ) const
Returns
Update interval in milliseconds for automatic scrolling
See also
setUpdateInterval()

Definition at line 403 of file qwt_slider.cpp.

Member Data Documentation

PrivateData* QwtSlider::d_data
private

Definition at line 128 of file qwt_slider.h.

Property Documentation

int QwtSlider::borderWidth
readwrite
Returns
the border width.
See also
setBorderWidth()

Definition at line 45 of file qwt_slider.h.

bool QwtSlider::groove
readwrite

Definition at line 42 of file qwt_slider.h.

QSize QwtSlider::handleSize
readwrite
Returns
Size of the handle.
See also
setHandleSize()

Definition at line 44 of file qwt_slider.h.

Qt::Orientation QwtSlider::orientation
readwrite
Returns
Orientation
See also
setOrientation()

Definition at line 37 of file qwt_slider.h.

QwtSlider::ScalePosition QwtSlider::scalePosition
readwrite
Returns
Position of the scale
See also
setScalePosition()

Definition at line 39 of file qwt_slider.h.

int QwtSlider::spacing
readwrite
Returns
Number of pixels between slider and scale
See also
setSpacing()

Definition at line 46 of file qwt_slider.h.

bool QwtSlider::trough
readwrite

Definition at line 41 of file qwt_slider.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:19