This class is useful as a base class or a member for sliders. It represents an interval of type double within which a value can be moved. The value can be either an arbitrary point inside the interval (see QwtDoubleRange::setValue), or it can be fitted into a step raster (see QwtDoubleRange::fitValue and QwtDoubleRange::incValue).
As a special case, a QwtDoubleRange can be periodic, which means that a value outside the interval will be mapped to a value inside the interval when QwtDoubleRange::setValue(), QwtDoubleRange::fitValue(), QwtDoubleRange::incValue() or QwtDoubleRange::incPages() are called.
Definition at line 31 of file qwt_double_range.h.
Public Member Functions | |
QwtDoubleRange () | |
virtual | ~QwtDoubleRange () |
void | setRange (double vmin, double vmax, double vstep=0.0, int pagesize=1) |
void | setValid (bool) |
bool | isValid () const |
virtual void | setValue (double) |
double | value () const |
void | setPeriodic (bool tf) |
bool | periodic () const |
void | setStep (double) |
double | step () const |
double | maxValue () const |
double | minValue () const |
int | pageSize () const |
virtual void | incValue (int) |
virtual void | incPages (int) |
virtual void | fitValue (double) |
Protected Member Functions | |
double | exactValue () const |
double | exactPrevValue () const |
double | prevValue () const |
virtual void | valueChange () |
virtual void | stepChange () |
virtual void | rangeChange () |
|
The range is initialized to [0.0, 100.0], the step size to 1.0, and the value to 0.0. Definition at line 21 of file qwt_double_range.cpp. |
|
Destroys the QwtDoubleRange.
Definition at line 36 of file qwt_double_range.cpp. |
|
Returns the exact previous value.
Definition at line 380 of file qwt_double_range.cpp. Referenced by QwtAbstractSlider::mouseMoveEvent(). |
|
Returns the exact value. The exact value is the value which QwtDoubleRange::value would return if the value were not adjusted to the step raster. It differs from the current value only if QwtDoubleRange::fitValue or QwtDoubleRange::incValue have been used before. This function is intended for internal use in derived classes. Definition at line 374 of file qwt_double_range.cpp. Referenced by QwtAbstractSlider::mouseMoveEvent(), and QwtAbstractSlider::timerEvent(). |
|
Adjust the value to the closest point in the step raster.
Reimplemented in QwtAbstractSlider. Definition at line 132 of file qwt_double_range.cpp. Referenced by QwtAbstractSlider::fitValue(), QwtAbstractSlider::mouseReleaseEvent(), QwtAbstractSlider::setPosition(), and QwtAbstractSlider::timerEvent(). |
|
Increment the value by a specified number of pages.
Definition at line 271 of file qwt_double_range.cpp. References isValid(). Referenced by QwtAbstractSlider::mouseReleaseEvent(), QwtAbstractSlider::timerEvent(), and QwtAbstractSlider::wheelEvent(). |
|
Increment the value by a specified number of steps.
Reimplemented in QwtAbstractSlider. Definition at line 259 of file qwt_double_range.cpp. References isValid(). Referenced by QwtAbstractSlider::incValue(), QwtDial::keyPressEvent(), and QwtCounter::keyPressEvent(). |
|
Indicates if the value is valid.
Reimplemented in QwtAbstractSlider. Definition at line 51 of file qwt_double_range.cpp. Referenced by incPages(), incValue(), and QwtAbstractSlider::isValid(). |
|
Returns the value of the second border of the range. maxValue returns the value which has been specified as the second parameter in QwtDoubleRange::setRange.
Definition at line 326 of file qwt_double_range.cpp. Referenced by QwtDial::drawContents(), QwtWheel::drawWheel(), QwtWheel::getValue(), QwtDial::getValue(), QwtDial::keyPressEvent(), QwtCounter::keyPressEvent(), QwtCounter::maxVal(), QwtSlider::rangeChange(), QwtCounter::setMinValue(), QwtCounter::sizeHint(), and QwtDial::updateScale(). |
|
Returns the value at the first border of the range. minValue returns the value which has been specified as the first parameter in setRange().
Definition at line 339 of file qwt_double_range.cpp. Referenced by QwtDial::drawContents(), QwtWheel::drawWheel(), QwtWheel::getValue(), QwtDial::getValue(), QwtDial::keyPressEvent(), QwtCounter::keyPressEvent(), QwtCounter::minVal(), QwtSlider::rangeChange(), QwtCounter::setMaxValue(), QwtCounter::sizeHint(), and QwtDial::updateScale(). |
|
Returns the page size in steps.
Definition at line 354 of file qwt_double_range.cpp. Referenced by QwtDial::keyPressEvent(). |
|
Returns true if the range is periodic.
Definition at line 348 of file qwt_double_range.cpp. Referenced by QwtDial::wrapping(). |
|
Returns the previous value.
Definition at line 386 of file qwt_double_range.cpp. Referenced by QwtDial::keyPressEvent(), QwtAbstractSlider::mouseMoveEvent(), and QwtAbstractSlider::wheelEvent(). |
|
Notify a change of the range. This virtual function is called whenever the range changes. The default implementation does nothing. Reimplemented in QwtCounter, QwtDial, and QwtSlider. Definition at line 294 of file qwt_double_range.cpp. Referenced by QwtSlider::rangeChange(), and setRange(). |
|
Make the range periodic. When the range is periodic, the value will be set to a point inside the interval such that
point = value + n * width if the user tries to set a new value which is outside the range. If the range is nonperiodic (the default), values outside the range will be clipped.
Definition at line 248 of file qwt_double_range.cpp. Referenced by QwtDial::setWrapping(). |
|
Specify range and step size.
Definition at line 169 of file qwt_double_range.cpp. References rangeChange(), and setStep(). Referenced by QwtCounter::setMaxValue(), and QwtCounter::setMinValue(). |
|
Change the step raster.
Reimplemented in QwtCounter. Definition at line 208 of file qwt_double_range.cpp. References stepChange(). Referenced by setRange(), and QwtCounter::setStep(). |
|
Set the value to be valid/invalid.
Reimplemented in QwtAbstractSlider. Definition at line 41 of file qwt_double_range.cpp. References valueChange(). Referenced by QwtAbstractSlider::setValid(). |
|
Set a new value without adjusting to the step raster.
Reimplemented in QwtAbstractSlider, and QwtCounter. Definition at line 147 of file qwt_double_range.cpp. Referenced by QwtCounter::setValue(), and QwtAbstractSlider::setValue(). |
|
Reimplemented in QwtCounter. Definition at line 313 of file qwt_double_range.cpp. Referenced by QwtAbstractSlider::mouseReleaseEvent(), QwtCounter::step(), and QwtAbstractSlider::timerEvent(). |
|
Notify a change of the step size. This virtual function is called whenever the step size changes. The default implementation does nothing. Definition at line 305 of file qwt_double_range.cpp. Referenced by setStep(). |
|
Returns the current value.
Reimplemented in QwtCounter. Definition at line 360 of file qwt_double_range.cpp. Referenced by QwtDial::drawContents(), QwtAnalogClock::drawNeedle(), QwtCompass::drawScaleContents(), QwtSlider::drawSlider(), QwtWheel::drawWheel(), QwtDial::getValue(), QwtAbstractSlider::mouseMoveEvent(), QwtAbstractSlider::mousePressEvent(), QwtAbstractSlider::mouseReleaseEvent(), QwtAbstractSlider::timerEvent(), QwtCounter::value(), QwtAbstractSlider::valueChange(), and QwtAbstractSlider::wheelEvent(). |
|
Notify a change of value. This virtual function is called whenever the value changes. The default implementation does nothing. Reimplemented in QwtAbstractSlider, QwtDial, QwtSlider, and QwtWheel. Definition at line 283 of file qwt_double_range.cpp. Referenced by setValid(). |