A utility class to have QSpinBox and QSlider synchronized. More...
#include <SliderSpinBoxWidget.h>
Signals | |
| void | valueChanged (int) |
| if the user change the value either in the slider or the spinBox, this signal is emitted with the new value as parameter. | |
Public Member Functions | |
| void | addPageStep () |
| add a larger number of natural steps to the value, for information exact number of added step is min(1,(max-min)/10) | |
| void | addSingleStep () |
| add 1 to the value | |
| QSlider * | getSlider () |
| the QSlider instance | |
| QSpinBox * | getSpinBox () |
| the QSpinBox instance | |
| int | getValue () const |
| get the current value | |
| void | setRange (int min, int max) |
| set the range | |
| void | setValue (int value) |
| set the value (force) | |
| SliderSpinBoxWidget (QWidget *parent=nullptr) | |
| constructor (have to give the parent widget) | |
| void | subPageStep () |
| subtract a larger number of natural steps to the value, for information exact number of added step is min(1,(max-min)/10) | |
| void | subSingleStep () |
| subtract 1 to the value | |
| ~SliderSpinBoxWidget () override=default | |
| destructor | |
Protected Slots | |
| void | sliderValueChanged (int) |
| any change in the slider value is connected to this slot (update the spinBox) | |
| void | spinBoxValueChanged (int) |
| any change in the spinBox value is connected to this slot (update the slider) | |
A utility class to have QSpinBox and QSlider synchronized.
see for example InteractiveViewer (when it is used as 2D viewer)
| camitk::SliderSpinBoxWidget::SliderSpinBoxWidget | ( | QWidget * | parent = nullptr | ) |
constructor (have to give the parent widget)
References sliderValueChanged(), spinBoxValueChanged(), and valueChanged().
|
overridedefault |
destructor
References addPageStep(), addSingleStep(), setRange(), setValue(), subPageStep(), and subSingleStep().
| void camitk::SliderSpinBoxWidget::addPageStep | ( | ) |
add a larger number of natural steps to the value, for information exact number of added step is min(1,(max-min)/10)
References setValue().
Referenced by ~SliderSpinBoxWidget().
| void camitk::SliderSpinBoxWidget::addSingleStep | ( | ) |
|
inline |
the QSlider instance
|
inline |
the QSpinBox instance
| int camitk::SliderSpinBoxWidget::getValue | ( | ) | const |
get the current value
Referenced by setValue().
| void camitk::SliderSpinBoxWidget::setRange | ( | int | min, |
| int | max ) |
set the range
Referenced by ~SliderSpinBoxWidget().
| void camitk::SliderSpinBoxWidget::setValue | ( | int | value | ) |
set the value (force)
References getValue().
Referenced by addPageStep(), addSingleStep(), subPageStep(), subSingleStep(), and ~SliderSpinBoxWidget().
|
protectedslot |
any change in the slider value is connected to this slot (update the spinBox)
References valueChanged().
Referenced by SliderSpinBoxWidget(), and valueChanged().
|
protectedslot |
any change in the spinBox value is connected to this slot (update the slider)
References valueChanged().
Referenced by SliderSpinBoxWidget(), and valueChanged().
| void camitk::SliderSpinBoxWidget::subPageStep | ( | ) |
subtract a larger number of natural steps to the value, for information exact number of added step is min(1,(max-min)/10)
References setValue().
Referenced by ~SliderSpinBoxWidget().
| void camitk::SliderSpinBoxWidget::subSingleStep | ( | ) |
|
signal |
if the user change the value either in the slider or the spinBox, this signal is emitted with the new value as parameter.
References sliderValueChanged(), and spinBoxValueChanged().
Referenced by SliderSpinBoxWidget(), sliderValueChanged(), and spinBoxValueChanged().