Loading...
Searching...
No Matches
qwt_slider.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_slider.h"
#include "qwt_painter.h"
#include "qwt_scale_draw.h"
#include "qwt_scale_map.h"
#include "qwt_math.h"
#include "qwt.h"
#include <qevent.h>
#include <qdrawutil.h>
#include <qpainter.h>
#include <qstyle.h>
#include <qstyleoption.h>
#include <qmargins.h>
static QSize qwtHandleSize( const QSize& size,
Qt::Orientation orientation, bool hasTrough )
{
QSize handleSize = size;
if ( handleSize.isEmpty() )
{
const int handleThickness = 16;
handleSize.setWidth( 2 * handleThickness );
handleSize.setHeight( handleThickness );
if ( !hasTrough )
handleSize.transpose();
if ( orientation == Qt::Vertical )
handleSize.transpose();
}
return handleSize;
}
static QwtScaleDraw::Alignment qwtScaleDrawAlignment(
Qt::Orientation orientation, QwtSlider::ScalePosition scalePos )
{
QwtScaleDraw::Alignment align;
if ( orientation == Qt::Vertical )
{
// NoScale lays out like Left
if ( scalePos == QwtSlider::LeadingScale )
align = QwtScaleDraw::RightScale;
else
align = QwtScaleDraw::LeftScale;
}
else
{
// NoScale lays out like Bottom
if ( scalePos == QwtSlider::TrailingScale )
align = QwtScaleDraw::TopScale;
else
align = QwtScaleDraw::BottomScale;
}
return align;
}
class QwtSlider::PrivateData
{
public:
PrivateData()
: repeatTimerId( 0 )
, updateInterval( 150 )
, stepsIncrement( 0 )
, pendingValueChange( false )
, borderWidth( 2 )
, spacing( 4 )
, scalePosition( QwtSlider::TrailingScale )
, hasTrough( true )
, hasGroove( false )
, mouseOffset( 0 )
{
}
int repeatTimerId;
bool timerTick;
int updateInterval;
int stepsIncrement;
bool pendingValueChange;
QRect sliderRect;
QSize handleSize;
int borderWidth;
int spacing;
Qt::Orientation orientation;
QwtSlider::ScalePosition scalePosition;
bool hasTrough;
bool hasGroove;
int mouseOffset;
mutable QSize sizeHintCache;
};
QwtSlider::QwtSlider( QWidget* parent )
: QwtAbstractSlider( parent )
{
initSlider( Qt::Vertical );
}
QwtSlider::QwtSlider( Qt::Orientation orientation, QWidget* parent )
: QwtAbstractSlider( parent )
{
initSlider( orientation );
}
QwtSlider::~QwtSlider()
{
delete m_data;
}
void QwtSlider::initSlider( Qt::Orientation orientation )
{
if ( orientation == Qt::Vertical )
setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding );
else
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
setAttribute( Qt::WA_WState_OwnSizePolicy, false );
m_data = new QwtSlider::PrivateData;
m_data->orientation = orientation;
scaleDraw()->setAlignment(
qwtScaleDrawAlignment( orientation, m_data->scalePosition ) );
scaleDraw()->setLength( 100 );
setScale( 0.0, 100.0 );
setValue( 0.0 );
}
void QwtSlider::setOrientation( Qt::Orientation orientation )
{
if ( orientation == m_data->orientation )
return;
m_data->orientation = orientation;
scaleDraw()->setAlignment(
qwtScaleDrawAlignment( orientation, m_data->scalePosition ) );
if ( !testAttribute( Qt::WA_WState_OwnSizePolicy ) )
{
QSizePolicy sp = sizePolicy();
sp.transpose();
setSizePolicy( sp );
setAttribute( Qt::WA_WState_OwnSizePolicy, false );
}
if ( testAttribute( Qt::WA_WState_Polished ) )
layoutSlider( true );
}
Qt::Orientation QwtSlider::orientation() const
{
return m_data->orientation;
}
void QwtSlider::setScalePosition( ScalePosition scalePosition )
{
if ( m_data->scalePosition == scalePosition )
return;
m_data->scalePosition = scalePosition;
scaleDraw()->setAlignment(
qwtScaleDrawAlignment( m_data->orientation, scalePosition ) );
if ( testAttribute( Qt::WA_WState_Polished ) )
layoutSlider( true );
}
QwtSlider::ScalePosition QwtSlider::scalePosition() const
{
return m_data->scalePosition;
}
void QwtSlider::setBorderWidth( int width )
{
if ( width < 0 )
width = 0;
if ( width != m_data->borderWidth )
{
m_data->borderWidth = width;
if ( testAttribute( Qt::WA_WState_Polished ) )
layoutSlider( true );
}
}
int QwtSlider::borderWidth() const
{
return m_data->borderWidth;
}
void QwtSlider::setSpacing( int spacing )
{
if ( spacing <= 0 )
spacing = 0;
if ( spacing != m_data->spacing )
{
m_data->spacing = spacing;
if ( testAttribute( Qt::WA_WState_Polished ) )
layoutSlider( true );
}
}
int QwtSlider::spacing() const
{
return m_data->spacing;
}
void QwtSlider::setHandleSize( const QSize& size )
{
if ( size != m_data->handleSize )
{
m_data->handleSize = size;
if ( testAttribute( Qt::WA_WState_Polished ) )
layoutSlider( true );
}
}
QSize QwtSlider::handleSize() const
{
return m_data->handleSize;
}
void QwtSlider::setScaleDraw( QwtScaleDraw* scaleDraw )
{
const QwtScaleDraw* previousScaleDraw = this->scaleDraw();
if ( scaleDraw == NULL || scaleDraw == previousScaleDraw )
return;
if ( previousScaleDraw )
scaleDraw->setAlignment( previousScaleDraw->alignment() );
setAbstractScaleDraw( scaleDraw );
if ( testAttribute( Qt::WA_WState_Polished ) )
layoutSlider( true );
}
const QwtScaleDraw* QwtSlider::scaleDraw() const
{
return static_cast< const QwtScaleDraw* >( abstractScaleDraw() );
}
QwtScaleDraw* QwtSlider::scaleDraw()
{
return static_cast< QwtScaleDraw* >( abstractScaleDraw() );
}
void QwtSlider::scaleChange()
{
QwtAbstractSlider::scaleChange();
if ( testAttribute( Qt::WA_WState_Polished ) )
layoutSlider( true );
}
void QwtSlider::setUpdateInterval( int interval )
{
m_data->updateInterval = qMax( interval, 50 );
}
int QwtSlider::updateInterval() const
{
return m_data->updateInterval;
}
void QwtSlider::drawSlider(
QPainter* painter, const QRect& sliderRect ) const
{
QRect innerRect( sliderRect );
if ( m_data->hasTrough )
{
const int bw = m_data->borderWidth;
innerRect = sliderRect.adjusted( bw, bw, -bw, -bw );
painter->fillRect( innerRect, palette().brush( QPalette::Mid ) );
qDrawShadePanel( painter, sliderRect, palette(), true, bw, NULL );
}
if ( m_data->hasGroove )
{
const QSize handleSize = qwtHandleSize( m_data->handleSize,
m_data->orientation, m_data->hasTrough );
const int slotExtent = 4;
const int slotMargin = 4;
QRect slotRect;
if ( orientation() == Qt::Horizontal )
{
int slotOffset = qMax( 1, handleSize.width() / 2 - slotMargin );
int slotHeight = slotExtent + ( innerRect.height() % 2 );
slotRect.setWidth( innerRect.width() - 2 * slotOffset );
slotRect.setHeight( slotHeight );
}
else
{
int slotOffset = qMax( 1, handleSize.height() / 2 - slotMargin );
int slotWidth = slotExtent + ( innerRect.width() % 2 );
slotRect.setWidth( slotWidth );
slotRect.setHeight( innerRect.height() - 2 * slotOffset );
}
slotRect.moveCenter( innerRect.center() );
QBrush brush = palette().brush( QPalette::Dark );
qDrawShadePanel( painter, slotRect, palette(), true, 1, &brush );
}
if ( isValid() )
drawHandle( painter, handleRect(), transform( value() ) );
}
void QwtSlider::drawHandle( QPainter* painter,
const QRect& handleRect, int pos ) const
{
const int bw = m_data->borderWidth;
qDrawShadePanel( painter,
handleRect, palette(), false, bw,
&palette().brush( QPalette::Button ) );
pos++; // shade line points one pixel below
if ( orientation() == Qt::Horizontal )
{
qDrawShadeLine( painter, pos, handleRect.top() + bw,
pos, handleRect.bottom() - bw, palette(), true, 1 );
}
else // Vertical
{
qDrawShadeLine( painter, handleRect.left() + bw, pos,
handleRect.right() - bw, pos, palette(), true, 1 );
}
}
bool QwtSlider::isScrollPosition( const QPoint& pos ) const
{
if ( handleRect().contains( pos ) )
{
const double v = ( orientation() == Qt::Horizontal )
? pos.x() : pos.y();
m_data->mouseOffset = v - transform( value() );
return true;
}
return false;
}
double QwtSlider::scrolledTo( const QPoint& pos ) const
{
int p = ( orientation() == Qt::Horizontal )
? pos.x() : pos.y();
p -= m_data->mouseOffset;
int min = transform( lowerBound() );
int max = transform( upperBound() );
if ( min > max )
qSwap( min, max );
p = qBound( min, p, max );
return scaleMap().invTransform( p );
}
void QwtSlider::mousePressEvent( QMouseEvent* event )
{
if ( isReadOnly() )
{
event->ignore();
return;
}
const QPoint pos = event->pos();
if ( isValid() && m_data->sliderRect.contains( pos ) )
{
if ( !handleRect().contains( pos ) )
{
const int markerPos = transform( value() );
m_data->stepsIncrement = pageSteps();
if ( m_data->orientation == Qt::Horizontal )
{
if ( pos.x() < markerPos )
m_data->stepsIncrement = -m_data->stepsIncrement;
}
else
{
if ( pos.y() < markerPos )
m_data->stepsIncrement = -m_data->stepsIncrement;
}
if ( isInverted() )
m_data->stepsIncrement = -m_data->stepsIncrement;
const double v = value();
incrementValue( m_data->stepsIncrement );
if ( v != value() )
{
if ( isTracking() )
Q_EMIT valueChanged( value() );
else
m_data->pendingValueChange = true;
Q_EMIT sliderMoved( value() );
}
m_data->timerTick = false;
m_data->repeatTimerId = startTimer( qMax( 250, 2 * updateInterval() ) );
return;
}
}
QwtAbstractSlider::mousePressEvent( event );
}
void QwtSlider::mouseReleaseEvent( QMouseEvent* event )
{
if ( m_data->repeatTimerId > 0 )
{
killTimer( m_data->repeatTimerId );
m_data->repeatTimerId = 0;
m_data->timerTick = false;
m_data->stepsIncrement = 0;
}
if ( m_data->pendingValueChange )
{
m_data->pendingValueChange = false;
Q_EMIT valueChanged( value() );
}
QwtAbstractSlider::mouseReleaseEvent( event );
}
void QwtSlider::timerEvent( QTimerEvent* event )
{
if ( event->timerId() != m_data->repeatTimerId )
{
QwtAbstractSlider::timerEvent( event );
return;
}
if ( !isValid() )
{
killTimer( m_data->repeatTimerId );
m_data->repeatTimerId = 0;
return;
}
const double v = value();
incrementValue( m_data->stepsIncrement );
if ( v != value() )
{
if ( isTracking() )
Q_EMIT valueChanged( value() );
else
m_data->pendingValueChange = true;
Q_EMIT sliderMoved( value() );
}
if ( !m_data->timerTick )
{
// restart the timer with a shorter interval
killTimer( m_data->repeatTimerId );
m_data->repeatTimerId = startTimer( updateInterval() );
m_data->timerTick = true;
}
}
void QwtSlider::paintEvent( QPaintEvent* event )
{
QPainter painter( this );
painter.setClipRegion( event->region() );
QStyleOption opt;
opt.initFrom(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
if ( m_data->scalePosition != QwtSlider::NoScale )
{
if ( !m_data->sliderRect.contains( event->rect() ) )
scaleDraw()->draw( &painter, palette() );
}
drawSlider( &painter, m_data->sliderRect );
if ( hasFocus() )
QwtPainter::drawFocusRect( &painter, this, m_data->sliderRect );
}
void QwtSlider::resizeEvent( QResizeEvent* event )
{
layoutSlider( false );
QwtAbstractSlider::resizeEvent( event );
}
bool QwtSlider::event( QEvent* event )
{
if ( event->type() == QEvent::PolishRequest )
layoutSlider( false );
return QwtAbstractSlider::event( event );
}
void QwtSlider::changeEvent( QEvent* event )
{
if ( event->type() == QEvent::StyleChange ||
event->type() == QEvent::FontChange )
{
if ( testAttribute( Qt::WA_WState_Polished ) )
layoutSlider( true );
}
QwtAbstractSlider::changeEvent( event );
}
void QwtSlider::layoutSlider( bool update_geometry )
{
int bw = 0;
if ( m_data->hasTrough )
bw = m_data->borderWidth;
const QSize handleSize = qwtHandleSize( m_data->handleSize,
m_data->orientation, m_data->hasTrough );
QRect sliderRect = contentsRect();
/*
The marker line of the handle needs to be aligned to
the scale. But the marker is in the center
and we need space enough to display the rest of the handle.
But the scale itself usually needs margins for displaying
the tick labels, that also might needs space beyond the
backbone.
Now it depends on what needs more margins. If it is the
slider the scale gets shrunk, otherwise the slider.
*/
int scaleMargin = 0;
if ( m_data->scalePosition != QwtSlider::NoScale )
{
int d1, d2;
scaleDraw()->getBorderDistHint( font(), d1, d2 );
scaleMargin = qMax( d1, d2 ) - bw;
}
int scaleX, scaleY, scaleLength;
if ( m_data->orientation == Qt::Horizontal )
{
const int handleMargin = handleSize.width() / 2 - 1;
if ( scaleMargin > handleMargin )
{
int off = scaleMargin - handleMargin;
sliderRect.adjust( off, 0, -off, 0 );
}
scaleX = sliderRect.left() + bw + handleSize.width() / 2 - 1;
scaleLength = sliderRect.width() - handleSize.width();
}
else
{
int handleMargin = handleSize.height() / 2 - 1;
if ( scaleMargin > handleMargin )
{
int off = scaleMargin - handleMargin;
sliderRect.adjust( 0, off, 0, -off );
}
scaleY = sliderRect.top() + bw + handleSize.height() / 2 - 1;
scaleLength = sliderRect.height() - handleSize.height();
}
scaleLength -= 2 * bw;
// now align slider and scale according to the ScalePosition
if ( m_data->orientation == Qt::Horizontal )
{
const int h = handleSize.height() + 2 * bw;
if ( m_data->scalePosition == QwtSlider::TrailingScale )
{
sliderRect.setTop( sliderRect.bottom() + 1 - h );
scaleY = sliderRect.top() - m_data->spacing;
}
else
{
sliderRect.setHeight( h );
scaleY = sliderRect.bottom() + 1 + m_data->spacing;
}
}
else // Qt::Vertical
{
const int w = handleSize.width() + 2 * bw;
if ( m_data->scalePosition == QwtSlider::LeadingScale )
{
sliderRect.setWidth( w );
scaleX = sliderRect.right() + 1 + m_data->spacing;
}
else
{
sliderRect.setLeft( sliderRect.right() + 1 - w );
scaleX = sliderRect.left() - m_data->spacing;
}
}
m_data->sliderRect = sliderRect;
scaleDraw()->move( scaleX, scaleY );
scaleDraw()->setLength( scaleLength );
if ( update_geometry )
{
m_data->sizeHintCache = QSize(); // invalidate
updateGeometry();
update();
}
}
void QwtSlider::setTrough( bool on )
{
if ( m_data->hasTrough != on )
{
m_data->hasTrough = on;
if ( testAttribute( Qt::WA_WState_Polished ) )
layoutSlider( true );
}
}
bool QwtSlider::hasTrough() const
{
return m_data->hasTrough;
}
void QwtSlider::setGroove( bool on )
{
if ( m_data->hasGroove != on )
{
m_data->hasGroove = on;
if ( testAttribute( Qt::WA_WState_Polished ) )
layoutSlider( true );
}
}
bool QwtSlider::hasGroove() const
{
return m_data->hasGroove;
}
QSize QwtSlider::sizeHint() const
{
const QSize hint = minimumSizeHint();
return qwtExpandedToGlobalStrut( hint );
}
QSize QwtSlider::minimumSizeHint() const
{
if ( !m_data->sizeHintCache.isEmpty() )
return m_data->sizeHintCache;
const QSize handleSize = qwtHandleSize( m_data->handleSize,
m_data->orientation, m_data->hasTrough );
int bw = 0;
if ( m_data->hasTrough )
bw = m_data->borderWidth;
int sliderLength = 0;
int scaleExtent = 0;
if ( m_data->scalePosition != QwtSlider::NoScale )
{
int d1, d2;
scaleDraw()->getBorderDistHint( font(), d1, d2 );
const int scaleBorderDist = 2 * ( qMax( d1, d2 ) - bw );
int handleBorderDist;
if ( m_data->orientation == Qt::Horizontal )
handleBorderDist = handleSize.width();
else
handleBorderDist = handleSize.height();
sliderLength = scaleDraw()->minLength( font() );
if ( handleBorderDist > scaleBorderDist )
{
// We need additional space for the overlapping handle
sliderLength += handleBorderDist - scaleBorderDist;
}
scaleExtent += m_data->spacing;
scaleExtent += qwtCeil( scaleDraw()->extent( font() ) );
}
sliderLength = qMax( sliderLength, 84 ); // from QSlider
int w = 0;
int h = 0;
if ( m_data->orientation == Qt::Horizontal )
{
w = sliderLength;
h = handleSize.height() + 2 * bw + scaleExtent;
}
else
{
w = handleSize.width() + 2 * bw + scaleExtent;
h = sliderLength;
}
// finally add margins
const QMargins m = contentsMargins();
w += m.left() + m.right();
h += m.top() + m.bottom();
m_data->sizeHintCache = QSize( w, h );
return m_data->sizeHintCache;
}
QRect QwtSlider::handleRect() const
{
if ( !isValid() )
return QRect();
const int markerPos = transform( value() );
QPoint center = m_data->sliderRect.center();
if ( m_data->orientation == Qt::Horizontal )
center.setX( markerPos );
else
center.setY( markerPos );
QRect rect;
rect.setSize( qwtHandleSize( m_data->handleSize,
m_data->orientation, m_data->hasTrough ) );
rect.moveCenter( center );
return rect;
}
QRect QwtSlider::sliderRect() const
{
return m_data->sliderRect;
}
#include "moc_qwt_slider.cpp"
QwtAbstractScaleDraw::draw
virtual void draw(QPainter *, const QPalette &) const
Draw the scale.
Definition qwt_abstract_scale_draw.cpp:169
QwtAbstractScale::scaleMap
const QwtScaleMap & scaleMap() const
Definition qwt_abstract_scale.cpp:357
QwtAbstractScale::lowerBound
double lowerBound() const
Definition qwt_abstract_scale.cpp:88
QwtAbstractScale::abstractScaleDraw
const QwtAbstractScaleDraw * abstractScaleDraw() const
Definition qwt_abstract_scale.cpp:302
QwtAbstractScale::transform
int transform(double) const
Definition qwt_abstract_scale.cpp:369
QwtAbstractScale::isInverted
bool isInverted() const
Definition qwt_abstract_scale.cpp:390
QwtAbstractScale::setAbstractScaleDraw
void setAbstractScaleDraw(QwtAbstractScaleDraw *)
Set a scale draw.
Definition qwt_abstract_scale.cpp:277
QwtAbstractScale::upperBound
double upperBound() const
Definition qwt_abstract_scale.cpp:111
QwtAbstractScale::setScale
void setScale(double lowerBound, double upperBound)
Specify a scale.
Definition qwt_abstract_scale.cpp:130
QwtAbstractScale::changeEvent
virtual void changeEvent(QEvent *) override
Definition qwt_abstract_scale.cpp:453
QwtAbstractSlider
An abstract base class for slider widgets with a scale.
Definition qwt_abstract_slider.h:33
QwtAbstractSlider::scaleChange
virtual void scaleChange() override
Definition qwt_abstract_slider.cpp:811
QwtAbstractSlider::mouseReleaseEvent
virtual void mouseReleaseEvent(QMouseEvent *) override
Definition qwt_abstract_slider.cpp:265
QwtAbstractSlider::mousePressEvent
virtual void mousePressEvent(QMouseEvent *) override
Definition qwt_abstract_slider.cpp:195
QwtAbstractSlider::valueChanged
void valueChanged(double value)
Notify a change of value.
QwtAbstractSlider::setValue
void setValue(double value)
Definition qwt_abstract_slider.cpp:570
QwtAbstractSlider::isTracking
bool isTracking() const
Definition qwt_abstract_slider.cpp:186
QwtAbstractSlider::isReadOnly
bool isReadOnly() const
Definition qwt_abstract_slider.cpp:159
QwtAbstractSlider::incrementValue
void incrementValue(int stepCount)
Definition qwt_abstract_slider.cpp:650
QwtAbstractSlider::isValid
bool isValid() const
Definition qwt_abstract_slider.cpp:125
QwtAbstractSlider::value
double value() const
Returns the current value.
Definition qwt_abstract_slider.cpp:587
QwtAbstractSlider::pageSteps
uint pageSteps() const
Definition qwt_abstract_slider.cpp:533
QwtAbstractSlider::sliderMoved
void sliderMoved(double value)
QwtPainter::drawFocusRect
static void drawFocusRect(QPainter *, const QWidget *)
Draw a focus rectangle on a widget using its style.
Definition qwt_painter.cpp:805
QwtScaleDraw
A class for drawing scales.
Definition qwt_scale_draw.h:36
QwtScaleDraw::setLength
void setLength(double length)
Definition qwt_scale_draw.cpp:732
QwtScaleDraw::move
void move(double x, double y)
Definition qwt_scale_draw.h:118
QwtScaleDraw::getBorderDistHint
void getBorderDistHint(const QFont &, int &start, int &end) const
Determine the minimum border distance.
Definition qwt_scale_draw.cpp:361
QwtScaleDraw::minLength
int minLength(const QFont &) const
Definition qwt_scale_draw.cpp:560
QwtScaleDraw::setAlignment
void setAlignment(Alignment)
Definition qwt_scale_draw.cpp:322
QwtScaleDraw::alignment
Alignment alignment() const
Definition qwt_scale_draw.cpp:309
QwtScaleDraw::Alignment
Alignment
Definition qwt_scale_draw.h:43
QwtScaleDraw::BottomScale
@ BottomScale
The scale is below.
Definition qwt_scale_draw.h:45
QwtScaleDraw::TopScale
@ TopScale
The scale is above.
Definition qwt_scale_draw.h:48
QwtScaleDraw::RightScale
@ RightScale
The scale is right.
Definition qwt_scale_draw.h:54
QwtScaleDraw::LeftScale
@ LeftScale
The scale is left.
Definition qwt_scale_draw.h:51
QwtScaleMap::invTransform
double invTransform(double p) const
Definition qwt_scale_map.h:154
QwtSlider
The Slider Widget.
Definition qwt_slider.h:31
QwtSlider::mouseReleaseEvent
virtual void mouseReleaseEvent(QMouseEvent *) override
Definition qwt_slider.cpp:606
QwtSlider::ScalePosition
ScalePosition
Definition qwt_slider.h:55
QwtSlider::LeadingScale
@ LeadingScale
The scale is right of a vertical or below a horizontal slider.
Definition qwt_slider.h:60
QwtSlider::TrailingScale
@ TrailingScale
The scale is left of a vertical or above a horizontal slider.
Definition qwt_slider.h:63
QwtSlider::NoScale
@ NoScale
The slider has no scale.
Definition qwt_slider.h:57
QwtSlider::resizeEvent
virtual void resizeEvent(QResizeEvent *) override
Definition qwt_slider.cpp:700
QwtSlider::spacing
int spacing() const
Definition qwt_slider.cpp:296
QwtSlider::~QwtSlider
virtual ~QwtSlider()
Destructor.
Definition qwt_slider.cpp:143
QwtSlider::isScrollPosition
virtual bool isScrollPosition(const QPoint &) const override
Determine what to do when the user presses a mouse button.
Definition qwt_slider.cpp:503
QwtSlider::hasGroove
bool hasGroove() const
Definition qwt_slider.cpp:904
QwtSlider::hasTrough
bool hasTrough() const
Definition qwt_slider.cpp:875
QwtSlider::setOrientation
void setOrientation(Qt::Orientation)
Set the orientation.
Definition qwt_slider.cpp:175
QwtSlider::borderWidth
int borderWidth() const
Definition qwt_slider.cpp:262
QwtSlider::handleRect
QRect handleRect() const
Definition qwt_slider.cpp:990
QwtSlider::scaleDraw
const QwtScaleDraw * scaleDraw() const
Definition qwt_slider.cpp:363
QwtSlider::setGroove
void setGroove(bool)
Definition qwt_slider.cpp:889
QwtSlider::setScalePosition
void setScalePosition(ScalePosition)
Change the position of the scale.
Definition qwt_slider.cpp:213
QwtSlider::paintEvent
virtual void paintEvent(QPaintEvent *) override
Definition qwt_slider.cpp:675
QwtSlider::QwtSlider
QwtSlider(QWidget *parent=NULL)
Definition qwt_slider.cpp:119
QwtSlider::event
virtual bool event(QEvent *) override
Definition qwt_slider.cpp:712
QwtSlider::minimumSizeHint
virtual QSize minimumSizeHint() const override
Definition qwt_slider.cpp:922
QwtSlider::drawHandle
virtual void drawHandle(QPainter *, const QRect &, int pos) const
Definition qwt_slider.cpp:473
QwtSlider::setHandleSize
void setHandleSize(const QSize &)
Set the slider's handle size.
Definition qwt_slider.cpp:311
QwtSlider::timerEvent
virtual void timerEvent(QTimerEvent *) override
Definition qwt_slider.cpp:633
QwtSlider::updateInterval
int updateInterval() const
Definition qwt_slider.cpp:404
QwtSlider::setScaleDraw
void setScaleDraw(QwtScaleDraw *)
Set a scale draw.
Definition qwt_slider.cpp:344
QwtSlider::setSpacing
void setSpacing(int)
Change the spacing between trough and scale.
Definition qwt_slider.cpp:278
QwtSlider::scrolledTo
virtual double scrolledTo(const QPoint &) const override
Determine the value for a new position of the slider handle.
Definition qwt_slider.cpp:526
QwtSlider::changeEvent
virtual void changeEvent(QEvent *) override
Definition qwt_slider.cpp:724
QwtSlider::scalePosition
ScalePosition scalePosition() const
Definition qwt_slider.cpp:230
QwtSlider::sliderRect
QRect sliderRect() const
Definition qwt_slider.cpp:1014
QwtSlider::setTrough
void setTrough(bool)
Definition qwt_slider.cpp:860
QwtSlider::handleSize
QSize handleSize() const
Definition qwt_slider.cpp:326
QwtSlider::setBorderWidth
void setBorderWidth(int)
Change the slider's border width.
Definition qwt_slider.cpp:244
QwtSlider::scaleChange
virtual void scaleChange() override
Notify changed scale.
Definition qwt_slider.cpp:378
QwtSlider::sizeHint
virtual QSize sizeHint() const override
Definition qwt_slider.cpp:912
QwtSlider::mousePressEvent
virtual void mousePressEvent(QMouseEvent *) override
Definition qwt_slider.cpp:547
QwtSlider::setUpdateInterval
void setUpdateInterval(int)
Specify the update interval for automatic scrolling.
Definition qwt_slider.cpp:395
QwtSlider::orientation
Qt::Orientation orientation() const
Definition qwt_slider.cpp:202
QwtSlider::drawSlider
virtual void drawSlider(QPainter *, const QRect &) const
Definition qwt_slider.cpp:415