Home

QtThumbWheel Class Reference

The QtThumbWheel widget provides a vertical or horizontal thumb-wheel widget. More...

#include <qtthumbwheel.h>

List of all member functions.

Public Members

Public Slots

Signals

Properties


Detailed Description

The QtThumbWheel widget provides a vertical or horizontal thumb-wheel widget.

The widget is often used in 2D and 3D applications to control rotation, zooming and scrolling. The rotation of the thumb-wheel is translated into an integer value within a specified range.

QtThumbWheel inherits QRangeControl, which provides the "integer" component of the thumb-wheel. setRange() and value() are likely to be used by practically all thumb-wheel users; see the QRangeControl documentation for information about the many other functions that class provides.

The main functions provided by the thumb-wheel are the transmission ratio, cog and wrap around controls; you can use setTransmissionRatio() to adjust the ratio of the speed of the wheel to the speed at which the value changes, and setCogCount() to set the number of cogs on the wheel. Use setOrientation() to indicate whether the thumb-wheel is vertically or horizontally oriented.

A thumb-wheel accepts focus on Tab and supports the mouse wheel. It also provides a keyboard interface.

See also


Member Function Documentation

QtThumbWheel::QtThumbWheel ( QWidget * parent = 0, const char * name = 0 )

Constructs a QtThumbWheel object. The parent and name parameters are passed to the QFrame constructor.

QtThumbWheel::QtThumbWheel ( int minValue, int maxValue, int pageStep, int value, Orientation orientation, QWidget * parent = 0, const char * name = 0 )

Constructs a QtThumbWheel object. minValue and maxValue set the initial minimum and maximum values, and pageStep sets the size of each page step. value sets the initial value and orientation is either Vertical or Horizontal. The parent and name parameters are passed to the QFrame constructor.

QtThumbWheel::~QtThumbWheel ()

Destructs the QtThumbWheel.

int QtThumbWheel::cogCount () const

Returns sets the number of cogs on the thumb-wheel (the default is 17). See the "cogCount" property for details.

int QtThumbWheel::maxValue () const

Returns the thumb-wheel's maximum value. See the "maxValue" property for details.

int QtThumbWheel::minValue () const

Returns the thumb-wheel's minimum value. See the "minValue" property for details.

Orientation QtThumbWheel::orientation () const

Returns the orientation of the widget: either Vertical or Horizontal. See the "orientation" property for details.

void QtThumbWheel::setCogCount ( int c )

Sets sets the number of cogs on the thumb-wheel (the default is 17) to c. See the "cogCount" property for details.

void QtThumbWheel::setMaxValue ( int v )

Sets the thumb-wheel's maximum value to v. See the "maxValue" property for details.

void QtThumbWheel::setMinValue ( int v )

Sets the thumb-wheel's minimum value to v. See the "minValue" property for details.

void QtThumbWheel::setOrientation ( Orientation ) [virtual]

Sets the orientation of the widget: either Vertical or Horizontal. See the "orientation" property for details.

void QtThumbWheel::setRange ( int minimum, int maximum )

Sets the thumb-wheel's minimum and maximum values.

Example: ../simple/main.cpp.

void QtThumbWheel::setTracking ( bool enable ) [virtual]

Sets whether the display should be updated during mouse moves to enable. See the "tracking" property for details.

void QtThumbWheel::setTransmissionRatio ( double r ) [virtual]

Sets the transmission ratio between the thumb-wheel and the value range to r. See the "transmissionRatio" property for details.

void QtThumbWheel::setValue ( int value ) [virtual slot]

Makes QRangeControl::setValue() available as a slot. value is wrapped before it is set if wrapsAround() is TRUE.

void QtThumbWheel::setWrapsAround ( bool enabled )

Sets whether the values should wrap around to enabled. See the "wrapsAround" property for details.

bool QtThumbWheel::tracking () const

Returns TRUE if the display should be updated during mouse moves; otherwise returns FALSE. See the "tracking" property for details.

double QtThumbWheel::transmissionRatio () const

Returns the transmission ratio between the thumb-wheel and the value range. See the "transmissionRatio" property for details.

int QtThumbWheel::value () const

Returns the value of the thumb-wheel. If wrapsAround() is TRUE, the value is wrapped before being returned.

void QtThumbWheel::valueChanged ( int value ) [signal]

This signal is emitted when the value of the thumb-wheel changes. value is the new value.

Example: ../simple/main.cpp.

bool QtThumbWheel::wrapsAround () const

Returns TRUE if the values should wrap around; otherwise returns FALSE. See the "wrapsAround" property for details.


Property Documentation

int cogCount

This property holds sets the number of cogs on the thumb-wheel (the default is 17).

Use this property to adapt the number of cogs to the size of the wheel. The property only has a visual effect.

Set this property's value with setCogCount() and get this property's value with cogCount().

int maxValue

This property holds the thumb-wheel's maximum value.

Set this property's value with setMaxValue() and get this property's value with maxValue().

int minValue

This property holds the thumb-wheel's minimum value.

Set this property's value with setMinValue() and get this property's value with minValue().

Orientation orientation

This property holds the orientation of the widget: either Vertical or Horizontal.

Set this property's value with setOrientation() and get this property's value with orientation().

bool tracking

This property holds whether the display should be updated during mouse moves.

Set this property's value with setTracking() and get this property's value with tracking().

double transmissionRatio

This property holds the transmission ratio between the thumb-wheel and the value range.

The default ratio is 1.0, which means that the user must turn the wheel 360 degress (one full spin) to go from minValue to maxValue. Giving a ratio of 2.0 will require the user to spin the wheel twice times to cross the same range, and a value of 0.5 will require only half a turn.

Set this property's value with setTransmissionRatio() and get this property's value with transmissionRatio().

bool wrapsAround

This property holds whether the values should wrap around.

If enabled, when the value exceeds maxValue, it is reset to minValue, and when the value goes below minValue, it is reset to maxValue value. This is useful when the thumb-wheel should not stop at the minimum and maximum value boundaries.

Set this property's value with setWrapsAround() and get this property's value with wrapsAround().


This file is part of the Qt Solutions. Copyright © 2003-2006 Trolltech. All Rights Reserved.

Copyright © 2003-2006 TrolltechTrademarks
Qt Solutions