Computer Assisted Medical Intervention Tool Kit  version 5.2
camitk::SliderSpinBoxWidget Class Reference

A utility class to have QSpinBox and QSlider synchronized. More...

#include <SliderSpinBoxWidget.h>

+ Inheritance diagram for camitk::SliderSpinBoxWidget:
+ Collaboration diagram for camitk::SliderSpinBoxWidget:

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 ()
 subtract 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 ()
 subtract 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...
 

Detailed Description

A utility class to have QSpinBox and QSlider synchronized.

see for example InteractiveViewer (when it is used as 2D viewer)

Constructor & Destructor Documentation

◆ SliderSpinBoxWidget()

camitk::SliderSpinBoxWidget::SliderSpinBoxWidget ( QWidget *  parent = nullptr)

constructor (have to give the parent widget)

References camitk::setObjectName(), sliderValueChanged(), spinBoxValueChanged(), and valueChanged().

+ Here is the call graph for this function:

◆ ~SliderSpinBoxWidget()

camitk::SliderSpinBoxWidget::~SliderSpinBoxWidget ( )
overridedefault

destructor

Member Function Documentation

◆ addPageStep()

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 camitk::InteractiveViewer::keyPressEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addSingleStep()

void camitk::SliderSpinBoxWidget::addSingleStep ( )

add 1 to the value

References setValue().

Referenced by camitk::InteractiveViewer::keyPressEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSlider()

QSlider* camitk::SliderSpinBoxWidget::getSlider ( )
inline

the QSlider instance

◆ getSpinBox()

QSpinBox* camitk::SliderSpinBoxWidget::getSpinBox ( )
inline

the QSpinBox instance

◆ getValue()

int camitk::SliderSpinBoxWidget::getValue ( ) const

get the current value

Referenced by setValue().

+ Here is the caller graph for this function:

◆ setRange()

void camitk::SliderSpinBoxWidget::setRange ( int  min,
int  max 
)

set the range

Referenced by camitk::InteractiveViewer::refresh().

+ Here is the caller graph for this function:

◆ setValue()

void camitk::SliderSpinBoxWidget::setValue ( int  value)

set the value (force)

References getValue().

Referenced by addPageStep(), addSingleStep(), camitk::InteractiveViewer::refresh(), subPageStep(), and subSingleStep().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sliderValueChanged

void camitk::SliderSpinBoxWidget::sliderValueChanged ( int  value)
protectedslot

any change in the slider value is connected to this slot (update the spinBox)

References valueChanged().

Referenced by SliderSpinBoxWidget().

+ Here is the caller graph for this function:

◆ spinBoxValueChanged

void camitk::SliderSpinBoxWidget::spinBoxValueChanged ( int  value)
protectedslot

any change in the spinBox value is connected to this slot (update the slider)

References valueChanged().

Referenced by SliderSpinBoxWidget().

+ Here is the caller graph for this function:

◆ subPageStep()

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 camitk::InteractiveViewer::keyPressEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ subSingleStep()

void camitk::SliderSpinBoxWidget::subSingleStep ( )

subtract 1 to the value

References setValue().

Referenced by camitk::InteractiveViewer::keyPressEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ valueChanged

void camitk::SliderSpinBoxWidget::valueChanged ( int  )
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 SliderSpinBoxWidget(), sliderValueChanged(), and spinBoxValueChanged().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: