QwtSlider is a slider widget which operates on an interval of type double. QwtSlider supports different layouts as well as a scale.
Definition at line 29 of file qwt_slider.h.
Public Types | |
enum | ScalePos { None, Left, Right, Top, Bottom } |
enum | BGSTYLE { BgTrough = 0x1, BgSlot = 0x2, BgBoth = BgTrough | BgSlot } |
Public Member Functions | |
QwtSlider (QWidget *parent, const char *name=0, Qt::Orientation=Qt::Horizontal, ScalePos=None, BGSTYLE bgStyle=BgTrough) | |
virtual void | setOrientation (Qt::Orientation) |
void | setBgStyle (BGSTYLE st) |
BGSTYLE | bgStyle () const |
void | setScalePos (ScalePos s) |
ScalePos | scalePos () const |
void | setScalePosition (ScalePos s) |
ScalePos | scalePosition () const |
int | thumbLength () const |
int | thumbWidth () const |
int | borderWidth () const |
void | setThumbLength (int l) |
void | setThumbWidth (int w) |
void | setBorderWidth (int bw) |
void | setMargins (int x, int y) |
virtual QSize | sizeHint () const |
virtual QSize | minimumSizeHint () const |
virtual QSizePolicy | sizePolicy () const |
Protected Member Functions | |
virtual double | getValue (const QPoint &p) |
virtual void | getScrollMode (const QPoint &p, int &scrollMode, int &direction) |
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) |
virtual void | resizeEvent (QResizeEvent *e) |
virtual void | paintEvent (QPaintEvent *e) |
virtual void | valueChange () |
virtual void | rangeChange () |
virtual void | scaleChange () |
virtual void | fontChange (const QFont &oldFont) |
void | layoutSlider (bool update=TRUE) |
int | xyPosition (double v) const |
|
Background style.
|
|
Scale position. QwtSlider tries to enforce valid combinations of its orientation and scale position:
Referenced by scalePosition(). |
|
Constructor.
References QwtSliderBase::orientation(), QwtScaleIf::scaleDraw(), and QwtScaleDraw::setGeometry(). |
|
|
|
|
|
Draw the QwtSlider. Definition at line 402 of file qwt_slider.cpp. References QwtScaleDraw::draw(), drawSlider(), and QwtScaleIf::scaleDraw(). Referenced by paintEvent(). |
|
Draw the slider into the specified rectangle. Definition at line 215 of file qwt_slider.cpp. References drawThumb(), QwtSliderBase::isValid(), QwtSliderBase::orientation(), QwtDblRange::value(), and xyPosition(). Referenced by draw(). |
|
Draw the thumb at a position. Definition at line 270 of file qwt_slider.cpp. References QwtSliderBase::orientation(). Referenced by drawSlider(). |
|
Notify change in font. Definition at line 208 of file qwt_slider.cpp. References layoutSlider(). |
|
Determine scrolling mode and direction.
Implements QwtSliderBase. Definition at line 363 of file qwt_slider.cpp. References QwtDiMap::i1(), QwtDiMap::i2(), QwtSliderBase::orientation(), QwtScaleIf::scaleDraw(), QwtDblRange::value(), and xyPosition(). |
|
Determine the value corresponding to a specified mouse location.
Implements QwtSliderBase. Definition at line 326 of file qwt_slider.cpp. References QwtDiMap::d1(), QwtDiMap::d2(), QwtDiMap::i1(), QwtDiMap::i2(), QwtDiMap::invTransform(), QwtDblRange::maxValue(), QwtDblRange::minValue(), QwtSliderBase::orientation(), and QwtScaleIf::scaleDraw(). |
|
Recalculate the slider's geometry and layout based on the current rect and fonts.
References QwtScaleDraw::minBorderDist(), QwtSliderBase::orientation(), QwtScaleIf::scaleDraw(), QwtScaleDraw::setGeometry(), and QwtDiMap::setIntRange(). Referenced by fontChange(), rangeChange(), resizeEvent(), scaleChange(), setBorderWidth(), setMargins(), setOrientation(), setScalePosition(), setThumbLength(), and setThumbWidth(). |
|
Return a minimum size hint.
References QwtScaleDraw::minBorderDist(), QwtScaleDraw::minHeight(), QwtScaleDraw::minWidth(), QwtSliderBase::orientation(), and QwtScaleIf::scaleDraw(). Referenced by sizeHint(). |
|
Qt paint event. Definition at line 391 of file qwt_slider.cpp. References draw(), and QwtPaintBuffer::painter(). |
|
Notify change of range.
Reimplemented from QwtDblRange. Definition at line 566 of file qwt_slider.cpp. References QwtScaleIf::hasUserScale(), layoutSlider(), QwtDblRange::maxValue(), QwtDblRange::minValue(), QwtDblRange::rangeChange(), QwtScaleIf::scaleDraw(), QwtScaleIf::scaleMaxMajor(), QwtScaleIf::scaleMaxMinor(), and QwtScaleDraw::setScale(). |
|
Qt resize event. Definition at line 422 of file qwt_slider.cpp. References layoutSlider(). |
|
Notify changed scale.
Implements QwtScaleIf. Definition at line 194 of file qwt_slider.cpp. References QwtScaleIf::hasUserScale(), layoutSlider(), QwtDblRange::maxValue(), QwtDblRange::minValue(), QwtScaleIf::scaleDraw(), QwtScaleIf::scaleMaxMajor(), QwtScaleIf::scaleMaxMinor(), and QwtScaleDraw::setScale(). |
|
Deprecated. Use QwtSlider::scalePosition. Definition at line 81 of file qwt_slider.h. |
|
Return the scale position. Definition at line 139 of file qwt_slider.cpp. References ScalePos. |
|
Set the background style. Definition at line 68 of file qwt_slider.h. |
|
Change the slider's border width.
References layoutSlider(). |
|
Set distances between the widget's border and internals.
References layoutSlider(). |
|
Set the orientation.
References layoutSlider(), and QwtSliderBase::setOrientation(). Referenced by setScalePosition(). |
|
Deprecated. Use QwtSlider::setScalePosition. Definition at line 77 of file qwt_slider.h. |
|
Change the scale position (and slider orientation).
References layoutSlider(), and setOrientation(). |
|
Set the slider's thumb length.
References layoutSlider(). |
|
Change the width of the thumb.
References layoutSlider(). |
|
References minimumSizeHint(). |
|
References QwtSliderBase::orientation(). |
|
|
|
|
|
Notify change of value.
Reimplemented from QwtSliderBase. Definition at line 558 of file qwt_slider.cpp. References QwtSliderBase::valueChange(). |
|
Find the x/y position for a given value v. Definition at line 298 of file qwt_slider.cpp. References QwtDiMap::d1(), QwtDiMap::d2(), QwtDiMap::i1(), QwtDiMap::i2(), QwtDblRange::maxValue(), QwtDblRange::minValue(), QwtSliderBase::orientation(), QwtScaleIf::scaleDraw(), and QwtDiMap::transform(). Referenced by drawSlider(), and getScrollMode(). |