16 #if QT_VERSION < 0x040601 17 #define qFabs(x) ::fabs(x) 25 const int tValue = slider->
transform( value );
35 const QList<double> ticks = sd.
ticks(
i );
36 for (
int j = 0; j < ticks.size(); j++ )
38 if ( slider->
transform( ticks[ j ] ) == tValue )
100 setFocusPolicy( Qt::StrongFocus );
149 setFocusPolicy( on ? Qt::StrongFocus : Qt::NoFocus );
312 if ( ( event->modifiers() & Qt::ControlModifier) ||
313 ( event->modifiers() & Qt::ShiftModifier ) )
317 if ( event->delta() < 0 )
318 numSteps = -numSteps;
322 const int numTurns = (
event->delta() / 120 );
327 numSteps = -numSteps;
379 switch ( event->key() )
385 numSteps = -numSteps;
393 numSteps = -numSteps;
401 numSteps = -numSteps;
408 numSteps = -numSteps;
416 numSteps = -numSteps;
419 case Qt::Key_PageDown:
423 numSteps = -numSteps;
666 double value,
int stepCount )
const 674 if ( transformation == NULL )
691 double v = transformation->
transform( value );
693 v = qRound( v / stepSize ) * stepSize;
714 const int fullCircle = 360 * 16;
717 if (
int( pd / fullCircle ) * fullCircle == pd )
720 const double range = vmax - vmin;
724 value += ::ceil( ( vmin - value ) / range ) * range;
726 else if ( value > vmax )
728 value -= ::ceil( ( value - vmax ) / range ) * range;
735 else if ( value > vmax )
741 value = qBound( vmin, value, vmax );
754 if (
scaleMap().transformation() == NULL )
757 if ( stepSize > 0.0 )
760 qRound( ( value -
lowerBound() ) / stepSize ) * stepSize;
767 if ( stepSize > 0.0 )
772 qRound( ( v -
scaleMap().p1() ) / stepSize ) * stepSize;
778 if ( qAbs( stepSize ) > 1e-12 )
780 if ( qFuzzyCompare( value + 1.0, 1.0 ) )
790 else if ( qFuzzyCompare( value,
lowerBound() ) )
void setScale(double lowerBound, double upperBound)
Specify a scale.
bool stepAlignment() const
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()
void setValue(double val)
void valueChanged(double value)
Notify a change of value.
void setInvertedControls(bool)
const QwtScaleMap & scaleMap() const
virtual void wheelEvent(QWheelEvent *)
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.
virtual void scaleChange()
void sliderMoved(double value)
double upperBound() const
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
An abstract base class for slider widgets with a scale.
virtual void keyPressEvent(QKeyEvent *)
virtual void mouseMoveEvent(QMouseEvent *)
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.
double lowerBound() const
double boundedValue(double) const
virtual void mouseReleaseEvent(QMouseEvent *)
void incrementValue(int numSteps)
virtual void mousePressEvent(QMouseEvent *)
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.