![]() |
ImFusion SDK 4.3
|
#include <ImFusion/GUI/CoreWidgets/AdjusterWidget.h>
Base class for widgets providing two ways of adjusting numeric values. More...
Base class for widgets providing two ways of adjusting numeric values.
AbstractAdjusterWidget consists of a slider, which can be used to quickly change numeric values, and a spin box, which is better suited for precise adjustments. Slider and spin box can have different value ranges, which may be helpful for certain applications.
Public Member Functions | |
AdjusterWidgetBase (QWidget *parent=nullptr) | |
Creates a new AbstractAdjusterWidget. | |
T | value () const |
Return the adjuster's current value. | |
void | setValue (T value) |
Change the adjuster's current value. | |
T | minimum () const |
Return the adjuster's spin box minimum value. | |
void | setMinimum (T minimum) |
Change both the adjuster's spin box and slider minimum value. | |
T | maximum () const |
Return the adjuster's spin box maximum value. | |
void | setMaximum (T maximum) |
Change both the adjuster's spin box and slider maximum value. | |
T | sliderMinimum () const |
Return the adjuster's slider minimum value. | |
void | setSliderMinimum (T minimum) |
Change the adjuster's slider minimum value. | |
T | sliderMaximum () const |
Return the adjuster's slider maximum value. | |
void | setSliderMaximum (T maximum) |
Change the adjuster's slider maximum value. | |
void | setRightToLeft (bool righToLeft) |
Change the adjuster's slider to go from right-to-left, instead of left-to-right. | |
T | spinboxMinimum () const |
Return the adjuster's spin box minimum value. | |
void | setSpinboxMinimum (T minimum) |
Change the adjuster's spin box minimum value. | |
T | spinboxMaximum () const |
Return the adjuster's spin box maximum value. | |
void | setSpinboxMaximum (T maximum) |
Change the adjuster's spin box maximum value. | |
T | singleStep () const |
Return the adjuster's single step value. | |
void | setSingleStep (T value) |
Change the adjuster's single step value. | |
virtual bool | blockSignals (bool value) |
Sets Qt's blockSignals setting of both the slider and the spin box. | |
AdjusterWidgetTraits< T >::SpinBoxType * | spinBox () |
Returns the pointer to the spin box that is used internally. | |
Protected Member Functions | |
void | onSpinBoxValueChangedImpl (T value) |
Slot getting called when the spin box's value changes. | |
T | onSliderValueChangedImpl (T value) |
Slot getting called when the slider's value changes. | |
virtual void | setSliderValue (T value) |
Virtual method to update the slider's value. To be overridden in sub classes. | |
virtual void | setSliderProperties (T stepValue, T minValue, T maxValue) |
Update the slider's properties based on the provided step, minimum, and maximum value of the adjuster. | |
|
explicit |
Creates a new AbstractAdjusterWidget.
parent | parent Qt widget |
void setValue | ( | T | value | ) |
Change the adjuster's current value.
value | new value for the adjuster |
void setMinimum | ( | T | minimum | ) |
Change both the adjuster's spin box and slider minimum value.
minimum | new minimum value for the adjuster |
void setMaximum | ( | T | maximum | ) |
Change both the adjuster's spin box and slider maximum value.
maximum | new maximum value for the adjuster |
void setSliderMinimum | ( | T | minimum | ) |
Change the adjuster's slider minimum value.
minimum | new minimum value for the adjuster |
void setSliderMaximum | ( | T | maximum | ) |
Change the adjuster's slider maximum value.
maximum | new maximum value for the adjuster |
void setSpinboxMinimum | ( | T | minimum | ) |
Change the adjuster's spin box minimum value.
minimum | new minimum value for the adjuster |
void setSpinboxMaximum | ( | T | maximum | ) |
Change the adjuster's spin box maximum value.
maximum | new maximum value for the adjuster |
void setSingleStep | ( | T | value | ) |
Change the adjuster's single step value.
value | new single step value for the adjuster |
|
protected |
Slot getting called when the slider's value changes.
It should adjust the vale to the slider's range and the widgets singleStep() and return the adjusted value.
|
protectedvirtual |
Update the slider's properties based on the provided step, minimum, and maximum value of the adjuster.
stepValue | the adjuster's step value |
minValue | the adjuster's minimum value |
maxValue | the adjuster's maximum value |