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... | |
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.
| 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:
|
override |
Destructor.
|
inline |
Get the current value.
| 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
|
protectedslot |
when the user press return in the line edit
References valueChanged().
Referenced by SliderTextWidget().
Here is the caller graph for this function:| 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:| 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().
|
protectedslot |
When the user change the text.
Referenced by SliderTextWidget().
Here is the caller graph for this function:
|
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:
|
protectedslot |
Update the value of the lineedit when slider moves.
References valueChanged().