#include <qwt_knob.h>
Inheritance diagram for QwtKnob:

Public Types | |
| enum | Symbol { Line, Dot } |
Public Member Functions | |
| QwtKnob (QWidget *parent=0, const char *name=0) | |
| virtual | ~QwtKnob () |
| void | setKnobWidth (int w) |
| int | knobWidth () const |
| void | setTotalAngle (double angle) |
| double | totalAngle () const |
| void | setBorderWidth (int bw) |
| int | borderWidth () const |
| void | setSymbol (Symbol) |
| Symbol | symbol () const |
| virtual QSize | sizeHint () const |
| virtual QSize | minimumSizeHint () const |
| virtual QSizePolicy | sizePolicy () const |
Protected Member Functions | |
| virtual void | paintEvent (QPaintEvent *e) |
| virtual void | resizeEvent (QResizeEvent *e) |
| void | draw (QPainter *p, const QRect &ur) |
| void | drawKnob (QPainter *p, const QRect &r) |
| void | drawMarker (QPainter *p, double arc, const QColor &c) |
Private Member Functions | |
| void | layoutKnob (bool update=TRUE) |
| double | getValue (const QPoint &p) |
| void | getScrollMode (const QPoint &p, int &scrollMode, int &direction) |
| void | recalcAngle () |
| virtual void | valueChange () |
| virtual void | rangeChange () |
| virtual void | scaleChange () |
| virtual void | fontChange (const QFont &oldFont) |
Private Attributes | |
| int | d_borderWidth |
| int | d_borderDist |
| int | d_hasScale |
| int | d_scaleDist |
| int | d_maxScaleTicks |
| int | d_knobWidth |
| int | d_dotWidth |
| Symbol | d_symbol |
| double | d_angle |
| double | d_oldAngle |
| double | d_totalAngle |
| double | d_nTurns |
| QRect | d_kRect |
The QwtKnob widget imitates look and behaviour of a volume knob on a radio. It contains a scale around the knob which is set up automatically or can be configured manually (see QwtScaleIf). Automatic scrolling is enabled when the user presses a mouse button on the scale. For a description of signals, slots and other members, see QwtSliderBase.
Definition at line 32 of file qwt_knob.h.
|
|
Symbol
Definition at line 47 of file qwt_knob.h. Referenced by symbol(). |
|
||||||||||||
|
Constructor.
Definition at line 22 of file qwt_knob.cpp. References d_angle, d_borderDist, d_borderWidth, d_dotWidth, d_hasScale, d_knobWidth, d_maxScaleTicks, d_nTurns, d_oldAngle, d_scaleDist, QwtScaleIf::d_scaleDraw, d_symbol, d_totalAngle, Line, recalcAngle(), QwtScaleDraw::Round, QwtScaleDraw::setGeometry(), setTotalAngle(), and QwtSliderBase::setUpdateTime(). |
|
|
Destructor.
Definition at line 46 of file qwt_knob.cpp. |
|
|
Definition at line 57 of file qwt_knob.h. |
|
||||||||||||
|
Repaint the knob.
Definition at line 271 of file qwt_knob.cpp. References d_kRect, QwtScaleIf::d_scaleDraw, QwtScaleDraw::draw(), and drawKnob(). Referenced by paintEvent(). |
|
||||||||||||
|
Draw the knob.
Definition at line 96 of file qwt_knob.cpp. References d_angle, d_borderWidth, and drawMarker(). Referenced by draw(). |
|
||||||||||||||||
|
Draw the marker at the knob's front.
Definition at line 297 of file qwt_knob.cpp. References d_borderWidth, d_dotWidth, d_kRect, d_symbol, Dot, Line, M_PI, and qwtMax. Referenced by drawKnob(). |
|
|
Recalculates the layout
Definition at line 401 of file qwt_knob.cpp. References layoutKnob(). |
|
||||||||||||||||
|
Set the scrolling mode and direction. Called by QwtSliderBase
Implements QwtSliderBase. Definition at line 179 of file qwt_knob.cpp. References d_angle, d_kRect, M_PI, QwtSliderBase::ScrMouse, and QwtSliderBase::ScrTimer. |
|
|
Determine the value corresponding to a specified position. Called by QwtSliderBase
Implements QwtSliderBase. Definition at line 148 of file qwt_knob.cpp. References QwtSliderBase::d_mouseOffset, d_nTurns, d_totalAngle, M_PI, QwtDblRange::maxValue(), QwtDblRange::minValue(), and QwtDblRange::value(). |
|
|
Definition at line 53 of file qwt_knob.h. |
|
|
Recalculate the slider's geometry and layout based on.
Definition at line 233 of file qwt_knob.cpp. References d_knobWidth, d_kRect, d_scaleDist, QwtScaleIf::d_scaleDraw, qwtMin, QwtScaleDraw::Round, and QwtScaleDraw::setGeometry(). Referenced by fontChange(), rangeChange(), resizeEvent(), scaleChange(), setBorderWidth(), setKnobWidth(), and setTotalAngle(). |
|
|
Return a minimum size hint.
Definition at line 429 of file qwt_knob.cpp. References d_knobWidth, d_scaleDist, QwtScaleIf::d_scaleDraw, and QwtScaleDraw::minHeight(). Referenced by sizeHint(). |
|
|
Repaint the knob.
Definition at line 258 of file qwt_knob.cpp. References draw(), and QwtPaintBuffer::painter(). |
|
|
Notify a change of the range. Called by QwtSliderBase Reimplemented from QwtDblRange. Definition at line 210 of file qwt_knob.cpp. References QwtScaleIf::d_maxMajor, QwtScaleIf::d_maxMinor, QwtScaleIf::d_scaleDraw, QwtScaleIf::hasUserScale(), layoutKnob(), QwtDblRange::maxValue(), QwtDblRange::minValue(), recalcAngle(), and QwtScaleDraw::setScale(). |
|
|
Recalculate the marker angle corresponding to the current value.
Definition at line 366 of file qwt_knob.cpp. References d_angle, d_nTurns, d_oldAngle, d_totalAngle, QwtDblRange::maxValue(), QwtDblRange::minValue(), and QwtDblRange::value(). Referenced by QwtKnob(), rangeChange(), and valueChange(). |
|
|
Qt Resize Event.
Definition at line 224 of file qwt_knob.cpp. References layoutKnob(). |
|
|
Recalculates the layout
Implements QwtScaleIf. Definition at line 392 of file qwt_knob.cpp. References layoutKnob(). |
|
|
Set the knob's border width.
Definition at line 356 of file qwt_knob.cpp. References d_borderWidth, layoutKnob(), and qwtMax. |
|
|
Change the knob's width. The specified width must be >= 5, or it will be clipped.
Definition at line 346 of file qwt_knob.cpp. References d_knobWidth, layoutKnob(), and qwtMax. |
|
|
Set the symbol of the knob.
Definition at line 54 of file qwt_knob.cpp. References d_symbol. |
|
|
Set the total angle by which the knob can be turned.
Definition at line 80 of file qwt_knob.cpp. References QwtScaleIf::d_scaleDraw, d_totalAngle, layoutKnob(), and QwtScaleDraw::setAngleRange(). Referenced by QwtKnob(). |
|
|
Definition at line 419 of file qwt_knob.cpp. References minimumSizeHint(). |
|
|
Definition at line 408 of file qwt_knob.cpp. |
|
|
Definition at line 67 of file qwt_knob.cpp. |
|
|
Definition at line 55 of file qwt_knob.h. |
|
|
Notify change of value. Sets the slider's value to the nearest multiple of the step size. Reimplemented from QwtSliderBase. Definition at line 135 of file qwt_knob.cpp. References recalcAngle(), and QwtSliderBase::valueChange(). |
|
|
Definition at line 93 of file qwt_knob.h. Referenced by drawKnob(), getScrollMode(), QwtKnob(), and recalcAngle(). |
|
|
Definition at line 85 of file qwt_knob.h. Referenced by QwtKnob(). |
|
|
Definition at line 84 of file qwt_knob.h. Referenced by drawKnob(), drawMarker(), QwtKnob(), and setBorderWidth(). |
|
|
Definition at line 90 of file qwt_knob.h. Referenced by drawMarker(), and QwtKnob(). |
|
|
Definition at line 86 of file qwt_knob.h. Referenced by QwtKnob(). |
|
|
Definition at line 89 of file qwt_knob.h. Referenced by layoutKnob(), minimumSizeHint(), QwtKnob(), and setKnobWidth(). |
|
|
Definition at line 98 of file qwt_knob.h. Referenced by draw(), drawMarker(), getScrollMode(), and layoutKnob(). |
|
|
Definition at line 88 of file qwt_knob.h. Referenced by QwtKnob(). |
|
|
Definition at line 96 of file qwt_knob.h. Referenced by getValue(), QwtKnob(), and recalcAngle(). |
|
|
Definition at line 94 of file qwt_knob.h. Referenced by QwtKnob(), and recalcAngle(). |
|
|
Definition at line 87 of file qwt_knob.h. Referenced by layoutKnob(), minimumSizeHint(), and QwtKnob(). |
|
|
Definition at line 92 of file qwt_knob.h. Referenced by drawMarker(), QwtKnob(), setSymbol(), and symbol(). |
|
|
Definition at line 95 of file qwt_knob.h. Referenced by getValue(), QwtKnob(), recalcAngle(), and setTotalAngle(). |
1.3.2