QwtDoubleRange(3)

πŸ“¦ version 5.2.3a, in epel 9, fedora 43, fedora 44

πŸ’– QwtDoubleRange πŸ’–

okay so bestie, welcome to the Qwt User's Guide β€” that's the manual this page lives in β€” and today's main character is QwtDoubleRange. sit down, get comfy, we're doing inheritance and step rasters and it's gonna be adorable. πŸŽ€


πŸ“› NAME πŸ“›

QwtDoubleRange β€” and the description? literally nothing. the original page just has a lonely little dash hanging there with no words after it. iconic behavior honestly. the vibe is mysterious. πŸ’€


✨ SYNOPSIS ✨

#include <qwt_double_range.h>

Inherited by QwtAbstractSlider, and QwtCounter. (so if you're reading this because one of those two sent you here β€” hi, you're in the right place 🫢)

🌈 Public Member Functions 🌈

  • QwtDoubleRange ()
  • virtual ~QwtDoubleRange ()
  • virtual void fitValue (double)
  • virtual void incPages (int)
  • virtual void incValue (int)
  • bool isValid () const
  • double maxValue () const
  • double minValue () const
  • int pageSize () const
  • bool periodic () const
  • void setPeriodic (bool tf)
  • void setRange (double vmin, double vmax, double vstep=0.0, int pagesize=1)
  • void setStep (double)
  • void setValid (bool)
  • virtual void setValue (double)
  • double step () const
  • double value () const

πŸ¦‹ Protected Member Functions πŸ¦‹

  • double exactPrevValue () const
  • double exactValue () const
  • double prevValue () const
  • virtual void rangeChange ()
  • virtual void stepChange ()
  • virtual void valueChange ()

🌸 Detailed Description 🌸

so what is this thing? it's a class which controls a value within an interval. periodt.

it's useful as a base class, or as a member, for sliders. it represents an interval of type double within which a value can be moved. and the value can be one of two flavors:

  • an arbitrary point inside the interval β€” see QwtDoubleRange::setValue
  • OR fitted into a step raster β€” see QwtDoubleRange::fitValue and QwtDoubleRange::incValue

and then there's the special case, the plot twist: a QwtDoubleRange can be periodic. what that means is a value outside the interval gets mapped to a value inside the interval whenever QwtDoubleRange::setValue(), QwtDoubleRange::fitValue(), QwtDoubleRange::incValue() or QwtDoubleRange::incPages() get called. it just cannot stay outside. it always comes home. 😭


πŸŽ€ Constructor & Destructor Documentation πŸŽ€

QwtDoubleRange::QwtDoubleRange ()

fresh out of the box, the range is initialized to [0.0, 100.0], the step size is 1.0, and the value is 0.0. baby's first defaults, she's perfect. ✨


πŸ’… Member Function Documentation πŸ’…

double QwtDoubleRange::exactValue () const [protected]

returns the exact value. and what even is that? it's the value which QwtDoubleRange::value would have returned if the value hadn't been adjusted to the step raster. so it only differs from the current value if QwtDoubleRange::fitValue or QwtDoubleRange::incValue have been used before β€” otherwise they're the same girl.

this one is for internal use in derived classes, so it's not for everyone. iykyk. 🀫

void QwtDoubleRange::fitValue (double x) [virtual]

adjusts the value to the closest point in the step raster. snapping into place, no cap.

Parameters:

  • x β€” value
⚠️ Warning: the value is clipped when it lies outside the range. but when the range is QwtDoubleRange::periodic, it will be mapped to a point in the interval such that
new value := x + n * (max. value - min. value)
with an integer number n.

Reimplemented in QwtAbstractSlider.

void QwtDoubleRange::incPages (int nPages) [virtual]

increments the value by a specified number of pages. like flipping pages in a book but the book is a slider. πŸ“–

Parameters:

  • nPages β€” Number of pages to increment. A negative number decrements the value.
⚠️ Warning: the page size is specified in the constructor. so if you're looking for it here… it's not here, bestie. it's over there. πŸ‘€

void QwtDoubleRange::incValue (int nSteps) [virtual]

increments the value by a specified number of steps. 🦢

Parameters:

  • nSteps β€” Number of steps to increment
⚠️ Warning: as a result of this operation, the new value will always be adjusted to the step raster. no exceptions, she's committed.

Reimplemented in QwtAbstractSlider.

double QwtDoubleRange::maxValue () const

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.

See also: setRange()

double QwtDoubleRange::minValue () const

returns the value at the first border of the range. minValue returns the value which has been specified as the first parameter in setRange().

See also: setRange()

bool QwtDoubleRange::periodic () const

returns true if the range is periodic. that's it, that's the function. simple queen. πŸ‘‘

See also: setPeriodic()

void QwtDoubleRange::rangeChange () [protected], [virtual]

notify a change of the range. this virtual function gets called whenever the range changes. and the default implementation? does absolutely nothing. silent. unbothered. πŸ’…

Reimplemented in QwtDial, QwtCounter, and QwtSlider.

void QwtDoubleRange::setPeriodic (bool tf)

makes 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 .fi

if the user tries to set a new value which is outside the range. (yes the .fi is really in there, it's a whole Doxygen artifact, we don't question it, we respect it πŸ™ˆ)

if the range is nonperiodic (which is the default), values outside the range will be clipped instead. no mapping, no math, just βœ‚οΈ.

Parameters:

  • tf β€” true for a periodic range

void QwtDoubleRange::setRange (double vmin, double vmax, double vstep = 0.0, int pageSize = 1)

specify range and step size. the glow-up setup call. ✨

Parameters:

  • vmin β€” lower boundary of the interval
  • vmax β€” higher boundary of the interval
  • vstep β€” step width
  • pageSize β€” page size in steps
⚠️ Warning: - A change of the range changes the value if it lies outside the new range. The current value will not be adjusted to the new step raster. - vmax < vmin is allowed. - If the step size is left out or set to zero, it will be set to 1/100 of the interval length. - If the step size has an absurd value, it will be corrected to a better one. (the class is doing a vibe check on your step size and fixing it for you 🫢)

void QwtDoubleRange::setStep (double vstep)

change the step raster.

Parameters:

  • vstep β€” new step width
⚠️ Warning: the value will not be adjusted to the new step raster. she's staying exactly where she is, thank you.

Reimplemented in QwtCounter.

void QwtDoubleRange::setValue (double x) [virtual]

sets a new value without adjusting to the step raster. free-spirited. ungovernable. πŸ¦‹

Parameters:

  • x β€” new value
⚠️ Warning: the value is clipped when it lies outside the range. when the range is QwtDoubleRange::periodic, it will be mapped to a point in the interval such that
new value := x + n * (max. value - min. value)
with an integer number n.

Reimplemented in QwtCounter, and QwtAbstractSlider.

double QwtDoubleRange::step () const

Returns:

  • the step size

See also: setStep(), setRange()

Reimplemented in QwtCounter.

void QwtDoubleRange::stepChange () [protected], [virtual]

notify a change of the step size. this virtual function gets called whenever the step size changes. default implementation? nothing. nada. silence, but make it chic. 🀐

void QwtDoubleRange::valueChange () [protected], [virtual]

notify a change of value. this virtual function gets called whenever the value changes. default implementation does nothing, again. consistent icon.

Reimplemented in QwtDial, QwtAbstractSlider, QwtSlider, and QwtWheel.


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for Qwt User's Guide from the source code. yes bestie, a robot wrote this about a robot-adjacent thing. we love a full circle moment. πŸŽ€


and that's the whole page!! mwah. 😘 this was Version 5.2.3, dated Tue Nov 20 2012 β€” so yes, she's a vintage queen and she still slays. go adjust some step rasters, you got this. πŸ’–βœ¨πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from