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"
void setScale(double lowerBound, double upperBound)
Specify a scale.
bool stepAlignment() const
enum MQTTPropertyCodes value
An abstract base class for widgets having a scale.
double incrementedValue(double value, int stepCount) const
int transform(double) const
virtual void sliderChange()
Calling update()
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
const QwtScaleMap & scaleMap() const
virtual void wheelEvent(QWheelEvent *) QWT_OVERRIDE
void setPageSteps(uint)
Set the number of steps for a page increment.
A class representing a scale division.
void setTracking(bool)
Enables or disables tracking.
void sliderMoved(double value)
double upperBound() const
virtual void mouseReleaseEvent(QMouseEvent *) QWT_OVERRIDE
void incrementValue(int stepCount)
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.
double lowerBound() const
void setPaintInterval(double p1, double p2)
Specify the borders of the paint device interval.
bool invertedControls() const
void setStepAlignment(bool)
Enable step alignment.
const QwtTransform * transformation() const
Get the transformation.
double invTransform(double p) const
double alignedValue(double) const
virtual bool isScrollPosition(const QPoint &pos) const =0
Determine what to do when the user presses a mouse button.
Number of valid tick types.
virtual void mouseMoveEvent(QMouseEvent *) QWT_OVERRIDE
double lowerBound() const
double boundedValue(double) const
double transform(double s) const
void setSingleSteps(uint)
Set the number of steps for a single increment.
double upperBound() const
static double qwtAlignToScaleDiv(const QwtAbstractSlider *slider, double value)
QList< double > ticks(int tickType) const
QwtAbstractSlider(QWidget *parent=NULL)
Constructor.
virtual ~QwtAbstractSlider()
Destructor.