Qwt User's Guide 6.0.0
|
The Knob Widget. More...
#include <qwt_knob.h>
Public Types | |
enum | KnobStyle { NoStyle = -1, Raised, Sunken } |
enum | MarkerStyle { NoMarker = -1, Tick, Dot, Nub, Notch } |
Public Member Functions | |
QwtKnob (QWidget *parent=NULL) | |
virtual | ~QwtKnob () |
void | setKnobWidth (int w) |
int | knobWidth () const |
void | setTotalAngle (double angle) |
double | totalAngle () const |
void | setKnobStyle (KnobStyle) |
KnobStyle | knobStyle () const |
void | setBorderWidth (int bw) |
int | borderWidth () const |
void | setMarkerStyle (MarkerStyle) |
MarkerStyle | markerStyle () const |
void | setMarkerSize (int) |
int | markerSize () 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 *) |
virtual void | resizeEvent (QResizeEvent *) |
virtual void | changeEvent (QEvent *) |
virtual void | drawKnob (QPainter *, const QRectF &) const |
virtual void | drawMarker (QPainter *, const QRectF &, double arc) const |
virtual double | getValue (const QPoint &p) |
virtual void | getScrollMode (const QPoint &, QwtAbstractSlider::ScrollMode &, int &direction) const |
The Knob Widget.
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.
enum QwtKnob::KnobStyle |
Style of the knob surface.
Depending on the KnobStyle the surface of the knob is filled from the brushes of the widget palette().
enum QwtKnob::MarkerStyle |
Marker type.
The marker indicates the current value on the knob The default setting is a Notch marker.
QwtKnob::QwtKnob | ( | QWidget * | parent = NULL | ) | [explicit] |
Constructor
parent | Parent widget |
QwtKnob::~QwtKnob | ( | ) | [virtual] |
Destructor.
int QwtKnob::borderWidth | ( | ) | const |
Return the border width.
void QwtKnob::changeEvent | ( | QEvent * | event | ) | [protected, virtual] |
Handle QEvent::StyleChange and QEvent::FontChange;
event | Change event |
void QwtKnob::drawKnob | ( | QPainter * | painter, |
const QRectF & | knobRect | ||
) | const [protected, virtual] |
Draw the knob.
painter | painter |
knobRect | Bounding rectangle of the knob (without scale) |
void QwtKnob::drawMarker | ( | QPainter * | painter, |
const QRectF & | rect, | ||
double | angle | ||
) | const [protected, virtual] |
Draw the marker at the knob's front.
painter | Painter |
rect | Bounding rectangle of the knob without scale |
angle | Angle of the marker in degrees |
void QwtKnob::getScrollMode | ( | const QPoint & | pos, |
QwtAbstractSlider::ScrollMode & | scrollMode, | ||
int & | direction | ||
) | const [protected, virtual] |
Set the scrolling mode and direction.
Called by QwtAbstractSlider
pos | Point in question |
scrollMode | Scrolling mode |
direction | Direction |
Implements QwtAbstractSlider.
double QwtKnob::getValue | ( | const QPoint & | pos | ) | [protected, virtual] |
Determine the value corresponding to a specified position.
Called by QwtAbstractSlider
pos | point |
Implements QwtAbstractSlider.
QwtKnob::KnobStyle QwtKnob::knobStyle | ( | ) | const |
int QwtKnob::knobWidth | ( | ) | const |
Return the width of the knob.
int QwtKnob::markerSize | ( | ) | const |
Return the marker size.
QwtKnob::MarkerStyle QwtKnob::markerStyle | ( | ) | const |
QSize QwtKnob::minimumSizeHint | ( | ) | const [virtual] |
Return a minimum size hint.
void QwtKnob::paintEvent | ( | QPaintEvent * | event | ) | [protected, virtual] |
Repaint the knob
event | Paint event |
void QwtKnob::resizeEvent | ( | QResizeEvent * | event | ) | [protected, virtual] |
Qt Resize Event
event | Resize event |
QwtRoundScaleDraw * QwtKnob::scaleDraw | ( | ) |
const QwtRoundScaleDraw * QwtKnob::scaleDraw | ( | ) | const |
void QwtKnob::setBorderWidth | ( | int | borderWidth | ) |
Set the knob's border width.
borderWidth | new border width |
void QwtKnob::setKnobStyle | ( | KnobStyle | knobStyle | ) |
void QwtKnob::setKnobWidth | ( | int | width | ) |
Change the knob's width.
The specified width must be >= 5, or it will be clipped.
width | New width |
void QwtKnob::setMarkerSize | ( | int | size | ) |
Set the size of the marker.
void QwtKnob::setMarkerStyle | ( | MarkerStyle | markerStyle | ) |
Set the marker type of the knob.
markerStyle | Marker type |
void QwtKnob::setScaleDraw | ( | QwtRoundScaleDraw * | scaleDraw | ) |
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().
void QwtKnob::setTotalAngle | ( | double | angle | ) |
Set the total angle by which the knob can be turned.
angle | Angle in degrees. |
The default angle is 270 degrees. It is possible to specify an angle of more than 360 degrees so that the knob can be turned several times around its axis.
QSize QwtKnob::sizeHint | ( | ) | const [virtual] |
double QwtKnob::totalAngle | ( | ) | const |
Return the total angle.