Qwt User's Guide: QwtWheel Class Reference

- Main Page
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# QwtWheel Class Reference

Inheritance diagram for QwtWheel:

[legend]
Collaboration diagram for QwtWheel:

[legend]
List of all members.

## 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.

## Public Member Functions
| QwtWheel (QWidget *parent=NULL)
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
## 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)

## Constructor & Destructor Documentation

QwtWheel::QwtWheel | ( | QWidget * | parent = `NULL` | ) | `[explicit]`

Constructor.

Definition at line 51 of file qwt_wheel.cpp.

QwtWheel::~QwtWheel | ( |  | ) | `[virtual]`

Destructor.

Definition at line 86 of file qwt_wheel.cpp.

## Member Function Documentation

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:
  QwtAbstractSlider::orientation()

Reimplemented from QwtAbstractSlider.

Definition at line 325 of file qwt_wheel.cpp.

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

double QwtWheel::mass | ( |  | ) | const`[virtual]`

Returns:
  mass

Reimplemented from QwtAbstractSlider.

Definition at line 168 of file qwt_wheel.cpp.

References QwtAbstractSlider::mass().

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 304 of file qwt_wheel.cpp.

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 154 of file qwt_wheel.cpp.

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 359 of file qwt_wheel.cpp.

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 183 of file qwt_wheel.cpp.

References layoutWheel().

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 QwtAbstractSlider.

Definition at line 612 of file qwt_wheel.cpp.

References QwtAbstractSlider::setMass().

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 624 of file qwt_wheel.cpp.

References layoutWheel().

QSize QwtWheel::sizeHint | ( |  | ) | const`[virtual]`

Returns:
  a size hint

Definition at line 633 of file qwt_wheel.cpp.

References minimumSizeHint().

QSize QwtWheel::minimumSizeHint | ( |  | ) | const`[virtual]`

Return a minimum size hint.

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

Definition at line 642 of file qwt_wheel.cpp.

References QwtAbstractSlider::orientation().

Referenced by sizeHint().

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

Qt Resize Event.

Definition at line 524 of file qwt_wheel.cpp.

References layoutWheel().

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

Qt Paint Event.

Definition at line 547 of file qwt_wheel.cpp.

References draw().

void QwtWheel::layoutWheel | ( | bool | update = `true` | ) | `[protected]`

Recalculate the slider's geometry and layout based on.

Definition at line 533 of file qwt_wheel.cpp.

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

void QwtWheel::draw | ( | QPainter * | p,
|  | const QRect & | update_rect |
| ) |  |  | `[protected]`

Redraw panel and wheel.

Definition at line 564 of file qwt_wheel.cpp.

References QwtPainter::drawFocusRect(), 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 375 of file qwt_wheel.cpp.

References drawWheelBackground(), QwtDoubleRange::maxValue(), QwtDoubleRange::minValue(), QwtAbstractSlider::orientation(), and QwtDoubleRange::value().

Referenced by draw().

void QwtWheel::drawWheelBackground | ( | QPainter * | p,
|  | const QRect & | r |
| ) |  |  | `[protected]`

Draw the Wheel's background gradient.

Definition at line 197 of file qwt_wheel.cpp.

References QwtAbstractSlider::orientation(), and setColorArray().

Referenced by drawWheel().

void QwtWheel::setColorArray | ( |  | ) | `[protected]`

Set up the color array for the background pixmap.

Definition at line 96 of file qwt_wheel.cpp.

Referenced by drawWheelBackground().

void QwtWheel::valueChange | ( |  | ) | `[protected, virtual]`

Notify value change.

Reimplemented from QwtAbstractSlider.

Definition at line 582 of file qwt_wheel.cpp.

References QwtAbstractSlider::valueChange().

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

Call update() when the palette changes.

Definition at line 654 of file qwt_wheel.cpp.

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

Determine the value corresponding to a specified point.

Implements QwtAbstractSlider.

Definition at line 494 of file qwt_wheel.cpp.

References QwtDoubleRange::maxValue(), QwtDoubleRange::minValue(), and QwtAbstractSlider::orientation().

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 QwtAbstractSlider.

Definition at line 596 of file qwt_wheel.cpp.