22 const int tValue = slider->
transform( value );
33 for (
int j = 0; j < ticks.size(); j++ )
35 if ( slider->
transform( ticks[ j ] ) == tValue )
97 setFocusPolicy( Qt::StrongFocus );
146 setFocusPolicy( on ? Qt::StrongFocus : Qt::NoFocus );
307 #if QT_VERSION < 0x050000 308 const int wheelDelta =
event->delta();
310 const QPoint delta =
event->angleDelta();
311 const int wheelDelta = ( qAbs( delta.x() ) > qAbs( delta.y() ) )
312 ? delta.x() : delta.y();
317 if ( ( event->modifiers() & Qt::ControlModifier ) ||
318 ( event->modifiers() & Qt::ShiftModifier ) )
322 if ( wheelDelta < 0 )
323 numSteps = -numSteps;
327 const int numTurns = ( wheelDelta / 120 );
332 numSteps = -numSteps;
384 switch ( event->key() )
390 numSteps = -numSteps;
398 numSteps = -numSteps;
406 numSteps = -numSteps;
413 numSteps = -numSteps;
421 numSteps = -numSteps;
424 case Qt::Key_PageDown:
428 numSteps = -numSteps;
671 double value,
int stepCount )
const 679 if ( transformation == NULL )
696 double v = transformation->
transform( value );
698 v = qRound( v / stepSize ) * stepSize;
719 const int fullCircle = 360 * 16;
722 if (
int( pd / fullCircle ) * fullCircle == pd )
725 const double range = vmax - vmin;
729 value += std::ceil( ( vmin - value ) / range ) * range;
731 else if ( value > vmax )
733 value -= std::ceil( ( value - vmax ) / range ) * range;
740 else if ( value > vmax )
746 value = qBound( vmin, value, vmax );
759 if (
scaleMap().transformation() == NULL )
762 if ( stepSize > 0.0 )
765 qRound( ( value -
lowerBound() ) / stepSize ) * stepSize;
772 if ( stepSize > 0.0 )
777 qRound( ( v -
scaleMap().p1() ) / stepSize ) * stepSize;
783 if ( qAbs( stepSize ) > 1e-12 )
785 if ( qFuzzyCompare( value + 1.0, 1.0 ) )
795 else if ( qFuzzyCompare( value,
lowerBound() ) )
830 #include "moc_qwt_abstract_slider.cpp"
double invTransform(double p) const
double lowerBound() const
void setScale(double lowerBound, double upperBound)
Specify a scale.
An abstract base class for widgets having a scale.
QList< double > ticks(int tickType) const
double alignedValue(double) const
virtual void sliderChange()
Calling update()
double upperBound() const
virtual void keyPressEvent(QKeyEvent *) QWT_OVERRIDE
void setValue(double value)
void valueChanged(double value)
Notify a change of value.
void setInvertedControls(bool)
virtual void scaleChange() QWT_OVERRIDE
virtual void wheelEvent(QWheelEvent *) QWT_OVERRIDE
void setPageSteps(uint)
Set the number of steps for a page increment.
A class representing a scale division.
double transform(double s) const
void setTracking(bool)
Enables or disables tracking.
const QwtScaleMap & scaleMap() const
void sliderMoved(double value)
bool stepAlignment() const
virtual void mouseReleaseEvent(QMouseEvent *) QWT_OVERRIDE
const QwtTransform * transformation() const
Get the transformation.
void incrementValue(int stepCount)
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
An abstract base class for slider widgets with a scale.
virtual void mousePressEvent(QMouseEvent *) QWT_OVERRIDE
const QwtScaleDiv & scaleDiv() const
void setTotalSteps(uint)
Set the number of steps.
virtual double scrolledTo(const QPoint &pos) const =0
Determine the value for a new position of the movable part of the slider.
void setPaintInterval(double p1, double p2)
Specify the borders of the paint device interval.
double incrementedValue(double value, int stepCount) const
void setStepAlignment(bool)
Enable step alignment.
virtual bool isScrollPosition(const QPoint &pos) const =0
Determine what to do when the user presses a mouse button.
Number of valid tick types.
int transform(double) const
double lowerBound() const
virtual void mouseMoveEvent(QMouseEvent *) QWT_OVERRIDE
void setSingleSteps(uint)
Set the number of steps for a single increment.
double upperBound() const
static double qwtAlignToScaleDiv(const QwtAbstractSlider *slider, double value)
double boundedValue(double) const
QwtAbstractSlider(QWidget *parent=NULL)
Constructor.
virtual ~QwtAbstractSlider()
Destructor.
bool invertedControls() const