|
Computer Assited Medical Intervention Tool Kit
version 5.0
|
|
Go to the documentation of this file.
26 #ifndef SLIDER_TEXT_WIDGET_H
27 #define SLIDER_TEXT_WIDGET_H
58 class CAMITK_API SliderTextWidget :
public QWidget {
63 SliderTextWidget(QWidget* parent =
nullptr, Qt::WindowFlags fl = Qt::WindowFlags());
66 ~SliderTextWidget()
override;
69 void setName(
const QString&);
74 void init(
double min = 0.0,
double max = 100.0,
double value = 50.0);
80 void setValue(
const double,
bool emitValueChanged =
false);
93 void valueChanged(
int);
96 void textModified(QString);
103 void updateLineEdit();
106 double sliderToValue(
const int);
109 int valueToSlider(
const double);
138 #endif // SLIDERTEXTWIDGET_H
int valueToSlider(const double)
convert from value to slider
Definition: SliderTextWidget.cpp:204
double sliderToValue(const int)
convert from slider value to double
Definition: SliderTextWidget.cpp:199
void textModified(QString)
When the user change the text.
Definition: SliderTextWidget.cpp:142
void updateSlider()
update the slider position
Definition: SliderTextWidget.cpp:183
double getValue() const
Get the current value.
Definition: SliderTextWidget.h:156
void valueChanged()
Signal emitted when the value has changed (either directly using the slider or when the user pressed ...
QLineEdit * lineEdit
the line edit
Definition: SliderTextWidget.h:173
static Value getValue(const QMap< const QtProperty *, PrivateData > &propertyMap, const QtProperty *property, const Value &defaultValue=Value())
Definition: qtpropertymanager.cpp:222
void returnPressed()
when the user press return in the line edit
Definition: SliderTextWidget.cpp:149
~SliderTextWidget() override
Destructor.
Definition: SliderTextWidget.cpp:104
void setName(const QString &)
set the text label (name of the manipulated data)
Definition: SliderTextWidget.cpp:109
QLabel * label
the text label
Definition: SliderTextWidget.h:170
double max
the max real value
Definition: SliderTextWidget.h:167
SliderTextWidget(QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags())
Default constructor, name is automatically used as the text label.
Definition: SliderTextWidget.cpp:59
double value
the current value
Definition: SliderTextWidget.h:158
void setValue(const double, bool emitValueChanged=false)
Update slider and lineedit GUI, emit the valueChanged signal only if the boolean is true (default=no)
Definition: SliderTextWidget.cpp:115
void updateLineEdit()
Update the line edit value.
Definition: SliderTextWidget.cpp:169
QSlider * slider
the slider
Definition: SliderTextWidget.h:176
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,...
Definition: SliderTextWidget.cpp:126
QColor bgColor
the line edit bg color
Definition: SliderTextWidget.h:161
double min
the min real value
Definition: SliderTextWidget.h:164
#define CAMITK_API
Definition: CamiTKAPI.h:49
Definition: Action.cpp:35