Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / ModuleBase / ModuleBase_ParamSpinBox.cpp
index 9f784ef6e33a47d80acedf0cea680326f43d6fa8..9990dfd200548ecfbe47a7075ecbbd4223c695f8 100644 (file)
@@ -49,7 +49,7 @@ ModuleBase_ParamSpinBox::ModuleBase_ParamSpinBox(QWidget* theParent, int thePrec
   myIsEquation(false),
   myAcceptVariables(true),
   mySingleStep(1),
-  myMinimum(DBL_MIN),
+  myMinimum(-DBL_MAX),
   myMaximum(DBL_MAX)
 {
   myCompleter = new QCompleter(this);
@@ -162,7 +162,6 @@ void ModuleBase_ParamSpinBox::setValue(double value)
 
 double ModuleBase_ParamSpinBox::value() const
 {
-  std::string aa = lineEdit()->text().toStdString();
   return lineEdit()->text().toDouble();
 }
 
@@ -177,6 +176,12 @@ void ModuleBase_ParamSpinBox::setText(const QString& value)
     lineEdit()->setText(value);
     emit textChanged(value);
   }
+  else {
+    bool isConv = false;
+    double aVal = value.toDouble(&isConv);
+    if (isConv)
+      setValue(aVal);
+  }
 }
 
 /*!