QwtSlider − The Slider Widget.
#include <qwt_slider.h>
Inherits QwtAbstractSlider.
enum ScalePosition { NoScale, LeadingScale, TrailingScale }
QwtSlider
(QWidget *parent=NULL)
QwtSlider (Qt::Orientation, QWidget *parent=NULL)
virtual ˜QwtSlider ()
Destructor.
void setOrientation (Qt::Orientation)
Set the orientation.
Qt::Orientation orientation () const
void setScalePosition (ScalePosition)
Change the position of the scale.
ScalePosition scalePosition () const
void setTrough (bool)
bool hasTrough () const
void setGroove (bool)
bool hasGroove () const
void setHandleSize (const QSize &)
Set the slider’s handle size.
QSize handleSize () const
void setBorderWidth (int)
Change the slider’s border width.
int borderWidth () const
void setSpacing (int)
Change the spacing between trough and scale.
int spacing () const
virtual QSize sizeHint () const override
virtual QSize minimumSizeHint () const override
void setScaleDraw (QwtScaleDraw *)
Set a scale draw.
const QwtScaleDraw * scaleDraw () const
void setUpdateInterval (int)
Specify the update interval for automatic scrolling.
int updateInterval () const
Public Member Functions inherited from QwtAbstractSlider
QwtAbstractSlider
(QWidget *parent=NULL)
Constructor.
virtual ˜QwtAbstractSlider ()
Destructor.
void setValid (bool)
bool isValid () const
double value () const
Returns the current value.
void setWrapping (bool)
bool wrapping () const
void setTotalSteps (uint)
Set the number of steps.
uint totalSteps () const
void setSingleSteps (uint)
Set the number of steps for a single increment.
uint singleSteps () const
void setPageSteps (uint)
Set the number of steps for a page increment.
uint pageSteps () const
void setStepAlignment (bool)
Enable step alignment.
bool stepAlignment () const
void setTracking (bool)
Enables or disables tracking.
bool isTracking () const
void setReadOnly (bool)
bool isReadOnly () const
void setInvertedControls (bool)
bool invertedControls () const
Public Member Functions inherited from QwtAbstractScale
QwtAbstractScale
(QWidget *parent=NULL)
virtual ˜QwtAbstractScale ()
Destructor.
void setScale (double lowerBound, double
upperBound)
Specify a scale.
void setScale (const QwtInterval &)
Specify a scale.
void setScale (const QwtScaleDiv &)
Specify a scale.
const QwtScaleDiv & scaleDiv () const
void setLowerBound (double value)
double lowerBound () const
void setUpperBound (double value)
double upperBound () const
void setScaleStepSize (double stepSize)
Set the step size used for calculating a scale division.
double scaleStepSize () const
void setScaleMaxMajor (int ticks)
Set the maximum number of major tick intervals.
int scaleMaxMinor () const
void setScaleMaxMinor (int ticks)
Set the maximum number of minor tick intervals.
int scaleMaxMajor () const
void setScaleEngine (QwtScaleEngine *)
Set a scale engine.
const QwtScaleEngine * scaleEngine () const
QwtScaleEngine * scaleEngine ()
int transform (double) const
double invTransform (int) const
bool isInverted () const
double minimum () const
double maximum () const
const QwtScaleMap & scaleMap () const
virtual double
scrolledTo (const QPoint &) const override
Determine the value for a new position of the slider handle.
virtual bool isScrollPosition (const QPoint &)
const override
Determine what to do when the user presses a mouse button.
virtual void drawSlider (QPainter *, const QRect
&) const
virtual void drawHandle (QPainter *, const QRect
&, int pos) const
virtual void mousePressEvent (QMouseEvent *) override
virtual void mouseReleaseEvent (QMouseEvent *)
override
virtual void resizeEvent (QResizeEvent *) override
virtual void paintEvent (QPaintEvent *) override
virtual void changeEvent (QEvent *) override
virtual void timerEvent (QTimerEvent *) override
virtual bool event (QEvent *) override
virtual void scaleChange () override
Notify changed scale.
QRect sliderRect () const
QRect handleRect () const
Protected Member Functions inherited from QwtAbstractSlider
virtual void
mouseMoveEvent (QMouseEvent *) override
virtual void keyPressEvent (QKeyEvent *) override
virtual void wheelEvent (QWheelEvent *) override
void incrementValue (int stepCount)
virtual void sliderChange ()
Calling update()
double incrementedValue (double value, int
stepCount) const
Protected Member Functions inherited from QwtAbstractScale
void rescale (double
lowerBound, double upperBound, double
stepSize)
void setAbstractScaleDraw
(QwtAbstractScaleDraw *)
Set a scale draw.
const QwtAbstractScaleDraw * abstractScaleDraw
() const
QwtAbstractScaleDraw * abstractScaleDraw ()
void updateScaleDraw ()
Public Slots inherited from QwtAbstractSlider
void setValue (double value)
Signals inherited from QwtAbstractSlider
void valueChanged
(double value)
Notify a change of value.
void sliderPressed ()
void sliderReleased ()
void sliderMoved (double value)
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.
Definition at line 30 of file qwt_slider.h.
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.
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
parent Parent widget
See also
setOrientation(), setScalePosition(), setBackgroundStyle()
Definition at line 119 of file qwt_slider.cpp.
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
parent Parent widget
orientation Orientation of the slider.
Definition at line 136 of file qwt_slider.cpp.
Destructor.
Definition at line 143 of file qwt_slider.cpp.
Returns
the border width.
See also
setBorderWidth()
Definition at line 262 of file qwt_slider.cpp.
Handles QEvent::StyleChange and QEvent::FontChange events
Parameters
event Change event
Reimplemented from QwtAbstractScale.
Definition at line 724 of file qwt_slider.cpp.
Draw the thumb at a position
Parameters
painter Painter
handleRect Bounding rectangle of the handle
pos Position of the handle marker in widget
coordinates
Definition at line 473 of file qwt_slider.cpp.
Draw the slider into the specified rectangle.
Parameters
painter Painter
sliderRect Bounding rectangle of the slider
Definition at line 415 of file qwt_slider.cpp.
Qt event handler
Parameters
event Event
Returns
true, if event was recognized and processed
Definition at line 712 of file qwt_slider.cpp.
Returns
Bounding rectangle of the slider handle
Definition at line 990 of file qwt_slider.cpp.
Returns
Size of the handle.
See also
setHandleSize()
Definition at line 326 of file qwt_slider.cpp.
Returns
True, when the groove is visible
See also
setGroove(), hasTrough()
Definition at line 904 of file qwt_slider.cpp.
Returns
True, when the trough is visible
See also
setTrough(), hasGroove()
Definition at line 875 of file qwt_slider.cpp.
Determine what to do when the user presses a mouse button.
Parameters
pos Mouse position
Return values
True,when handleRect() contains pos
See also
scrolledTo()
Implements QwtAbstractSlider.
Definition at line 503 of file qwt_slider.cpp.
Returns
Minimum size hint
See also
sizeHint()
Definition at line 922 of file qwt_slider.cpp.
Mouse press event handler
Parameters
event Mouse event
Reimplemented from QwtAbstractSlider.
Definition at line 547 of file qwt_slider.cpp.
Mouse release event handler
Parameters
event Mouse event
Reimplemented from QwtAbstractSlider.
Definition at line 606 of file qwt_slider.cpp.
Returns
Orientation
See also
setOrientation()
Definition at line 202 of file qwt_slider.cpp.
Qt paint event handler
Parameters
event Paint event
Definition at line 675 of file qwt_slider.cpp.
Qt resize event handler
Parameters
event Resize event
Definition at line 700 of file qwt_slider.cpp.
Notify changed scale.
Reimplemented from QwtAbstractSlider.
Definition at line 378 of file qwt_slider.cpp.
Returns
the scale draw of the slider
See also
setScaleDraw()
Definition at line 363 of file qwt_slider.cpp.
Returns
Position of the scale
See also
setScalePosition()
Definition at line 230 of file qwt_slider.cpp.
Determine the value for a new position of the slider handle.
Parameters
pos Mouse position
Returns
Value for the mouse position
See also
isScrollPosition()
Implements QwtAbstractSlider.
Definition at line 526 of file qwt_slider.cpp.
Change the slider’s border width. The border width is used for drawing the slider handle and the trough.
Parameters
width Border width
See also
borderWidth()
Definition at line 244 of file qwt_slider.cpp.
En/Disable the groove
The slider can be customized by showing a groove for the handle.
Parameters
on When true, the groove is visible
See also
hasGroove(), setThrough()
Definition at line 889 of file qwt_slider.cpp.
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
size New size
See also
handleSize()
Definition at line 311 of file qwt_slider.cpp.
Set the orientation.
Parameters
orientation Allowed values are Qt::Horizontal and Qt::Vertical.
See also
orientation(), scalePosition()
Definition at line 175 of file qwt_slider.cpp.
Set a scale draw. For changing the labels of the scales, it is necessary to derive from QwtScaleDraw and overload QwtScaleDraw::label().
Parameters
scaleDraw ScaleDraw 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 344 of file qwt_slider.cpp.
Change the position of the scale.
Parameters
scalePosition Position of the scale.
See also
ScalePosition, scalePosition()
Definition at line 213 of file qwt_slider.cpp.
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
spacing Number of pixels
See also
spacing();
Definition at line 278 of file qwt_slider.cpp.
En/Disable the trough
The slider can be customized by showing a trough for the handle.
Parameters
on When true, the groove is visible
See also
hasTrough(), setGroove()
Definition at line 860 of file qwt_slider.cpp.
Specify the update interval for automatic scrolling. The minimal accepted value is 50 ms.
Parameters
interval Update interval in milliseconds
See also
setUpdateInterval()
Definition at line 395 of file qwt_slider.cpp.
Returns
minimumSizeHint()
Definition at line 912 of file qwt_slider.cpp.
Returns
Bounding rectangle of the slider - without the scale
Definition at line 1014 of file qwt_slider.cpp.
Returns
Number of pixels between slider and scale
See also
setSpacing()
Definition at line 296 of file qwt_slider.cpp.
Timer event handler
Handles the timer, when the mouse stays pressed inside the sliderRect().
Parameters
event Mouse event
Definition at line 633 of file qwt_slider.cpp.
Returns
Update interval in milliseconds for automatic scrolling
See also
setUpdateInterval()
Definition at line 404 of file qwt_slider.cpp.
Generated automatically by Doxygen for Qwt User’s Guide from the source code.