|
Qwt User's Guide 5.2.2
|
The Slider Widget. More...
#include <qwt_slider.h>

Public Types | |
| enum | BGSTYLE { BgTrough = 0x1, BgSlot = 0x2, BgBoth = BgTrough | BgSlot } |
| enum | ScalePos { NoScale, LeftScale, RightScale, TopScale, BottomScale } |
| enum | ScrollMode { ScrNone, ScrMouse, ScrTimer, ScrDirect, ScrPage } |
Public Slots | |
| virtual void | fitValue (double val) |
| virtual void | incValue (int steps) |
| virtual void | setReadOnly (bool) |
| virtual void | setValue (double val) |
Signals | |
| void | sliderMoved (double value) |
| void | sliderPressed () |
| void | sliderReleased () |
| void | valueChanged (double value) |
Public Member Functions | |
| bool | autoScale () const |
| BGSTYLE | bgStyle () const |
| int | borderWidth () const |
| virtual void | incPages (int) |
| bool | isReadOnly () const |
| bool | isValid () const |
| virtual double | mass () const |
| double | maxValue () const |
| virtual QSize | minimumSizeHint () const |
| double | minValue () const |
| Qt::Orientation | orientation () const |
| int | pageSize () const |
| bool | periodic () const |
| QwtSlider (QWidget *parent, Qt::Orientation=Qt::Horizontal, ScalePos=NoScale, BGSTYLE bgStyle=BgTrough) | |
| const QwtScaleDraw * | scaleDraw () const |
| const QwtScaleEngine * | scaleEngine () const |
| QwtScaleEngine * | scaleEngine () |
| const QwtScaleMap & | scaleMap () const |
| int | scaleMaxMajor () const |
| int | scaleMaxMinor () const |
| ScalePos | scalePosition () const |
| void | setAutoScale () |
| void | setBgStyle (BGSTYLE) |
| void | setBorderWidth (int bw) |
| void | setMargins (int x, int y) |
| virtual void | setMass (double val) |
| virtual void | setOrientation (Qt::Orientation) |
| void | setPeriodic (bool tf) |
| void | setRange (double vmin, double vmax, double vstep=0.0, int pagesize=1) |
| void | setScale (double vmin, double vmax, double step=0.0) |
| void | setScale (const QwtScaleDiv &s) |
| void | setScale (const QwtDoubleInterval &, double step=0.0) |
| void | setScaleDraw (QwtScaleDraw *) |
| void | setScaleEngine (QwtScaleEngine *) |
| void | setScaleMaxMajor (int ticks) |
| void | setScaleMaxMinor (int ticks) |
| void | setScalePosition (ScalePos s) |
| void | setStep (double) |
| void | setThumbLength (int l) |
| void | setThumbWidth (int w) |
| void | setTracking (bool enable) |
| void | setUpdateTime (int t) |
| void | setValid (bool valid) |
| virtual QSize | sizeHint () const |
| double | step () const |
| void | stopMoving () |
| int | thumbLength () const |
| int | thumbWidth () const |
| double | value () const |
Protected Member Functions | |
| const QwtAbstractScaleDraw * | abstractScaleDraw () const |
| QwtAbstractScaleDraw * | abstractScaleDraw () |
| void | draw (QPainter *p, const QRect &update_rect) |
| virtual void | drawSlider (QPainter *p, const QRect &r) |
| virtual void | drawThumb (QPainter *p, const QRect &, int pos) |
| double | exactPrevValue () const |
| double | exactValue () const |
| virtual void | fontChange (const QFont &oldFont) |
| virtual void | getScrollMode (const QPoint &p, int &scrollMode, int &direction) |
| virtual double | getValue (const QPoint &p) |
| virtual void | keyPressEvent (QKeyEvent *e) |
| void | layoutSlider (bool update=true) |
| virtual void | mouseMoveEvent (QMouseEvent *e) |
| double | mouseOffset () const |
| virtual void | mousePressEvent (QMouseEvent *e) |
| virtual void | mouseReleaseEvent (QMouseEvent *e) |
| virtual void | paintEvent (QPaintEvent *e) |
| double | prevValue () const |
| virtual void | rangeChange () |
| void | rescale (double vmin, double vmax, double step=0.0) |
| virtual void | resizeEvent (QResizeEvent *e) |
| virtual void | scaleChange () |
| QwtScaleDraw * | scaleDraw () |
| int | scrollMode () const |
| void | setAbstractScaleDraw (QwtAbstractScaleDraw *) |
| void | setMouseOffset (double) |
| virtual void | setPosition (const QPoint &) |
| virtual void | stepChange () |
| virtual void | timerEvent (QTimerEvent *e) |
| virtual void | valueChange () |
| virtual void | wheelEvent (QWheelEvent *e) |
| int | xyPosition (double v) const |
The Slider Widget.
QwtSlider is a slider widget which operates on an interval of type double. QwtSlider supports different layouts as well as a scale.
| enum QwtSlider::BGSTYLE |
Background style.
| enum QwtSlider::ScalePos |
Scale position. QwtSlider tries to enforce valid combinations of its orientation and scale position:
enum QwtAbstractSlider::ScrollMode [inherited] |
Scroll mode
| QwtSlider::QwtSlider | ( | QWidget * | parent, |
| Qt::Orientation | orientation = Qt::Horizontal, |
||
| ScalePos | scalePos = NoScale, |
||
| BGSTYLE | bgStyle = BgTrough |
||
| ) | [explicit] |
Constructor.
| parent | parent widget |
| orientation | Orientation of the slider. Can be Qt::Horizontal or Qt::Vertical. Defaults to Qt::Horizontal. |
| scalePos | Position of the scale. Defaults to QwtSlider::NoScale. |
| bgStyle | Background style. QwtSlider::BgTrough draws the slider button in a trough, QwtSlider::BgSlot draws a slot underneath the button. An or-combination of both may also be used. The default is QwtSlider::BgTrough. |
QwtSlider enforces valid combinations of its orientation and scale position. If the combination is invalid, the scale position will be set to NoScale. Valid combinations are:
| const QwtAbstractScaleDraw * QwtAbstractScale::abstractScaleDraw | ( | ) | const [protected, inherited] |
| QwtAbstractScaleDraw * QwtAbstractScale::abstractScaleDraw | ( | ) | [protected, inherited] |
| bool QwtAbstractScale::autoScale | ( | ) | const [inherited] |
true if autoscaling is enabled | QwtSlider::BGSTYLE QwtSlider::bgStyle | ( | ) | const |
| int QwtSlider::borderWidth | ( | ) | const |
| void QwtSlider::draw | ( | QPainter * | p, |
| const QRect & | update_rect | ||
| ) | [protected] |
Draw the QwtSlider.
| void QwtSlider::drawSlider | ( | QPainter * | painter, |
| const QRect & | r | ||
| ) | [protected, virtual] |
Draw the slider into the specified rectangle.
| painter | Painter |
| r | Rectangle |
| void QwtSlider::drawThumb | ( | QPainter * | painter, |
| const QRect & | sliderRect, | ||
| int | pos | ||
| ) | [protected, virtual] |
Draw the thumb at a position
| painter | Painter |
| sliderRect | Bounding rectangle of the slider |
| pos | Position of the slider thumb |
| double QwtDoubleRange::exactPrevValue | ( | ) | const [protected, inherited] |
Returns the exact previous value.
| double QwtDoubleRange::exactValue | ( | ) | const [protected, inherited] |
Returns the exact value.
The exact value is the value which QwtDoubleRange::value would return if the value were not adjusted to the step raster. It differs from the current value only if QwtDoubleRange::fitValue or QwtDoubleRange::incValue have been used before. This function is intended for internal use in derived classes.
| void QwtAbstractSlider::fitValue | ( | double | value | ) | [virtual, slot, inherited] |
Set the slider's value to the nearest integer multiple of the step size.
| value | Value |
Reimplemented from QwtDoubleRange.
| void QwtSlider::fontChange | ( | const QFont & | oldFont | ) | [protected, virtual] |
Notify change in font.
| void QwtSlider::getScrollMode | ( | const QPoint & | p, |
| int & | scrollMode, | ||
| int & | direction | ||
| ) | [protected, virtual] |
Determine scrolling mode and direction.
| p | point |
| scrollMode | Scrolling mode |
| direction | Direction |
Implements QwtAbstractSlider.
| double QwtSlider::getValue | ( | const QPoint & | pos | ) | [protected, virtual] |
Determine the value corresponding to a specified mouse location.
| pos | Mouse position |
Implements QwtAbstractSlider.
| void QwtDoubleRange::incPages | ( | int | nPages | ) | [virtual, inherited] |
Increment the value by a specified number of pages.
| nPages | Number of pages to increment. A negative number decrements the value. |
| void QwtAbstractSlider::incValue | ( | int | steps | ) | [virtual, slot, inherited] |
Increment the value by a specified number of steps.
| steps | number of steps |
Reimplemented from QwtDoubleRange.
| bool QwtAbstractSlider::isReadOnly | ( | ) | const [inherited] |
In read only mode the slider can't be controlled by mouse or keyboard.
| bool QwtAbstractSlider::isValid | ( | ) | const [inline, inherited] |
Reimplemented from QwtDoubleRange.
| void QwtAbstractSlider::keyPressEvent | ( | QKeyEvent * | e | ) | [protected, virtual, inherited] |
Handles key events
| e | Key event |
Reimplemented in QwtCompass, and QwtDial.
| void QwtSlider::layoutSlider | ( | bool | update_geometry = true | ) | [protected] |
Recalculate the slider's geometry and layout based on the current rect and fonts.
| update_geometry | notify the layout system and call update to redraw the scale |
| double QwtAbstractSlider::mass | ( | ) | const [virtual, inherited] |
| double QwtDoubleRange::maxValue | ( | ) | const [inherited] |
Returns the value of the second border of the range.
maxValue returns the value which has been specified as the second parameter in QwtDoubleRange::setRange.
| QSize QwtSlider::minimumSizeHint | ( | ) | const [virtual] |
Return a minimum size hint.
| double QwtDoubleRange::minValue | ( | ) | const [inherited] |
Returns the value at the first border of the range.
minValue returns the value which has been specified as the first parameter in setRange().
| void QwtAbstractSlider::mouseMoveEvent | ( | QMouseEvent * | e | ) | [protected, virtual, inherited] |
Mouse Move Event handler
| e | Mouse event |
| void QwtAbstractSlider::mousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual, inherited] |
Mouse press event handler
| e | Mouse event |
| void QwtAbstractSlider::mouseReleaseEvent | ( | QMouseEvent * | e | ) | [protected, virtual, inherited] |
Mouse Release Event handler
| e | Mouse event |
| Qt::Orientation QwtAbstractSlider::orientation | ( | ) | const [inherited] |
| int QwtDoubleRange::pageSize | ( | ) | const [inherited] |
Returns the page size in steps.
| void QwtSlider::paintEvent | ( | QPaintEvent * | event | ) | [protected, virtual] |
Qt paint event
| event | Paint event |
| bool QwtDoubleRange::periodic | ( | ) | const [inherited] |
Returns true if the range is periodic.
| double QwtDoubleRange::prevValue | ( | ) | const [protected, inherited] |
Returns the previous value.
| void QwtSlider::rangeChange | ( | ) | [protected, virtual] |
Notify change of range.
Reimplemented from QwtDoubleRange.
| void QwtAbstractScale::rescale | ( | double | vmin, |
| double | vmax, | ||
| double | stepSize = 0.0 |
||
| ) | [protected, inherited] |
Recalculate the scale division and update the scale draw.
| vmin | Lower limit of the scale interval |
| vmax | Upper limit of the scale interval |
| stepSize | Major step size |
| void QwtSlider::resizeEvent | ( | QResizeEvent * | e | ) | [protected, virtual] |
Qt resize event.
| void QwtSlider::scaleChange | ( | ) | [protected, virtual] |
Notify changed scale.
Reimplemented from QwtAbstractScale.
| const QwtScaleDraw * QwtSlider::scaleDraw | ( | ) | const |
| QwtScaleDraw * QwtSlider::scaleDraw | ( | ) | [protected] |
| const QwtScaleEngine * QwtAbstractScale::scaleEngine | ( | ) | const [inherited] |
| QwtScaleEngine * QwtAbstractScale::scaleEngine | ( | ) | [inherited] |
| const QwtScaleMap & QwtAbstractScale::scaleMap | ( | ) | const [inherited] |
| int QwtAbstractScale::scaleMaxMajor | ( | ) | const [inherited] |
| int QwtAbstractScale::scaleMaxMinor | ( | ) | const [inherited] |
| QwtSlider::ScalePos QwtSlider::scalePosition | ( | ) | const |
Return the scale position.
| void QwtAbstractScale::setAbstractScaleDraw | ( | QwtAbstractScaleDraw * | scaleDraw |