Skip to content
Snippets Groups Projects
Commit 2494a1fd authored by Wuttke, Joachim's avatar Wuttke, Joachim Committed by Wuttke, Joachim
Browse files

overwrite invalid input strings

parent 14745330
No related branches found
No related tags found
1 merge request!2205rewrite DoubleSpinBox; use DoubleSpinBox for intensity; simplify RealLimits (#870)
...@@ -70,8 +70,10 @@ QAbstractSpinBox::StepEnabled DoubleSpinBox::stepEnabled() const ...@@ -70,8 +70,10 @@ QAbstractSpinBox::StepEnabled DoubleSpinBox::stepEnabled() const
double DoubleSpinBox::fromDisplay() const double DoubleSpinBox::fromDisplay() const
{ {
double result; double result;
ASSERT(Base::String::to_double(lineEdit()->text().toStdString(), &result)); if (Base::String::to_double(lineEdit()->text().toStdString(), &result))
return result; return result;
// invalid input => restore last valid value
return m_valueProperty.value();
} }
void DoubleSpinBox::setValue(double val) void DoubleSpinBox::setValue(double val)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment