QwtKnob Class Reference

Inheritance diagram for QwtKnob:

Inheritance graph
Collaboration diagram for QwtKnob:

Collaboration graph
List of all members.

Detailed Description

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.

See also:
QwtAbstractSlider and QwtAbstractScale for the descriptions of the inherited members.

Definition at line 34 of file qwt_knob.h.

Public Types

enum  Symbol {

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 QwtRoundScaleDrawscaleDraw () const
QwtRoundScaleDrawscaleDraw ()

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)

Member Enumeration Documentation

enum QwtKnob::Symbol


See also:

Definition at line 49 of file qwt_knob.h.

Constructor & Destructor Documentation

QwtKnob::QwtKnob QWidget *  parent = NULL  )  [explicit]


parent Parent widget

Definition at line 59 of file qwt_knob.cpp.

QwtKnob::~QwtKnob  )  [virtual]


Definition at line 99 of file qwt_knob.cpp.

Member Function Documentation

int QwtKnob::borderWidth  )  const

Return the border width.

Definition at line 475 of file qwt_knob.cpp.

void QwtKnob::draw QPainter *  p,
const QRect &  ur

Repaint the knob.

Definition at line 382 of file qwt_knob.cpp.

References QwtAbstractScaleDraw::draw(), and scaleDraw().

Referenced by paintEvent().

void QwtKnob::drawKnob QPainter *  painter,
const QRect &  r

Draw the knob.

painter painter
r Bounding rectangle of the knob (without scale)

Definition at line 189 of file qwt_knob.cpp.

References drawMarker(), and QwtAbstractSlider::isValid().

void QwtKnob::drawMarker QPainter *  p,
double  arc,
const QColor &  c

Draw the marker at the knob's front.

p Painter
arc Angle of the marker
c Marker color

Definition at line 405 of file qwt_knob.cpp.

Referenced by drawKnob().

int QwtKnob::knobWidth  )  const

Return the width of the knob.

Definition at line 459 of file qwt_knob.cpp.

QSize QwtKnob::minimumSizeHint  )  const [virtual]

Return a minimum size hint.

The return value of QwtKnob::minimumSizeHint() depends on the font and the scale.

Definition at line 536 of file qwt_knob.cpp.

References QwtRoundScaleDraw::extent(), and scaleDraw().

Referenced by sizeHint().

void QwtKnob::paintEvent QPaintEvent *  e  )  [protected, virtual]

Repaint the knob.

Definition at line 362 of file qwt_knob.cpp.

References draw().

void QwtKnob::resizeEvent QResizeEvent *  e  )  [protected, virtual]

Qt Resize Event.

Definition at line 331 of file qwt_knob.cpp.

QwtRoundScaleDraw * QwtKnob::scaleDraw  ) 

the scale draw of the knob
See also:

Definition at line 179 of file qwt_knob.cpp.

References QwtAbstractScale::abstractScaleDraw().

const QwtRoundScaleDraw * QwtKnob::scaleDraw  )  const

the scale draw of the knob
See also:

Definition at line 170 of file qwt_knob.cpp.

References QwtAbstractScale::abstractScaleDraw().

Referenced by draw(), minimumSizeHint(), setScaleDraw(), and setTotalAngle().

void QwtKnob::setBorderWidth int  bw  ) 

Set the knob's border width.

bw new border width

Definition at line 468 of file qwt_knob.cpp.

void QwtKnob::setKnobWidth int  w  ) 

Change the knob's width.

The specified width must be >= 5, or it will be clipped.

w New width

Definition at line 452 of file qwt_knob.cpp.

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().

See also:

Definition at line 161 of file qwt_knob.cpp.

References scaleDraw(), and QwtAbstractScale::setAbstractScaleDraw().

void QwtKnob::setSymbol QwtKnob::Symbol  s  ) 

Set the symbol of the knob.

See also:

Definition at line 108 of file qwt_knob.cpp.

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.

Definition at line 134 of file qwt_knob.cpp.

References scaleDraw(), and QwtRoundScaleDraw::setAngleRange().

QSize QwtKnob::sizeHint  )  const [virtual]


Definition at line 526 of file qwt_knob.cpp.

References minimumSizeHint().

QwtKnob::Symbol QwtKnob::symbol  )  const

symbol of the knob
See also:

Definition at line 121 of file qwt_knob.cpp.

double QwtKnob::totalAngle  )  const

Return the total angle.

Definition at line 147 of file qwt_knob.cpp.

Generated on Mon Feb 26 21:23:58 2007 for Qwt User's Guide by  doxygen 1.4.6