Computer Assited Medical Intervention Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Signals | Public Member Functions | Protected Slots | Private Member Functions | Private Attributes | List of all members
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=0)
 constructor (have to give the parent widget)
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)
void subSingleStep ()
 substract 1 to the value
 ~SliderSpinBoxWidget ()
 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)

Private Member Functions

void updateSliderValue (int)
 update the slider value (block signals)
void updateSpinBoxValue (int)
 update the spinBox value (block signals)

Private Attributes

QSlider * slider
 the QSlider instance
QSpinBox * spinBox
 the QSpinBox instance

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

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

constructor (have to give the parent widget)

References slider, sliderValueChanged(), spinBox, spinBoxValueChanged(), and valueChanged().

camitk::SliderSpinBoxWidget::~SliderSpinBoxWidget ( )

destructor

Member Function Documentation

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

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

the QSlider instance

References slider.

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

the QSpinBox instance

References spinBox.

int camitk::SliderSpinBoxWidget::getValue ( ) const

get the current value

References slider.

Referenced by setValue().

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

set the range

References slider, and spinBox.

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

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

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

References updateSpinBoxValue(), and valueChanged().

Referenced by SliderSpinBoxWidget().

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

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

References updateSliderValue(), and valueChanged().

Referenced by 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().

void camitk::SliderSpinBoxWidget::updateSliderValue ( int  value)
private

update the slider value (block signals)

References slider.

Referenced by setValue(), and spinBoxValueChanged().

void camitk::SliderSpinBoxWidget::updateSpinBoxValue ( int  value)
private

update the spinBox value (block signals)

References spinBox.

Referenced by setValue(), and sliderValueChanged().

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

Member Data Documentation

QSlider* camitk::SliderSpinBoxWidget::slider
private
QSpinBox* camitk::SliderSpinBoxWidget::spinBox
private

the QSpinBox instance

Referenced by getSpinBox(), setRange(), SliderSpinBoxWidget(), and updateSpinBoxValue().


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