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 QwtAbstractScale). Automatic scrolling is enabled when the user presses a mouse button on the scale. For a description of signals, slots and other members, see QwtAbstractSlider.
Definition at line 34 of file qwt_knob.h.
Public Types | |
enum | Symbol { Line, Dot } |
Public Member Functions | |
QwtKnob (QWidget *parent=NULL) | |
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 |
void | setScaleDraw (QwtRoundScaleDraw *) |
const QwtRoundScaleDraw * | scaleDraw () const |
QwtRoundScaleDraw * | scaleDraw () |
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) |
|
Symbol
Definition at line 49 of file qwt_knob.h. |
|
Constructor.
Definition at line 59 of file qwt_knob.cpp. References QwtDoubleRange::setRange(), setScaleDraw(), setTotalAngle(), QwtAbstractSlider::setUpdateTime(), and QwtAbstractSlider::setValue(). |
|
Destructor.
Definition at line 80 of file qwt_knob.cpp. |
|
Return the border width.
Definition at line 456 of file qwt_knob.cpp. |
|
Repaint the knob.
Definition at line 363 of file qwt_knob.cpp. References QwtAbstractScaleDraw::draw(), QwtPainter::drawFocusRect(), drawKnob(), and scaleDraw(). Referenced by paintEvent(). |
|
Draw the knob.
Definition at line 170 of file qwt_knob.cpp. References drawMarker(), QwtAbstractSlider::isValid(), and qwtMin. Referenced by draw(). |
|
Draw the marker at the knob's front.
Definition at line 386 of file qwt_knob.cpp. Referenced by drawKnob(). |
|
Return the width of the knob.
Definition at line 440 of file qwt_knob.cpp. |
|
Return a minimum size hint.
Definition at line 517 of file qwt_knob.cpp. References QwtRoundScaleDraw::extent(), and scaleDraw(). Referenced by sizeHint(). |
|
Repaint the knob.
Definition at line 343 of file qwt_knob.cpp. References draw(), and QwtPaintBuffer::painter(). |
|
Qt Resize Event.
Definition at line 312 of file qwt_knob.cpp. |
|
Definition at line 160 of file qwt_knob.cpp. References QwtAbstractScale::abstractScaleDraw(). |
|
Definition at line 151 of file qwt_knob.cpp. References QwtAbstractScale::abstractScaleDraw(). Referenced by draw(), minimumSizeHint(), and setTotalAngle(). |
|
Set the knob's border width.
Definition at line 449 of file qwt_knob.cpp. References qwtMax. |
|
Change the knob's width. The specified width must be >= 5, or it will be clipped.
Definition at line 433 of file qwt_knob.cpp. References qwtMax. |
|
Change the scale draw of the knob For changing the labels of the scales, it is necessary to derive from QwtRoundScaleDraw and overload QwtRoundScaleDraw::label().
Definition at line 142 of file qwt_knob.cpp. References QwtAbstractScale::setAbstractScaleDraw(). Referenced by QwtKnob(). |
|
Set the symbol of the knob.
Definition at line 89 of file qwt_knob.cpp. |
|
Set the total angle by which the knob can be turned.
Definition at line 115 of file qwt_knob.cpp. References scaleDraw(), and QwtRoundScaleDraw::setAngleRange(). Referenced by QwtKnob(). |
|
Definition at line 507 of file qwt_knob.cpp. References minimumSizeHint(). |
|
Definition at line 102 of file qwt_knob.cpp. |
|
Return the total angle.
Definition at line 128 of file qwt_knob.cpp. |