30 #include <QDoubleValidator> 40 setValidator(
new QDoubleValidator(
this));
41 connect(
this, SIGNAL(textEdited(
const QString&)),
this, SLOT(
updateValue()));
51 float existing_text_value = locale.toFloat(text(), &ok);
52 if (!ok || existing_text_value != new_value)
54 setText(locale.toString((
double)
value_));
61 if (hasAcceptableInput())
64 float new_value = QLocale().toFloat(text(), &ok);
virtual void setValue(float new_value)
FloatEdit(QWidget *parent=nullptr)