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

This widget allows you to use a slider with a lineedit in a Dialog Box. More...

#include <SliderTextWidget.h>

+ Inheritance diagram for camitk::SliderTextWidget:
+ Collaboration diagram for camitk::SliderTextWidget:

Signals

void valueChanged ()
 Signal emitted when the value has changed (either directly using the slider or when the user pressed return) More...
 

Public Member Functions

double getValue () const
 Get the current value. More...
 
void init (double min=0.0, double max=100.0, double value=50.0)
 initialize slider and lineedit with the label, min, max, and current value Default values are min=0, max=100 and current value=50 More...
 
void setName (const QString &)
 set the text label (name of the manipulated data) More...
 
void setValue (const double, bool emitValueChanged=false)
 Update slider and lineedit GUI, emit the valueChanged signal only if the boolean is true (default=no) More...
 
 SliderTextWidget (QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags())
 Default constructor, name is automatically used as the text label. More...
 
 ~SliderTextWidget () override
 Destructor. More...
 

Protected Slots

void returnPressed ()
 when the user press return in the line edit More...
 
void textModified (QString)
 When the user change the text. More...
 
void valueChanged (int)
 Update the value of the lineedit when slider moves. More...
 

Detailed Description

This widget allows you to use a slider with a lineedit in a Dialog Box.

The [min,max] interval is divided by 100 line steps (10 page steps), the slider controling the variation in percentage.

1 label is used to give the parameter a name (default is objectName())

Your own initialization: in YourDialog class,you can init a SliderTextWidget using setText(..) and init(..).

In line edit, if the value is superior or inferior than the initial bounds, the bounds are automatically updated.

Constructor & Destructor Documentation

◆ SliderTextWidget()

camitk::SliderTextWidget::SliderTextWidget ( QWidget *  parent = nullptr,
Qt::WindowFlags  fl = Qt::WindowFlags() 
)

Default constructor, name is automatically used as the text label.

References returnPressed(), setName(), textModified(), and valueChanged().

+ Here is the call graph for this function:

◆ ~SliderTextWidget()

camitk::SliderTextWidget::~SliderTextWidget ( )
override

Destructor.

Member Function Documentation

◆ getValue()

double camitk::SliderTextWidget::getValue ( ) const
inline

Get the current value.

◆ init()

void camitk::SliderTextWidget::init ( double  min = 0.0,
double  max = 100.0,
double  value = 50.0 
)

initialize slider and lineedit with the label, min, max, and current value Default values are min=0, max=100 and current value=50

◆ returnPressed

void camitk::SliderTextWidget::returnPressed ( )
protectedslot

when the user press return in the line edit

References valueChanged().

Referenced by SliderTextWidget().

+ Here is the caller graph for this function:

◆ setName()

void camitk::SliderTextWidget::setName ( const QString &  name)

set the text label (name of the manipulated data)

Referenced by SliderTextWidget().

+ Here is the caller graph for this function:

◆ setValue()

void camitk::SliderTextWidget::setValue ( const double  val,
bool  emitValueChanged = false 
)

Update slider and lineedit GUI, emit the valueChanged signal only if the boolean is true (default=no)

References valueChanged().

◆ textModified

void camitk::SliderTextWidget::textModified ( QString  )
protectedslot

When the user change the text.

Referenced by SliderTextWidget().

+ Here is the caller graph for this function:

◆ valueChanged [1/2]

void camitk::SliderTextWidget::valueChanged ( )
signal

Signal emitted when the value has changed (either directly using the slider or when the user pressed return)

Referenced by returnPressed(), setValue(), SliderTextWidget(), and valueChanged().

+ Here is the caller graph for this function:

◆ valueChanged [2/2]

void camitk::SliderTextWidget::valueChanged ( int  val)
protectedslot

Update the value of the lineedit when slider moves.

References valueChanged().


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