#include <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) |
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::Symbol |
Symbol
QwtKnob::QwtKnob | ( | QWidget * | parent = NULL |
) | [explicit] |
Constructor
parent | Parent widget |
QwtKnob::~QwtKnob | ( | ) | [virtual] |
Destructor.
int QwtKnob::borderWidth | ( | ) | const |
Return the border width.
void QwtKnob::draw | ( | QPainter * | painter, | |
const QRect & | rect | |||
) | [protected] |
Repaint the knob
painter | Painter | |
rect | Update rectangle |
void QwtKnob::drawKnob | ( | QPainter * | painter, | |
const QRect & | r | |||
) | [protected] |
Draw the knob.
painter | painter | |
r | Bounding rectangle of the knob (without scale) |
void QwtKnob::drawMarker | ( | QPainter * | p, | |
double | arc, | |||
const QColor & | c | |||
) | [protected] |
Draw the marker at the knob's front.
p | Painter | |
arc | Angle of the marker | |
c | Marker color |
int QwtKnob::knobWidth | ( | ) | const |
Return the width of the knob.
QSize QwtKnob::minimumSizeHint | ( | ) | const [virtual] |
Return a minimum size hint.
void QwtKnob::paintEvent | ( | QPaintEvent * | e | ) | [protected, virtual] |
Repaint the knob
e | Paint event |
void QwtKnob::resizeEvent | ( | QResizeEvent * | e | ) | [protected, virtual] |
Qt Resize Event
QwtRoundScaleDraw * QwtKnob::scaleDraw | ( | ) |
const QwtRoundScaleDraw * QwtKnob::scaleDraw | ( | ) | const |
void QwtKnob::setBorderWidth | ( | int | bw | ) |
Set the knob's border width.
bw | new border width |
void QwtKnob::setKnobWidth | ( | int | w | ) |
Change the knob's width.
The specified width must be >= 5, or it will be clipped.
w | New width |
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::setSymbol | ( | QwtKnob::Symbol | s | ) |
void QwtKnob::setTotalAngle | ( | double | angle | ) |
Set the total angle by which the knob can be turned.
angle | Angle in degrees. |
QSize QwtKnob::sizeHint | ( | ) | const [virtual] |
QwtKnob::Symbol QwtKnob::symbol | ( | ) | const |
double QwtKnob::totalAngle | ( | ) | const |
Return the total angle.