Computer Assited Medical Intervention Tool Kit
version 4.1
|
A utility class to have QSpinBox and QSlider synchronized. More...
#include <SliderSpinBoxWidget.h>
Inherits QWidget.
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. More... | |
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) More... | |
void | addSingleStep () |
add 1 to the value More... | |
QSlider * | getSlider () |
the QSlider instance More... | |
QSpinBox * | getSpinBox () |
the QSpinBox instance More... | |
int | getValue () const |
get the current value More... | |
void | setRange (int min, int max) |
set the range More... | |
void | setValue (int value) |
set the value (force) More... | |
SliderSpinBoxWidget (QWidget *parent=nullptr) | |
constructor (have to give the parent widget) More... | |
void | subPageStep () |
substract a larger number of natural steps to the value, for information exact number of added step is min(1,(max-min)/10) More... | |
void | subSingleStep () |
substract 1 to the value More... | |
~SliderSpinBoxWidget () override=default | |
destructor More... | |
Protected Slots | |
void | sliderValueChanged (int) |
any change in the slider value is connected to this slot (update the spinBox) More... | |
void | spinBoxValueChanged (int) |
any change in the spinBox value is connected to this slot (update the slider) More... | |
Private Member Functions | |
void | updateSliderValue (int) |
update the slider value (block signals) More... | |
void | updateSpinBoxValue (int) |
update the spinBox value (block signals) More... | |
Private Attributes | |
QSlider * | slider |
the QSlider instance More... | |
QSpinBox * | spinBox |
the QSpinBox instance More... | |
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 slider, sliderValueChanged(), spinBox, spinBoxValueChanged(), and valueChanged().
|
overridedefault |
destructor
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(), and slider.
Referenced by camitk::InteractiveViewer::keyPressEvent().
void camitk::SliderSpinBoxWidget::addSingleStep | ( | ) |
add 1 to the value
References setValue(), and slider.
Referenced by camitk::InteractiveViewer::keyPressEvent().
|
inline |
the QSlider instance
References slider, sliderValueChanged(), spinBoxValueChanged(), and valueChanged().
|
inline |
the QSpinBox instance
References spinBox.
int camitk::SliderSpinBoxWidget::getValue | ( | ) | const |
void camitk::SliderSpinBoxWidget::setRange | ( | int | min, |
int | max | ||
) |
void camitk::SliderSpinBoxWidget::setValue | ( | int | value | ) |
set the value (force)
References getValue(), updateSliderValue(), and updateSpinBoxValue().
Referenced by addPageStep(), addSingleStep(), camitk::InteractiveViewer::refresh(), subPageStep(), and subSingleStep().
|
protectedslot |
any change in the slider value is connected to this slot (update the spinBox)
References updateSpinBoxValue(), and valueChanged().
Referenced by getSlider(), and SliderSpinBoxWidget().
|
protectedslot |
any change in the spinBox value is connected to this slot (update the slider)
References updateSliderValue(), and valueChanged().
Referenced by getSlider(), and SliderSpinBoxWidget().
void camitk::SliderSpinBoxWidget::subPageStep | ( | ) |
substract a larger number of natural steps to the value, for information exact number of added step is min(1,(max-min)/10)
References setValue(), and slider.
Referenced by camitk::InteractiveViewer::keyPressEvent().
void camitk::SliderSpinBoxWidget::subSingleStep | ( | ) |
substract 1 to the value
References setValue(), and slider.
Referenced by camitk::InteractiveViewer::keyPressEvent().
|
private |
update the slider value (block signals)
References slider.
Referenced by setValue(), and spinBoxValueChanged().
|
private |
update the spinBox value (block signals)
References spinBox.
Referenced by setValue(), and sliderValueChanged().
|
signal |
if the user change the value either in the slider or the spinBox, this signal is emitted with the new value as parameter.
Referenced by getSlider(), SliderSpinBoxWidget(), sliderValueChanged(), and spinBoxValueChanged().
|
private |
the QSlider instance
Referenced by addPageStep(), addSingleStep(), getSlider(), getValue(), setRange(), SliderSpinBoxWidget(), subPageStep(), subSingleStep(), and updateSliderValue().
|
private |
the QSpinBox instance
Referenced by getSpinBox(), setRange(), SliderSpinBoxWidget(), and updateSpinBoxValue().