Computer Assisted Medical Intervention Tool Kit  version 6.0
Loading...
Searching...
No Matches
camitk::SliderSpinBoxWidget Class Reference

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)

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 sliderValueChanged(), spinBoxValueChanged(), and valueChanged().

◆ ~SliderSpinBoxWidget()

camitk::SliderSpinBoxWidget::~SliderSpinBoxWidget ( )
overridedefault

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 ~SliderSpinBoxWidget().

◆ addSingleStep()

void camitk::SliderSpinBoxWidget::addSingleStep ( )

add 1 to the value

References setValue().

Referenced by ~SliderSpinBoxWidget().

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

◆ setRange()

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

set the range

Referenced by ~SliderSpinBoxWidget().

◆ setValue()

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

set the value (force)

References getValue().

Referenced by addPageStep(), addSingleStep(), subPageStep(), subSingleStep(), and ~SliderSpinBoxWidget().

◆ 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(), and valueChanged().

◆ 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(), and valueChanged().

◆ 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 ~SliderSpinBoxWidget().

◆ subSingleStep()

void camitk::SliderSpinBoxWidget::subSingleStep ( )

subtract 1 to the value

References setValue().

Referenced by ~SliderSpinBoxWidget().

◆ 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.

References sliderValueChanged(), and spinBoxValueChanged().

Referenced by SliderSpinBoxWidget(), sliderValueChanged(), and spinBoxValueChanged().


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