ImFusion SDK 4.3
AdjusterWidgetBase< T > Class Template Reference

#include <ImFusion/GUI/CoreWidgets/AdjusterWidget.h>

Base class for widgets providing two ways of adjusting numeric values. More...

+ Inheritance diagram for AdjusterWidgetBase< T >:

Detailed Description

template<typename T>
class ImFusion::AdjusterWidgetBase< T >

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.
 
value () const
 Return the adjuster's current value.
 
void setValue (T value)
 Change the adjuster's current value.
 
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.
 
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.
 
sliderMinimum () const
 Return the adjuster's slider minimum value.
 
void setSliderMinimum (T minimum)
 Change the adjuster's slider minimum value.
 
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.
 
spinboxMinimum () const
 Return the adjuster's spin box minimum value.
 
void setSpinboxMinimum (T minimum)
 Change the adjuster's spin box minimum value.
 
spinboxMaximum () const
 Return the adjuster's spin box maximum value.
 
void setSpinboxMaximum (T maximum)
 Change the adjuster's spin box maximum value.
 
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.
 
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.
 

Protected Attributes

QSlider * m_slider
 Slider allowing the user to quickly change the value.
 
AdjusterWidgetTraits< T >::SpinBoxType * m_spinBox
 Spin box displaying the current value.
 
m_sliderMin
 Minimum value used for the slider.
 
m_sliderMax
 Maximum value used for the slider.
 

Constructor & Destructor Documentation

◆ AdjusterWidgetBase()

template<typename T>
AdjusterWidgetBase ( QWidget * parent = nullptr)
explicit

Creates a new AbstractAdjusterWidget.

Parameters
parentparent Qt widget

Member Function Documentation

◆ setValue()

template<typename T>
void setValue ( T value)

Change the adjuster's current value.

Parameters
valuenew value for the adjuster

◆ setMinimum()

template<typename T>
void setMinimum ( T minimum)

Change both the adjuster's spin box and slider minimum value.

Parameters
minimumnew minimum value for the adjuster

◆ setMaximum()

template<typename T>
void setMaximum ( T maximum)

Change both the adjuster's spin box and slider maximum value.

Parameters
maximumnew maximum value for the adjuster

◆ setSliderMinimum()

template<typename T>
void setSliderMinimum ( T minimum)

Change the adjuster's slider minimum value.

Parameters
minimumnew minimum value for the adjuster

◆ setSliderMaximum()

template<typename T>
void setSliderMaximum ( T maximum)

Change the adjuster's slider maximum value.

Parameters
maximumnew maximum value for the adjuster

◆ setSpinboxMinimum()

template<typename T>
void setSpinboxMinimum ( T minimum)

Change the adjuster's spin box minimum value.

Parameters
minimumnew minimum value for the adjuster

◆ setSpinboxMaximum()

template<typename T>
void setSpinboxMaximum ( T maximum)

Change the adjuster's spin box maximum value.

Parameters
maximumnew maximum value for the adjuster

◆ setSingleStep()

template<typename T>
void setSingleStep ( T value)

Change the adjuster's single step value.

Parameters
valuenew single step value for the adjuster

◆ onSliderValueChangedImpl()

template<typename T>
T onSliderValueChangedImpl ( T value)
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.

◆ setSliderProperties()

template<typename T>
void setSliderProperties ( T stepValue,
T minValue,
T maxValue )
protectedvirtual

Update the slider's properties based on the provided step, minimum, and maximum value of the adjuster.

Parameters
stepValuethe adjuster's step value
minValuethe adjuster's minimum value
maxValuethe adjuster's maximum value

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close