Classes | Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
QwtWheel Class Reference

The Wheel Widget. More...

#include <qwt_wheel.h>

Inheritance diagram for QwtWheel:
Inheritance graph
[legend]

Classes

class  PrivateData
 

Public Slots

void setMass (double)
 Set the slider's mass for flywheel effect. More...
 
void setTotalAngle (double)
 Set the total angle which the wheel can be turned. More...
 
void setValue (double)
 Set a new value without adjusting to the step raster. More...
 
void setViewAngle (double)
 Specify the visible portion of the wheel. More...
 

Signals

void valueChanged (double value)
 Notify a change of value. More...
 
void wheelMoved (double value)
 
void wheelPressed ()
 
void wheelReleased ()
 

Public Member Functions

int borderWidth () const
 
bool isInverted () const
 
bool isTracking () const
 
double mass () const
 
double maximum () const
 
double minimum () const
 
Qt::Orientation orientation () const
 
int pageStepCount () const
 
 QwtWheel (QWidget *parent=NULL)
 Constructor. More...
 
void setBorderWidth (int)
 Set the border width. More...
 
void setInverted (bool tf)
 En/Disable inverted appearance. More...
 
void setMaximum (double max)
 
void setMinimum (double min)
 
void setOrientation (Qt::Orientation)
 Set the wheel's orientation. More...
 
void setPageStepCount (int)
 Set the page step count. More...
 
void setRange (double vmin, double vmax)
 Set the minimum and maximum values. More...
 
void setSingleStep (double)
 Set the step size of the counter. More...
 
void setStepAlignment (bool on)
 En/Disable step alignment. More...
 
void setTickCount (int)
 Adjust the number of grooves in the wheel's surface. More...
 
void setTracking (bool enable)
 En/Disable tracking. More...
 
void setUpdateInterval (int)
 Specify the update interval when the wheel is flying. More...
 
void setWheelBorderWidth (int)
 Set the wheel border width of the wheel. More...
 
void setWheelWidth (int)
 Set the width of the wheel. More...
 
void setWrapping (bool tf)
 En/Disable wrapping. More...
 
double singleStep () const
 
bool stepAlignment () const
 
int tickCount () const
 
double totalAngle () const
 
int updateInterval () const
 
double value () const
 
double viewAngle () const
 
int wheelBorderWidth () const
 
int wheelWidth () const
 
bool wrapping () const
 
virtual ~QwtWheel ()
 Destructor. More...
 

Protected Member Functions

virtual void drawTicks (QPainter *, const QRectF &)
 
virtual void drawWheelBackground (QPainter *, const QRectF &)
 
virtual void keyPressEvent (QKeyEvent *)
 
virtual QSize minimumSizeHint () const
 
virtual void mouseMoveEvent (QMouseEvent *)
 Mouse Move Event handler. More...
 
virtual void mousePressEvent (QMouseEvent *)
 Mouse press event handler. More...
 
virtual void mouseReleaseEvent (QMouseEvent *)
 Mouse Release Event handler. More...
 
virtual void paintEvent (QPaintEvent *)
 Qt Paint Event. More...
 
virtual QSize sizeHint () const
 
void stopFlying ()
 Stop the flying movement of the wheel. More...
 
virtual void timerEvent (QTimerEvent *)
 Qt timer event. More...
 
virtual double valueAt (const QPoint &) const
 
virtual void wheelEvent (QWheelEvent *)
 Handle wheel events. More...
 
QRect wheelRect () const
 

Properties

int borderWidth
 
bool inverted
 
double mass
 
double maximum
 
double minimum
 
Qt::Orientation orientation
 
int pageStepCount
 
double singleStep
 
bool stepAlignment
 
int tickCount
 
double totalAngle
 
bool tracking
 
int updateInterval
 
double value
 
double viewAngle
 
int wheelBorderWidth
 
int wheelWidth
 
bool wrapping
 

Private Member Functions

double alignedValue (double) const
 
double boundedValue (double) const
 

Private Attributes

PrivateDatad_data
 

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 flying wheel.

The default range of the wheel is [0.0, 100.0]

See also
The radio example.

Definition at line 27 of file qwt_wheel.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 97 of file qwt_wheel.cpp.

QwtWheel::~QwtWheel ( )
virtual

Destructor.

Definition at line 108 of file qwt_wheel.cpp.

Member Function Documentation

double QwtWheel::alignedValue ( double  value) const
private

Definition at line 1273 of file qwt_wheel.cpp.

int QwtWheel::borderWidth ( ) const
double QwtWheel::boundedValue ( double  value) const
private

Definition at line 1250 of file qwt_wheel.cpp.

void QwtWheel::drawTicks ( QPainter *  painter,
const QRectF &  rect 
)
protectedvirtual

Draw the Wheel's ticks

Parameters
painterPainter
rectGeometry for the wheel

Definition at line 811 of file qwt_wheel.cpp.

void QwtWheel::drawWheelBackground ( QPainter *  painter,
const QRectF &  rect 
)
protectedvirtual

Draw the Wheel's background gradient

Parameters
painterPainter
rectGeometry for the wheel

Definition at line 755 of file qwt_wheel.cpp.

bool QwtWheel::isInverted ( ) const
Returns
True, when the wheel is inverted
See also
setInverted()

Definition at line 1170 of file qwt_wheel.cpp.

bool QwtWheel::isTracking ( ) const
Returns
True, when tracking is enabled
See also
setTracking(), valueChanged(), wheelMoved()

Definition at line 134 of file qwt_wheel.cpp.

void QwtWheel::keyPressEvent ( QKeyEvent *  event)
protectedvirtual

Handle key events

  • Qt::Key_Home
    Step to minimum()
  • Qt::Key_End
    Step to maximum()
  • Qt::Key_Up
    In case of a horizontal or not inverted vertical wheel the value will be incremented by the step size. For an inverted vertical wheel the value will be decremented by the step size.
  • Qt::Key_Down
    In case of a horizontal or not inverted vertical wheel the value will be decremented by the step size. For an inverted vertical wheel the value will be incremented by the step size.
  • Qt::Key_PageUp
    The value will be incremented by pageStepSize() * singleStepSize().
  • Qt::Key_PageDown
    The value will be decremented by pageStepSize() * singleStepSize().
Parameters
eventKey event

Definition at line 403 of file qwt_wheel.cpp.

double QwtWheel::mass ( ) const
double QwtWheel::maximum ( ) const
double QwtWheel::minimum ( ) const
QSize QwtWheel::minimumSizeHint ( ) const
protectedvirtual
Returns
Minimum size hint
Warning
The return value is based on the wheel width.

Definition at line 956 of file qwt_wheel.cpp.

void QwtWheel::mouseMoveEvent ( QMouseEvent *  event)
protectedvirtual

Mouse Move Event handler.

Turn the wheel according to the mouse position

Parameters
eventMouse event

Definition at line 193 of file qwt_wheel.cpp.

void QwtWheel::mousePressEvent ( QMouseEvent *  event)
protectedvirtual

Mouse press event handler.

Start movement of the wheel.

Parameters
eventMouse event

Definition at line 168 of file qwt_wheel.cpp.

void QwtWheel::mouseReleaseEvent ( QMouseEvent *  event)
protectedvirtual

Mouse Release Event handler.

When the wheel has no mass the movement of the wheel stops, otherwise it starts flying.

Parameters
eventMouse event

Definition at line 242 of file qwt_wheel.cpp.

Qt::Orientation QwtWheel::orientation ( ) const
int QwtWheel::pageStepCount ( ) const
void QwtWheel::paintEvent ( QPaintEvent *  event)
protectedvirtual

Qt Paint Event.

Parameters
eventPaint event

Definition at line 730 of file qwt_wheel.cpp.

void QwtWheel::setBorderWidth ( int  width)

Set the border width.

The border defaults to 2.

Parameters
widthBorder width
See also
borderWidth()

Definition at line 570 of file qwt_wheel.cpp.

void QwtWheel::setInverted ( bool  on)

En/Disable inverted appearance.

An inverted wheel increases its values in the opposite direction. The direction of an inverted horizontal wheel will be from right to left an inverted vertical wheel will increase from bottom to top.

Parameters
onEn/Disable inverted appearance
See also
isInverted()

Definition at line 1157 of file qwt_wheel.cpp.

void QwtWheel::setMass ( double  mass)
slot

Set the slider's mass for flywheel effect.

If the slider's mass is greater then 0, it will continue to move after the mouse button has been released. Its speed decreases with time at a rate depending on the slider's mass. A large mass means that it will continue to move for a long time.

Derived widgets may overload this function to make it public.

Parameters
massNew mass in kg
Bug:
If the mass is smaller than 1g, it is set to zero. The maximal mass is limited to 100kg.
See also
mass()

Definition at line 1215 of file qwt_wheel.cpp.

void QwtWheel::setMaximum ( double  value)

Set the maximum value of the range

Parameters
valueMaximum value
See also
setRange(), setMinimum(), maximum()

Definition at line 1099 of file qwt_wheel.cpp.

void QwtWheel::setMinimum ( double  value)

Set the minimum value of the range

Parameters
valueMinimum value
See also
setRange(), setMaximum(), minimum()
Note
The maximum is adjusted if necessary to ensure that the range remains valid.

Definition at line 1079 of file qwt_wheel.cpp.

void QwtWheel::setOrientation ( Qt::Orientation  orientation)

Set the wheel's orientation.

The default orientation is Qt::Horizontal.

Parameters
orientationQt::Horizontal or Qt::Vertical.
See also
orientation()

Definition at line 633 of file qwt_wheel.cpp.

void QwtWheel::setPageStepCount ( int  count)

Set the page step count.

pageStepCount is a multiplicator for the single step size that typically corresponds to the user pressing PageUp or PageDown.

A value of 0 disables page stepping.

The default value is 1.

Parameters
countMultiplicator for the single step size
See also
pageStepCount(), setSingleStep()

Definition at line 1028 of file qwt_wheel.cpp.

void QwtWheel::setRange ( double  min,
double  max 
)

Set the minimum and maximum values.

The maximum is adjusted if necessary to ensure that the range remains valid. The value might be modified to be inside of the range.

Parameters
minMinimum value
maxMaximum value
See also
minimum(), maximum()

Definition at line 1053 of file qwt_wheel.cpp.

void QwtWheel::setSingleStep ( double  stepSize)

Set the step size of the counter.

A value <= 0.0 disables stepping

Parameters
stepSizeSingle step size
See also
singleStep(), setPageStepCount()

Definition at line 974 of file qwt_wheel.cpp.

void QwtWheel::setStepAlignment ( bool  on)

En/Disable step alignment.

When step alignment is enabled value changes initiated by user input ( mouse, keyboard, wheel ) are aligned to the multiples of the single step.

Parameters
onOn/Off
See also
stepAlignment(), setSingleStep()

Definition at line 998 of file qwt_wheel.cpp.

void QwtWheel::setTickCount ( int  count)

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

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

Parameters
countNumber of grooves per 360 degrees
See also
tickCount()

Definition at line 513 of file qwt_wheel.cpp.

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

Definition at line 607 of file qwt_wheel.cpp.

void QwtWheel::setTracking ( bool  enable)

En/Disable tracking.

If tracking is enabled (the default), the wheel emits the valueChanged() signal while the wheel is moving. If tracking is disabled, the wheel emits the valueChanged() signal only when the wheel movement is terminated.

The wheelMoved() signal is emitted regardless id tracking is enabled or not.

Parameters
enableOn/Off
See also
isTracking()

Definition at line 125 of file qwt_wheel.cpp.

void QwtWheel::setUpdateInterval ( int  interval)

Specify the update interval when the wheel is flying.

Default and minimum value is 50 ms.

Parameters
intervalInterval in milliseconds
See also
updateInterval(), setMass(), setTracking()

Definition at line 147 of file qwt_wheel.cpp.

void QwtWheel::setValue ( double  value)
slot

Set a new value without adjusting to the step raster.

Parameters
valueNew value
See also
value(), valueChanged()
Warning
The value is clipped when it lies outside the range.

Definition at line 1121 of file qwt_wheel.cpp.

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

Definition at line 670 of file qwt_wheel.cpp.

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

Definition at line 545 of file qwt_wheel.cpp.

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

Definition at line 928 of file qwt_wheel.cpp.

void QwtWheel::setWrapping ( bool  on)

En/Disable wrapping.

If wrapping is true stepping up from maximum() value will take you to the minimum() value and vice versa.

Parameters
onEn/Disable wrapping
See also
wrapping()

Definition at line 1184 of file qwt_wheel.cpp.

double QwtWheel::singleStep ( ) const
QSize QwtWheel::sizeHint ( ) const
protectedvirtual
Returns
a size hint

Definition at line 946 of file qwt_wheel.cpp.

bool QwtWheel::stepAlignment ( ) const
void QwtWheel::stopFlying ( )
protected

Stop the flying movement of the wheel.

Definition at line 1240 of file qwt_wheel.cpp.

int QwtWheel::tickCount ( ) const
void QwtWheel::timerEvent ( QTimerEvent *  event)
protectedvirtual

Qt timer event.

The flying wheel effect is implemented using a timer

Parameters
eventTimer event
See also
updateInterval()

Definition at line 288 of file qwt_wheel.cpp.

double QwtWheel::totalAngle ( ) const
int QwtWheel::updateInterval ( ) const
double QwtWheel::value ( ) const
double QwtWheel::valueAt ( const QPoint &  pos) const
protectedvirtual

Determine the value corresponding to a specified point

Parameters
posPosition
Returns
Value corresponding to pos

Definition at line 691 of file qwt_wheel.cpp.

void QwtWheel::valueChanged ( double  value)
signal

Notify a change of value.

When tracking is enabled this signal will be emitted every time the value changes.

Parameters
valuenew value
See also
setTracking()
double QwtWheel::viewAngle ( ) const
int QwtWheel::wheelBorderWidth ( ) const
void QwtWheel::wheelEvent ( QWheelEvent *  event)
protectedvirtual

Handle wheel events.

In/Decrement the value

Parameters
eventWheel event

Definition at line 329 of file qwt_wheel.cpp.

void QwtWheel::wheelMoved ( double  value)
signal

This signal is emitted when the user moves the wheel with the mouse.

Parameters
valuenew value
void QwtWheel::wheelPressed ( )
signal

This signal is emitted when the user presses the the wheel with the mouse

QRect QwtWheel::wheelRect ( ) const
protected
Returns
Rectangle of the wheel without the outer border

Definition at line 588 of file qwt_wheel.cpp.

void QwtWheel::wheelReleased ( )
signal

This signal is emitted when the user releases the mouse

int QwtWheel::wheelWidth ( ) const
bool QwtWheel::wrapping ( ) const

Member Data Documentation

PrivateData* QwtWheel::d_data
private

Definition at line 175 of file qwt_wheel.h.

Property Documentation

int QwtWheel::borderWidth
readwrite
Returns
Border width
See also
setBorderWidth()

Definition at line 54 of file qwt_wheel.h.

bool QwtWheel::inverted
readwrite

Definition at line 45 of file qwt_wheel.h.

double QwtWheel::mass
readwrite
Returns
mass
See also
setMass()

Definition at line 47 of file qwt_wheel.h.

double QwtWheel::maximum
readwrite
Returns
The maximum of the range
See also
setRange(), setMaximum(), minimum()

Definition at line 37 of file qwt_wheel.h.

double QwtWheel::minimum
readwrite
Returns
The minimum of the range
See also
setRange(), setMinimum(), maximum()

Definition at line 36 of file qwt_wheel.h.

Qt::Orientation QwtWheel::orientation
readwrite
Returns
Orientation
See also
setOrientation()

Definition at line 32 of file qwt_wheel.h.

int QwtWheel::pageStepCount
readwrite
Returns
Page step count
See also
setPageStepCount(), singleStep()

Definition at line 40 of file qwt_wheel.h.

double QwtWheel::singleStep
readwrite
Returns
Single step size
See also
setSingleStep()

Definition at line 39 of file qwt_wheel.h.

bool QwtWheel::stepAlignment
readwrite
Returns
True, when the step alignment is enabled
See also
setStepAlignment(), singleStep()

Definition at line 41 of file qwt_wheel.h.

int QwtWheel::tickCount
readwrite
Returns
Number of grooves in the wheel's surface.
See also
setTickCnt()

Definition at line 52 of file qwt_wheel.h.

double QwtWheel::totalAngle
readwrite
Returns
Total angle which the wheel can be turned.
See also
setTotalAngle()

Definition at line 50 of file qwt_wheel.h.

bool QwtWheel::tracking
readwrite

Definition at line 43 of file qwt_wheel.h.

int QwtWheel::updateInterval
readwrite
Returns
Update interval when the wheel is flying
See also
setUpdateInterval(), mass(), isTracking()

Definition at line 48 of file qwt_wheel.h.

double QwtWheel::value
readwrite
Returns
Current value of the wheel
See also
setValue(), valueChanged()

Definition at line 34 of file qwt_wheel.h.

double QwtWheel::viewAngle
readwrite
Returns
Visible portion of the wheel
See also
setViewAngle(), totalAngle()

Definition at line 51 of file qwt_wheel.h.

int QwtWheel::wheelBorderWidth
readwrite
Returns
Wheel border width
See also
setWheelBorderWidth()

Definition at line 55 of file qwt_wheel.h.

int QwtWheel::wheelWidth
readwrite
Returns
Width of the wheel
See also
setWheelWidth()

Definition at line 53 of file qwt_wheel.h.

bool QwtWheel::wrapping
readwrite
Returns
True, when wrapping is set
See also
setWrapping()

Definition at line 44 of file qwt_wheel.h.


The documentation for this class was generated from the following files:


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:19