Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

QwtWheel Class Reference

The Wheel Widget. More...

#include <qwt_wheel.h>

Inheritance diagram for QwtWheel:

QwtSliderBase QwtDblRange List of all members.

Public Member Functions

 QwtWheel (QWidget *parent=0, const char *name=0)
virtual ~QwtWheel ()
virtual void setOrientation (Qt::Orientation)
double totalAngle () const
double viewAngle () const
int tickCnt () const
int internalBorder () const
double mass () const
void setTotalAngle (double angle)
void setTickCnt (int cnt)
void setViewAngle (double angle)
void setInternalBorder (int width)
void setMass (double val)
void setWheelWidth (int w)
virtual QSize sizeHint () const
virtual QSize minimumSizeHint () const
virtual QSizePolicy sizePolicy () const

Protected Member Functions

virtual void resizeEvent (QResizeEvent *e)
virtual void paintEvent (QPaintEvent *e)
void layoutWheel (bool update=TRUE)
void draw (QPainter *p, const QRect &update_rect)
void drawWheel (QPainter *p, const QRect &r)
void drawWheelBackground (QPainter *p, const QRect &r)
void setColorArray ()
virtual void valueChange ()
virtual void paletteChange (const QPalette &)
virtual double getValue (const QPoint &p)
virtual void getScrollMode (const QPoint &p, int &scrollMode, int &direction)

Private Attributes

QColor * d_colors
QRect d_sliderRect
double d_viewAngle
double d_totalAngle
int d_tickCnt
int d_intBorder
int d_borderWidth
int d_colorCnt
int d_wheelWidth
int d_allocContext

Detailed Description

The Wheel Widget.

The wheel widget can be used to change values over a very large range in very small steps. Using the setMass member, it can be configured as a flywheel.

See also:
The radio example.

Definition at line 25 of file qwt_wheel.h.


Constructor & Destructor Documentation

QwtWheel::QwtWheel QWidget *  parent = 0,
const char *  name = 0
 

Constructor.

Definition at line 20 of file qwt_wheel.cpp.

References d_allocContext, d_borderWidth, d_colorCnt, d_colors, d_intBorder, d_tickCnt, d_totalAngle, d_viewAngle, d_wheelWidth, and QwtSliderBase::setUpdateTime().

QwtWheel::~QwtWheel  )  [virtual]
 

Destructor.

Definition at line 36 of file qwt_wheel.cpp.

References d_allocContext, and d_colors.


Member Function Documentation

void QwtWheel::draw QPainter *  p,
const QRect &  update_rect
[protected]
 

Redraw panel and wheel.

Definition at line 436 of file qwt_wheel.cpp.

References d_borderWidth, d_sliderRect, and drawWheel().

Referenced by paintEvent().

void QwtWheel::drawWheel QPainter *  p,
const QRect &  r
[protected]
 

Redraw the wheel.

Parameters:
p painter
r contents rectangle

Definition at line 264 of file qwt_wheel.cpp.

References d_intBorder, d_tickCnt, d_totalAngle, d_viewAngle, drawWheelBackground(), M_PI, QwtDblRange::maxValue(), QwtDblRange::minValue(), QwtSliderBase::orientation(), qwtAbs, and QwtDblRange::value().

Referenced by draw().

void QwtWheel::drawWheelBackground QPainter *  p,
const QRect &  r
[protected]
 

Draw the Wheel's background gradient.

Definition at line 122 of file qwt_wheel.cpp.

References d_colorCnt, d_colors, d_intBorder, QwtSliderBase::orientation(), qwtAbs, and setColorArray().

Referenced by drawWheel().

void QwtWheel::getScrollMode const QPoint &  p,
int &  scrollMode,
int &  direction
[protected, virtual]
 

Determine the scrolling mode and direction corresponding to a specified point.

Parameters:
p point
scrollMode scrolling mode
direction direction

Implements QwtSliderBase.

Definition at line 480 of file qwt_wheel.cpp.

References d_sliderRect, QwtSliderBase::ScrMouse, and QwtSliderBase::ScrNone.

double QwtWheel::getValue const QPoint &  p  )  [protected, virtual]
 

Determine the value corresponding to a specified point.

Implements QwtSliderBase.

Definition at line 371 of file qwt_wheel.cpp.

References d_sliderRect, d_totalAngle, d_viewAngle, QwtDblRange::maxValue(), QwtDblRange::minValue(), and QwtSliderBase::orientation().

int QwtWheel::internalBorder  )  const [inline]
 

Definition at line 43 of file qwt_wheel.h.

void QwtWheel::layoutWheel bool  update = TRUE  )  [protected]
 

Recalculate the slider's geometry and layout based on.

Definition at line 410 of file qwt_wheel.cpp.

References d_borderWidth, and d_sliderRect.

Referenced by resizeEvent(), setInternalBorder(), setOrientation(), and setWheelWidth().

double QwtWheel::mass  )  const [virtual]
 

Returns:
mass

Reimplemented from QwtSliderBase.

Definition at line 96 of file qwt_wheel.cpp.

References QwtSliderBase::mass().

QSize QwtWheel::minimumSizeHint  )  const [virtual]
 

Return a minimum size hint.

Warning:
The return value is based on the wheel width.

Definition at line 547 of file qwt_wheel.cpp.

References d_borderWidth, d_wheelWidth, and QwtSliderBase::orientation().

Referenced by sizeHint().

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

Qt Paint Event.

Definition at line 424 of file qwt_wheel.cpp.

References draw(), and QwtPaintBuffer::painter().

void QwtWheel::paletteChange const QPalette &   )  [protected, virtual]
 

Call update() when the palette changes.

Definition at line 559 of file qwt_wheel.cpp.

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

Qt Resize Event.

Definition at line 401 of file qwt_wheel.cpp.

References layoutWheel().

void QwtWheel::setColorArray  )  [protected]
 

Set up the color array for the background pixmap.

Definition at line 44 of file qwt_wheel.cpp.

References d_allocContext, d_colorCnt, and d_colors.

Referenced by drawWheelBackground().

void QwtWheel::setInternalBorder int  w  ) 
 

Set the internal border width of the wheel.

The internal border must not be smaller than 1 and is limited in dependence on the wheel's size. Values outside the allowed range will be clipped.

The internal border defaults to 2.

Parameters:
w border width

Definition at line 113 of file qwt_wheel.cpp.

References d_intBorder, layoutWheel(), qwtMax, and qwtMin.

void QwtWheel::setMass double  val  )  [virtual]
 

Set the mass of the wheel.

Assigning a mass turns the wheel into a flywheel.

Parameters:
val the wheel's mass

Reimplemented from QwtSliderBase.

Definition at line 496 of file qwt_wheel.cpp.

References QwtSliderBase::setMass().

void QwtWheel::setOrientation Qt::Orientation  o  )  [virtual]
 

Set the wheel's orientation.

Parameters:
o Orientation. Allowed values are Qt::Horizontal and Qt::Vertical. Defaults to Qt::Horizontal.
See also:
QwtSliderBase::orientation()

Definition at line 236 of file qwt_wheel.cpp.

References layoutWheel(), QwtSliderBase::orientation(), and QwtSliderBase::setOrientation().

void QwtWheel::setTickCnt int  cnt  ) 
 

Adjust the number of grooves in the wheel's surface.

The number of grooves is limited to 6 <= cnt <= 50. Values outside this range will be clipped. The default value is 10.

Parameters:
cnt Number of grooves per 360 degrees

Definition at line 87 of file qwt_wheel.cpp.

References d_tickCnt, and qwtLim().

void QwtWheel::setTotalAngle double  angle  ) 
 

Set the total angle which the wheel can be turned.

One full turn of the wheel corresponds to an angle of 360 degrees. A total angle of n*360 degrees means that the wheel has to be turned n times around its axis to get from the minimum value to the maximum value.

The default setting of the total angle is 360 degrees.

Parameters:
angle total angle in degrees

Definition at line 223 of file qwt_wheel.cpp.

References d_totalAngle, and qwtLim().

void QwtWheel::setViewAngle double  angle  ) 
 

Specify the visible portion of the wheel.

You may use this function for fine-tuning the appearance of the wheel. The default value is 175 degrees. The value is limited from 10 to 175 degrees.

Parameters:
angle Visible angle in degrees

Definition at line 253 of file qwt_wheel.cpp.

References d_viewAngle, and qwtLim().

void QwtWheel::setWheelWidth int  w  ) 
 

Set the width of the wheel.

Corresponds to the wheel height for horizontal orientation, and the wheel width for vertical orientation.

Parameters:
w the wheel's width

Definition at line 508 of file qwt_wheel.cpp.

References d_wheelWidth, and layoutWheel().

QSize QwtWheel::sizeHint  )  const [virtual]
 

Returns:
a size hint

Definition at line 538 of file qwt_wheel.cpp.

References minimumSizeHint().

QSizePolicy QwtWheel::sizePolicy  )  const [virtual]
 

Returns:
Preferred/Fixed for horizontal, Fixed/Preferred for vertical scales.

Definition at line 519 of file qwt_wheel.cpp.

References QwtSliderBase::orientation().

int QwtWheel::tickCnt  )  const [inline]
 

Definition at line 42 of file qwt_wheel.h.

double QwtWheel::totalAngle  )  const [inline]
 

Definition at line 40 of file qwt_wheel.h.

void QwtWheel::valueChange  )  [protected, virtual]
 

Notify value change.

Reimplemented from QwtSliderBase.

Definition at line 466 of file qwt_wheel.cpp.

References QwtSliderBase::valueChange().

double QwtWheel::viewAngle  )  const [inline]
 

Definition at line 41 of file qwt_wheel.h.


Member Data Documentation

int QwtWheel::d_allocContext [private]
 

Definition at line 84 of file qwt_wheel.h.

Referenced by QwtWheel(), setColorArray(), and ~QwtWheel().

int QwtWheel::d_borderWidth [private]
 

Definition at line 81 of file qwt_wheel.h.

Referenced by draw(), layoutWheel(), minimumSizeHint(), and QwtWheel().

int QwtWheel::d_colorCnt [private]
 

Definition at line 82 of file qwt_wheel.h.

Referenced by drawWheelBackground(), QwtWheel(), and setColorArray().

QColor* QwtWheel::d_colors [private]
 

Definition at line 75 of file qwt_wheel.h.

Referenced by drawWheelBackground(), QwtWheel(), setColorArray(), and ~QwtWheel().

int QwtWheel::d_intBorder [private]
 

Definition at line 80 of file qwt_wheel.h.

Referenced by drawWheel(), drawWheelBackground(), QwtWheel(), and setInternalBorder().

QRect QwtWheel::d_sliderRect [private]
 

Definition at line 76 of file qwt_wheel.h.

Referenced by draw(), getScrollMode(), getValue(), and layoutWheel().

int QwtWheel::d_tickCnt [private]
 

Definition at line 79 of file qwt_wheel.h.

Referenced by drawWheel(), QwtWheel(), and setTickCnt().

double QwtWheel::d_totalAngle [private]
 

Definition at line 78 of file qwt_wheel.h.

Referenced by drawWheel(), getValue(), QwtWheel(), and setTotalAngle().

double QwtWheel::d_viewAngle [private]
 

Definition at line 77 of file qwt_wheel.h.

Referenced by drawWheel(), getValue(), QwtWheel(), and setViewAngle().

int QwtWheel::d_wheelWidth [private]
 

Definition at line 83 of file qwt_wheel.h.

Referenced by minimumSizeHint(), QwtWheel(), and setWheelWidth().


The documentation for this class was generated from the following files:
Generated on Fri Nov 7 14:11:50 2003 for Qwt Developer's Guide by doxygen 1.3.2