Qwt User's Guide 6.0.0
Public Slots | Public Member Functions | Protected Member Functions

QwtWheel Class Reference

The Wheel Widget. More...

#include <qwt_wheel.h>

Inheritance diagram for QwtWheel:
Inheritance graph
[legend]

List of all members.

Public Slots

void setTotalAngle (double)
void setViewAngle (double)

Public Member Functions

 QwtWheel (QWidget *parent=NULL)
virtual ~QwtWheel ()
virtual void setOrientation (Qt::Orientation)
double totalAngle () const
double viewAngle () const
void setTickCnt (int)
int tickCnt () const
void setMass (double)
double mass () const
void setWheelWidth (int)
int wheelWidth () const
void setWheelBorderWidth (int)
int wheelBorderWidth () const
void setBorderWidth (int)
int borderWidth () const
QRect wheelRect () const
virtual QSize sizeHint () const
virtual QSize minimumSizeHint () const

Protected Member Functions

virtual void paintEvent (QPaintEvent *)
virtual void resizeEvent (QResizeEvent *)
virtual void drawTicks (QPainter *, const QRectF &)
virtual void drawWheelBackground (QPainter *, const QRectF &)
virtual void valueChange ()
virtual double getValue (const QPoint &)
virtual void getScrollMode (const QPoint &, QwtAbstractSlider::ScrollMode &, int &direction) const

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.

Constructor & Destructor Documentation

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

Constructor.

QwtWheel::~QwtWheel ( ) [virtual]

Destructor.


Member Function Documentation

int QwtWheel::borderWidth ( ) const
Returns:
Border width
See also:
setBorderWidth()
void QwtWheel::drawTicks ( QPainter *  painter,
const QRectF &  rect 
) [protected, virtual]

Draw the Wheel's ticks

Parameters:
painterPainter
rectRectangle for the wheel
void QwtWheel::drawWheelBackground ( QPainter *  painter,
const QRectF &  rect 
) [protected, virtual]

Draw the Wheel's background gradient

Parameters:
painterPainter
rectRectangle for the wheel
void QwtWheel::getScrollMode ( const QPoint &  p,
QwtAbstractSlider::ScrollMode scrollMode,
int &  direction 
) const [protected, virtual]

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

Parameters:
ppoint
scrollModescrolling mode
directiondirection

Implements QwtAbstractSlider.

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

Determine the value corresponding to a specified point.

Implements QwtAbstractSlider.

double QwtWheel::mass ( ) const [virtual]
Returns:
mass

Reimplemented from QwtAbstractSlider.

QSize QwtWheel::minimumSizeHint ( ) const [virtual]

Return a minimum size hint.

Warning:
The return value is based on the wheel width.
void QwtWheel::paintEvent ( QPaintEvent *  event) [protected, virtual]

Qt Paint Event.

Parameters:
eventPaint event
void QwtWheel::resizeEvent ( QResizeEvent *  event) [protected, virtual]

Qt Resize Event.

Parameters:
eventResize event
void QwtWheel::setBorderWidth ( int  width)

Set the border width.

The border defaults to 2.

Parameters:
widthBorder width
See also:
borderWidth()
void QwtWheel::setMass ( double  mass) [virtual]

Set the mass of the wheel.

Assigning a mass turns the wheel into a flywheel.

Parameters:
massThe wheel's mass

Reimplemented from QwtAbstractSlider.

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

Set the wheel's orientation.

Parameters:
oOrientation. Allowed values are Qt::Horizontal and Qt::Vertical. Defaults to Qt::Horizontal.
See also:
QwtAbstractSlider::orientation()

Reimplemented from QwtAbstractSlider.

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:
cntNumber of grooves per 360 degrees
See also:
tickCnt()
void QwtWheel::setTotalAngle ( double  angle) [slot]

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:
angletotal angle in degrees
See also:
totalAngle()
void QwtWheel::setViewAngle ( double  angle) [slot]

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:
angleVisible angle in degrees
See also:
viewAngle(), setTotalAngle()
void QwtWheel::setWheelBorderWidth ( int  borderWidth)

Set the wheel border width of the wheel.

The wheel 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 wheel border defaults to 2.

Parameters:
borderWidthBorder width
See also:
internalBorder()
void QwtWheel::setWheelWidth ( int  width)

Set the width of the wheel.

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

Parameters:
widththe wheel's width
See also:
wheelWidth()
QSize QwtWheel::sizeHint ( ) const [virtual]
Returns:
a size hint
int QwtWheel::tickCnt ( ) const
Returns:
Number of grooves in the wheel's surface.
See also:
setTickCnt()
double QwtWheel::totalAngle ( ) const
Returns:
Total angle which the wheel can be turned.
See also:
setTotalAngle()
void QwtWheel::valueChange ( ) [protected, virtual]

Notify value change.

Reimplemented from QwtAbstractSlider.

double QwtWheel::viewAngle ( ) const
Returns:
Visible portion of the wheel
See also:
setViewAngle(), totalAngle()
int QwtWheel::wheelBorderWidth ( ) const
Returns:
Wheel border width
See also:
setWheelBorderWidth()
QRect QwtWheel::wheelRect ( ) const
Returns:
Rectangle of the wheel without the outer border
int QwtWheel::wheelWidth ( ) const
Returns:
Width of the wheel
See also:
setWheelWidth()