Loading...
Searching...
No Matches
qwt_wheel.cpp
/******************************************************************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#include "qwt_wheel.h"
#include "qwt_math.h"
#include "qwt_painter.h"
#include "qwt.h"
#include <qevent.h>
#include <qdrawutil.h>
#include <qpainter.h>
#include <qstyle.h>
#include <qstyleoption.h>
#include <qelapsedtimer.h>
#include <qmath.h>
class QwtWheel::PrivateData
{
public:
PrivateData()
: orientation( Qt::Horizontal )
, viewAngle( 175.0 )
, totalAngle( 360.0 )
, tickCount( 10 )
, wheelBorderWidth( 2 )
, borderWidth( 2 )
, wheelWidth( 20 )
, mouseOffset( 0.0 )
, updateInterval( 50 )
, mass( 0.0 )
, timerId( 0 )
, speed( 0.0 )
, mouseValue( 0.0 )
, flyingValue( 0.0 )
, minimum( 0.0 )
, maximum( 100.0 )
, singleStep( 1.0 )
, pageStepCount( 1 )
, value( 0.0 )
, isScrolling( false )
, tracking( true )
, stepAlignment( true )
, pendingValueChanged( false )
, inverted( false )
, wrapping( false )
{
}
Qt::Orientation orientation;
double viewAngle;
double totalAngle;
int tickCount;
int wheelBorderWidth;
int borderWidth;
int wheelWidth;
double mouseOffset;
int updateInterval;
double mass;
// for the flying wheel effect
int timerId;
QElapsedTimer timer;
double speed;
double mouseValue;
double flyingValue;
double minimum;
double maximum;
double singleStep;
int pageStepCount;
double value;
bool isScrolling;
bool tracking;
bool stepAlignment;
bool pendingValueChanged; // when not tracking
bool inverted;
bool wrapping;
};
QwtWheel::QwtWheel( QWidget* parent ):
QWidget( parent )
{
m_data = new PrivateData;
setFocusPolicy( Qt::StrongFocus );
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed );
setAttribute( Qt::WA_WState_OwnSizePolicy, false );
}
QwtWheel::~QwtWheel()
{
delete m_data;
}
void QwtWheel::setTracking( bool enable )
{
m_data->tracking = enable;
}
bool QwtWheel::isTracking() const
{
return m_data->tracking;
}
void QwtWheel::setUpdateInterval( int interval )
{
m_data->updateInterval = qMax( interval, 50 );
}
int QwtWheel::updateInterval() const
{
return m_data->updateInterval;
}
void QwtWheel::mousePressEvent( QMouseEvent* event )
{
stopFlying();
m_data->isScrolling = wheelRect().contains( event->pos() );
if ( m_data->isScrolling )
{
m_data->timer.start();
m_data->speed = 0.0;
m_data->mouseValue = valueAt( event->pos() );
m_data->mouseOffset = m_data->mouseValue - m_data->value;
m_data->pendingValueChanged = false;
Q_EMIT wheelPressed();
}
}
void QwtWheel::mouseMoveEvent( QMouseEvent* event )
{
if ( !m_data->isScrolling )
return;
double mouseValue = valueAt( event->pos() );
if ( m_data->mass > 0.0 )
{
double ms = m_data->timer.restart();
// the interval when mouse move events are posted are somehow
// random. To avoid unrealistic speed values we limit ms
ms = qMax( ms, 5.0 );
m_data->speed = ( mouseValue - m_data->mouseValue ) / ms;
}
m_data->mouseValue = mouseValue;
double value = boundedValue( mouseValue - m_data->mouseOffset );
if ( m_data->stepAlignment )
value = alignedValue( value );
if ( value != m_data->value )
{
m_data->value = value;
update();
Q_EMIT wheelMoved( m_data->value );
if ( m_data->tracking )
Q_EMIT valueChanged( m_data->value );
else
m_data->pendingValueChanged = true;
}
}
void QwtWheel::mouseReleaseEvent( QMouseEvent* event )
{
Q_UNUSED( event );
if ( !m_data->isScrolling )
return;
m_data->isScrolling = false;
bool startFlying = false;
if ( m_data->mass > 0.0 )
{
const qint64 ms = m_data->timer.elapsed();
if ( ( std::fabs( m_data->speed ) > 0.0 ) && ( ms < 50 ) )
startFlying = true;
}
if ( startFlying )
{
m_data->flyingValue =
boundedValue( m_data->mouseValue - m_data->mouseOffset );
m_data->timerId = startTimer( m_data->updateInterval );
}
else
{
if ( m_data->pendingValueChanged )
Q_EMIT valueChanged( m_data->value );
}
m_data->pendingValueChanged = false;
m_data->mouseOffset = 0.0;
Q_EMIT wheelReleased();
}
void QwtWheel::timerEvent( QTimerEvent* event )
{
if ( event->timerId() != m_data->timerId )
{
QWidget::timerEvent( event );
return;
}
m_data->speed *= std::exp( -m_data->updateInterval * 0.001 / m_data->mass );
m_data->flyingValue += m_data->speed * m_data->updateInterval;
m_data->flyingValue = boundedValue( m_data->flyingValue );
double value = m_data->flyingValue;
if ( m_data->stepAlignment )
value = alignedValue( value );
if ( std::fabs( m_data->speed ) < 0.001 * m_data->singleStep )
{
// stop if m_data->speed < one step per second
stopFlying();
}
if ( value != m_data->value )
{
m_data->value = value;
update();
if ( m_data->tracking || m_data->timerId == 0 )
Q_EMIT valueChanged( m_data->value );
}
}
void QwtWheel::wheelEvent( QWheelEvent* event )
{
#if QT_VERSION < 0x050e00
const QPoint wheelPos = event->pos();
const int wheelDelta = event->delta();
#else
const QPoint wheelPos = event->position().toPoint();
const QPoint delta = event->angleDelta();
const int wheelDelta = ( qAbs( delta.x() ) > qAbs( delta.y() ) )
? delta.x() : delta.y();
#endif
if ( !wheelRect().contains( wheelPos ) )
{
event->ignore();
return;
}
if ( m_data->isScrolling )
return;
stopFlying();
double increment = 0.0;
if ( ( event->modifiers() & Qt::ControlModifier ) ||
( event->modifiers() & Qt::ShiftModifier ) )
{
// one page regardless of delta
increment = m_data->singleStep * m_data->pageStepCount;
if ( wheelDelta < 0 )
increment = -increment;
}
else
{
const int numSteps = wheelDelta / 120;
increment = m_data->singleStep * numSteps;
}
if ( m_data->orientation == Qt::Vertical && m_data->inverted )
increment = -increment;
double value = boundedValue( m_data->value + increment );
if ( m_data->stepAlignment )
value = alignedValue( value );
if ( value != m_data->value )
{
m_data->value = value;
update();
Q_EMIT valueChanged( m_data->value );
Q_EMIT wheelMoved( m_data->value );
}
}
void QwtWheel::keyPressEvent( QKeyEvent* event )
{
if ( m_data->isScrolling )
{
// don't interfere mouse scrolling
return;
}
double value = m_data->value;
double increment = 0.0;
switch ( event->key() )
{
case Qt::Key_Down:
{
if ( m_data->orientation == Qt::Vertical && m_data->inverted )
increment = m_data->singleStep;
else
increment = -m_data->singleStep;
break;
}
case Qt::Key_Up:
{
if ( m_data->orientation == Qt::Vertical && m_data->inverted )
increment = -m_data->singleStep;
else
increment = m_data->singleStep;
break;
}
case Qt::Key_Left:
{
if ( m_data->orientation == Qt::Horizontal )
{
if ( m_data->inverted )
increment = m_data->singleStep;
else
increment = -m_data->singleStep;
}
break;
}
case Qt::Key_Right:
{
if ( m_data->orientation == Qt::Horizontal )
{
if ( m_data->inverted )
increment = -m_data->singleStep;
else
increment = m_data->singleStep;
}
break;
}
case Qt::Key_PageUp:
{
increment = m_data->pageStepCount * m_data->singleStep;
break;
}
case Qt::Key_PageDown:
{
increment = -m_data->pageStepCount * m_data->singleStep;
break;
}
case Qt::Key_Home:
{
value = m_data->minimum;
break;
}
case Qt::Key_End:
{
value = m_data->maximum;
break;
}
default:;
{
event->ignore();
}
}
if ( event->isAccepted() )
stopFlying();
if ( increment != 0.0 )
{
value = boundedValue( m_data->value + increment );
if ( m_data->stepAlignment )
value = alignedValue( value );
}
if ( value != m_data->value )
{
m_data->value = value;
update();
Q_EMIT valueChanged( m_data->value );
Q_EMIT wheelMoved( m_data->value );
}
}
void QwtWheel::setTickCount( int count )
{
count = qBound( 6, count, 50 );
if ( count != m_data->tickCount )
{
m_data->tickCount = qBound( 6, count, 50 );
update();
}
}
int QwtWheel::tickCount() const
{
return m_data->tickCount;
}
void QwtWheel::setWheelBorderWidth( int borderWidth )
{
const int d = qMin( width(), height() ) / 3;
borderWidth = qMin( borderWidth, d );
m_data->wheelBorderWidth = qMax( borderWidth, 1 );
update();
}
int QwtWheel::wheelBorderWidth() const
{
return m_data->wheelBorderWidth;
}
void QwtWheel::setBorderWidth( int width )
{
m_data->borderWidth = qMax( width, 0 );
update();
}
int QwtWheel::borderWidth() const
{
return m_data->borderWidth;
}
QRect QwtWheel::wheelRect() const
{
const int bw = m_data->borderWidth;
return contentsRect().adjusted( bw, bw, -bw, -bw );
}
void QwtWheel::setTotalAngle( double angle )
{
if ( angle < 0.0 )
angle = 0.0;
m_data->totalAngle = angle;
update();
}
double QwtWheel::totalAngle() const
{
return m_data->totalAngle;
}
void QwtWheel::setOrientation( Qt::Orientation orientation )
{
if ( m_data->orientation == orientation )
return;
if ( !testAttribute( Qt::WA_WState_OwnSizePolicy ) )
{
QSizePolicy sp = sizePolicy();
sp.transpose();
setSizePolicy( sp );
setAttribute( Qt::WA_WState_OwnSizePolicy, false );
}
m_data->orientation = orientation;
update();
}
Qt::Orientation QwtWheel::orientation() const
{
return m_data->orientation;
}
void QwtWheel::setViewAngle( double angle )
{
m_data->viewAngle = qBound( 10.0, angle, 175.0 );
update();
}
double QwtWheel::viewAngle() const
{
return m_data->viewAngle;
}
double QwtWheel::valueAt( const QPoint& pos ) const
{
const QRectF rect = wheelRect();
double w, dx;
if ( m_data->orientation == Qt::Vertical )
{
w = rect.height();
dx = rect.top() - pos.y();
}
else
{
w = rect.width();
dx = pos.x() - rect.left();
}
if ( w == 0.0 )
return 0.0;
if ( m_data->inverted )
{
dx = w - dx;
}
// w pixels is an arc of viewAngle degrees,
// so we convert change in pixels to change in angle
const double ang = dx * m_data->viewAngle / w;
// value range maps to totalAngle degrees,
// so convert the change in angle to a change in value
const double val = ang * ( maximum() - minimum() ) / m_data->totalAngle;
return val;
}
void QwtWheel::paintEvent( QPaintEvent* event )
{
QPainter painter( this );
painter.setClipRegion( event->region() );
QStyleOption opt;
opt.initFrom(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
qDrawShadePanel( &painter,
contentsRect(), palette(), true, m_data->borderWidth );
drawWheelBackground( &painter, wheelRect() );
drawTicks( &painter, wheelRect() );
if ( hasFocus() )
QwtPainter::drawFocusRect( &painter, this );
}
void QwtWheel::drawWheelBackground(
QPainter* painter, const QRectF& rect )
{
painter->save();
QPalette pal = palette();
// draw shaded background
QLinearGradient gradient( rect.topLeft(),
( m_data->orientation == Qt::Horizontal ) ? rect.topRight() : rect.bottomLeft() );
gradient.setColorAt( 0.0, pal.color( QPalette::Button ) );
gradient.setColorAt( 0.2, pal.color( QPalette::Midlight ) );
gradient.setColorAt( 0.7, pal.color( QPalette::Mid ) );
gradient.setColorAt( 1.0, pal.color( QPalette::Dark ) );
painter->fillRect( rect, gradient );
// draw internal border
const QPen lightPen( palette().color( QPalette::Light ),
m_data->wheelBorderWidth, Qt::SolidLine, Qt::FlatCap );
const QPen darkPen( pal.color( QPalette::Dark ),
m_data->wheelBorderWidth, Qt::SolidLine, Qt::FlatCap );
const double bw2 = 0.5 * m_data->wheelBorderWidth;
if ( m_data->orientation == Qt::Horizontal )
{
painter->setPen( lightPen );
painter->drawLine( QPointF( rect.left(), rect.top() + bw2 ),
QPointF( rect.right(), rect.top() + bw2 ) );
painter->setPen( darkPen );
painter->drawLine( QPointF( rect.left(), rect.bottom() - bw2 ),
QPointF( rect.right(), rect.bottom() - bw2 ) );
}
else // Qt::Vertical
{
painter->setPen( lightPen );
painter->drawLine( QPointF( rect.left() + bw2, rect.top() ),
QPointF( rect.left() + bw2, rect.bottom() ) );
painter->setPen( darkPen );
painter->drawLine( QPointF( rect.right() - bw2, rect.top() ),
QPointF( rect.right() - bw2, rect.bottom() ) );
}
painter->restore();
}
void QwtWheel::drawTicks( QPainter* painter, const QRectF& rect )
{
const double range = m_data->maximum - m_data->minimum;
if ( range == 0.0 || m_data->totalAngle == 0.0 )
{
return;
}
const QPen lightPen( palette().color( QPalette::Light ),
0, Qt::SolidLine, Qt::FlatCap );
const QPen darkPen( palette().color( QPalette::Dark ),
0, Qt::SolidLine, Qt::FlatCap );
const double cnvFactor = qAbs( m_data->totalAngle / range );
const double halfIntv = 0.5 * m_data->viewAngle / cnvFactor;
const double loValue = value() - halfIntv;
const double hiValue = value() + halfIntv;
const double tickWidth = 360.0 / double( m_data->tickCount ) / cnvFactor;
const double sinArc = qFastSin( m_data->viewAngle * M_PI / 360.0 );
if ( m_data->orientation == Qt::Horizontal )
{
const double radius = rect.width() * 0.5;
double l1 = rect.top() + m_data->wheelBorderWidth;
double l2 = rect.bottom() - m_data->wheelBorderWidth - 1;
// draw one point over the border if border > 1
if ( m_data->wheelBorderWidth > 1 )
{
l1--;
l2++;
}
const double maxpos = rect.right() - 2;
const double minpos = rect.left() + 2;
// draw tick marks
for ( double tickValue = std::ceil( loValue / tickWidth ) * tickWidth;
tickValue < hiValue; tickValue += tickWidth )
{
const double angle = qwtRadians( tickValue - value() );
const double s = qFastSin( angle * cnvFactor );
const double off = radius * ( sinArc + s ) / sinArc;
double tickPos;
if ( m_data->inverted )
tickPos = rect.left() + off;
else
tickPos = rect.right() - off;
if ( ( tickPos <= maxpos ) && ( tickPos > minpos ) )
{
painter->setPen( darkPen );
painter->drawLine( QPointF( tickPos - 1, l1 ),
QPointF( tickPos - 1, l2 ) );
painter->setPen( lightPen );
painter->drawLine( QPointF( tickPos, l1 ),
QPointF( tickPos, l2 ) );
}
}
}
else // Qt::Vertical
{
const double radius = rect.height() * 0.5;
double l1 = rect.left() + m_data->wheelBorderWidth;
double l2 = rect.right() - m_data->wheelBorderWidth - 1;
if ( m_data->wheelBorderWidth > 1 )
{
l1--;
l2++;
}
const double maxpos = rect.bottom() - 2;
const double minpos = rect.top() + 2;
for ( double tickValue = std::ceil( loValue / tickWidth ) * tickWidth;
tickValue < hiValue; tickValue += tickWidth )
{
const double angle = qwtRadians( tickValue - value() );
const double s = qFastSin( angle * cnvFactor );
const double off = radius * ( sinArc + s ) / sinArc;
double tickPos;
if ( m_data->inverted )
tickPos = rect.bottom() - off;
else
tickPos = rect.top() + off;
if ( ( tickPos <= maxpos ) && ( tickPos > minpos ) )
{
painter->setPen( darkPen );
painter->drawLine( QPointF( l1, tickPos - 1 ),
QPointF( l2, tickPos - 1 ) );
painter->setPen( lightPen );
painter->drawLine( QPointF( l1, tickPos ),
QPointF( l2, tickPos ) );
}
}
}
}
void QwtWheel::setWheelWidth( int width )
{
m_data->wheelWidth = width;
update();
}
int QwtWheel::wheelWidth() const
{
return m_data->wheelWidth;
}
QSize QwtWheel::sizeHint() const
{
const QSize hint = minimumSizeHint();
return qwtExpandedToGlobalStrut( hint );
}
QSize QwtWheel::minimumSizeHint() const
{
QSize sz( 3 * m_data->wheelWidth + 2 * m_data->borderWidth,
m_data->wheelWidth + 2 * m_data->borderWidth );
if ( m_data->orientation != Qt::Horizontal )
sz.transpose();
return sz;
}
void QwtWheel::setSingleStep( double stepSize )
{
m_data->singleStep = qwtMaxF( stepSize, 0.0 );
}
double QwtWheel::singleStep() const
{
return m_data->singleStep;
}
void QwtWheel::setStepAlignment( bool on )
{
if ( on != m_data->stepAlignment )
{
m_data->stepAlignment = on;
}
}
bool QwtWheel::stepAlignment() const
{
return m_data->stepAlignment;
}
void QwtWheel::setPageStepCount( int count )
{
m_data->pageStepCount = qMax( 0, count );
}
int QwtWheel::pageStepCount() const
{
return m_data->pageStepCount;
}
void QwtWheel::setRange( double min, double max )
{
max = qwtMaxF( min, max );
if ( m_data->minimum == min && m_data->maximum == max )
return;
m_data->minimum = min;
m_data->maximum = max;
if ( m_data->value < min || m_data->value > max )
{
m_data->value = qBound( min, m_data->value, max );
update();
Q_EMIT valueChanged( m_data->value );
}
}
void QwtWheel::setMinimum( double value )
{
setRange( value, maximum() );
}
double QwtWheel::minimum() const
{
return m_data->minimum;
}
void QwtWheel::setMaximum( double value )
{
setRange( minimum(), value );
}
double QwtWheel::maximum() const
{
return m_data->maximum;
}
void QwtWheel::setValue( double value )
{
stopFlying();
m_data->isScrolling = false;
value = qBound( m_data->minimum, value, m_data->maximum );
if ( m_data->value != value )
{
m_data->value = value;
update();
Q_EMIT valueChanged( m_data->value );
}
}
double QwtWheel::value() const
{
return m_data->value;
}
void QwtWheel::setInverted( bool on )
{
if ( m_data->inverted != on )
{
m_data->inverted = on;
update();
}
}
bool QwtWheel::isInverted() const
{
return m_data->inverted;
}
void QwtWheel::setWrapping( bool on )
{
m_data->wrapping = on;
}
bool QwtWheel::wrapping() const
{
return m_data->wrapping;
}
void QwtWheel::setMass( double mass )
{
if ( mass < 0.001 )
{
m_data->mass = 0.0;
}
else
{
m_data->mass = qwtMinF( 100.0, mass );
}
if ( m_data->mass <= 0.0 )
stopFlying();
}
double QwtWheel::mass() const
{
return m_data->mass;
}
void QwtWheel::stopFlying()
{
if ( m_data->timerId != 0 )
{
killTimer( m_data->timerId );
m_data->timerId = 0;
m_data->speed = 0.0;
}
}
double QwtWheel::boundedValue( double value ) const
{
const double range = m_data->maximum - m_data->minimum;
if ( m_data->wrapping && range >= 0.0 )
{
if ( value < m_data->minimum )
{
value += std::ceil( ( m_data->minimum - value ) / range ) * range;
}
else if ( value > m_data->maximum )
{
value -= std::ceil( ( value - m_data->maximum ) / range ) * range;
}
}
else
{
value = qBound( m_data->minimum, value, m_data->maximum );
}
return value;
}
double QwtWheel::alignedValue( double value ) const
{
const double stepSize = m_data->singleStep;
if ( stepSize > 0.0 )
{
value = m_data->minimum +
qRound( ( value - m_data->minimum ) / stepSize ) * stepSize;
if ( stepSize > 1e-12 )
{
if ( qFuzzyCompare( value + 1.0, 1.0 ) )
{
// correct rounding error if value = 0
value = 0.0;
}
else if ( qFuzzyCompare( value, m_data->maximum ) )
{
// correct rounding error at the border
value = m_data->maximum;
}
}
}
return value;
}
#include "moc_qwt_wheel.cpp"
QwtPainter::drawFocusRect
static void drawFocusRect(QPainter *, const QWidget *)
Draw a focus rectangle on a widget using its style.
Definition qwt_painter.cpp:805
QwtWheel::paintEvent
virtual void paintEvent(QPaintEvent *) override
Qt Paint Event.
Definition qwt_wheel.cpp:736
QwtWheel::wheelEvent
virtual void wheelEvent(QWheelEvent *) override
Handle wheel events.
Definition qwt_wheel.cpp:324
QwtWheel::orientation
Qt::Orientation orientation() const
Definition qwt_wheel.cpp:661
QwtWheel::stepAlignment
bool stepAlignment() const
Definition qwt_wheel.cpp:1016
QwtWheel::sizeHint
virtual QSize sizeHint() const override
Definition qwt_wheel.cpp:952
QwtWheel::setMass
void setMass(double)
Set the slider's mass for flywheel effect.
Definition qwt_wheel.cpp:1221
QwtWheel::drawWheelBackground
virtual void drawWheelBackground(QPainter *, const QRectF &)
Definition qwt_wheel.cpp:761
QwtWheel::minimumSizeHint
virtual QSize minimumSizeHint() const override
Definition qwt_wheel.cpp:962
QwtWheel::setTracking
void setTracking(bool)
En/Disable tracking.
Definition qwt_wheel.cpp:120
QwtWheel::value
double value() const
Definition qwt_wheel.cpp:1147
QwtWheel::mouseReleaseEvent
virtual void mouseReleaseEvent(QMouseEvent *) override
Mouse Release Event handler.
Definition qwt_wheel.cpp:237
QwtWheel::setWheelBorderWidth
void setWheelBorderWidth(int)
Set the wheel border width of the wheel.
Definition qwt_wheel.cpp:551
QwtWheel::setBorderWidth
void setBorderWidth(int)
Set the border width.
Definition qwt_wheel.cpp:576
QwtWheel::setRange
void setRange(double min, double max)
Set the minimum and maximum values.
Definition qwt_wheel.cpp:1059
QwtWheel::~QwtWheel
virtual ~QwtWheel()
Destructor.
Definition qwt_wheel.cpp:103
QwtWheel::updateInterval
int updateInterval() const
Definition qwt_wheel.cpp:151
QwtWheel::timerEvent
virtual void timerEvent(QTimerEvent *) override
Qt timer event.
Definition qwt_wheel.cpp:283
QwtWheel::setUpdateInterval
void setUpdateInterval(int)
Specify the update interval when the wheel is flying.
Definition qwt_wheel.cpp:142
QwtWheel::setStepAlignment
void setStepAlignment(bool on)
En/Disable step alignment.
Definition qwt_wheel.cpp:1004
QwtWheel::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *) override
Mouse Move Event handler.
Definition qwt_wheel.cpp:188
QwtWheel::setSingleStep
void setSingleStep(double)
Set the step size of the counter.
Definition qwt_wheel.cpp:980
QwtWheel::wheelRect
QRect wheelRect() const
Definition qwt_wheel.cpp:594
QwtWheel::borderWidth
int borderWidth() const
Definition qwt_wheel.cpp:586
QwtWheel::setValue
void setValue(double)
Set a new value without adjusting to the step raster.
Definition qwt_wheel.cpp:1127
QwtWheel::setMinimum
void setMinimum(double)
Definition qwt_wheel.cpp:1085
QwtWheel::maximum
double maximum() const
Definition qwt_wheel.cpp:1114
QwtWheel::wheelMoved
void wheelMoved(double value)
QwtWheel::pageStepCount
int pageStepCount() const
Definition qwt_wheel.cpp:1043
QwtWheel::setViewAngle
void setViewAngle(double)
Specify the visible portion of the wheel.
Definition qwt_wheel.cpp:676
QwtWheel::mass
double mass() const
Definition qwt_wheel.cpp:1240
QwtWheel::viewAngle
double viewAngle() const
Definition qwt_wheel.cpp:686
QwtWheel::mousePressEvent
virtual void mousePressEvent(QMouseEvent *) override
Mouse press event handler.
Definition qwt_wheel.cpp:163
QwtWheel::QwtWheel
QwtWheel(QWidget *parent=NULL)
Constructor.
Definition qwt_wheel.cpp:92
QwtWheel::wheelBorderWidth
int wheelBorderWidth() const
Definition qwt_wheel.cpp:563
QwtWheel::wheelReleased
void wheelReleased()
QwtWheel::valueAt
virtual double valueAt(const QPoint &) const
Definition qwt_wheel.cpp:697
QwtWheel::wheelPressed
void wheelPressed()
QwtWheel::minimum
double minimum() const
Definition qwt_wheel.cpp:1094
QwtWheel::drawTicks
virtual void drawTicks(QPainter *, const QRectF &)
Definition qwt_wheel.cpp:817
QwtWheel::setWheelWidth
void setWheelWidth(int)
Set the width of the wheel.
Definition qwt_wheel.cpp:934
QwtWheel::isTracking
bool isTracking() const
Definition qwt_wheel.cpp:129
QwtWheel::setOrientation
void setOrientation(Qt::Orientation)
Set the wheel's orientation.
Definition qwt_wheel.cpp:639
QwtWheel::valueChanged
void valueChanged(double value)
Notify a change of value.
QwtWheel::setPageStepCount
void setPageStepCount(int)
Set the page step count.
Definition qwt_wheel.cpp:1034
QwtWheel::setTickCount
void setTickCount(int)
Adjust the number of grooves in the wheel's surface.
Definition qwt_wheel.cpp:519
QwtWheel::keyPressEvent
virtual void keyPressEvent(QKeyEvent *) override
Definition qwt_wheel.cpp:409
QwtWheel::setTotalAngle
void setTotalAngle(double)
Set the total angle which the wheel can be turned.
Definition qwt_wheel.cpp:613
QwtWheel::setWrapping
void setWrapping(bool)
En/Disable wrapping.
Definition qwt_wheel.cpp:1190
QwtWheel::totalAngle
double totalAngle() const
Definition qwt_wheel.cpp:626
QwtWheel::wrapping
bool wrapping() const
Definition qwt_wheel.cpp:1199
QwtWheel::singleStep
double singleStep() const
Definition qwt_wheel.cpp:989
QwtWheel::isInverted
bool isInverted() const
Definition qwt_wheel.cpp:1176
QwtWheel::stopFlying
void stopFlying()
Stop the flying movement of the wheel.
Definition qwt_wheel.cpp:1246
QwtWheel::setInverted
void setInverted(bool)
En/Disable inverted appearance.
Definition qwt_wheel.cpp:1163
QwtWheel::tickCount
int tickCount() const
Definition qwt_wheel.cpp:534
QwtWheel::setMaximum
void setMaximum(double)
Definition qwt_wheel.cpp:1105
QwtWheel::wheelWidth
int wheelWidth() const
Definition qwt_wheel.cpp:944