Salome HOME
Example "PythonFeatures" plugin removed
[modules/shaper.git] / src / ModuleBase / ModuleBase_DoubleSpinBox.cpp
index 8f807737f7e2b0ff48a0186d0d96d3ef3e197338..683d215784bcc3c130cad428f52b80677fed506b 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 // File:      ModuleBase_DoubleSpinBox.cxx
 // Author:    Sergey TELKOV
 //
@@ -62,11 +64,13 @@ ModuleBase_DoubleSpinBox::ModuleBase_DoubleSpinBox(QWidget* parent, int thePreci
   loc.setNumberOptions(loc.numberOptions() | QLocale::OmitGroupSeparator | QLocale::RejectGroupSeparator);
   setLocale(loc);
 
+  // MPV 15/09/2014: this must be set before setDecimals; otherwise in release mode setDecimals may crash
+  myPrecision = thePrecision;
+
   // Use precision equal to default Qt decimals
   // it's necessary to set decimals before the range setting,
   // by default Qt rounds boundaries to 2 decimals at setRange
   setDecimals(thePrecision);
-  myPrecision = thePrecision;
 
   connect(lineEdit(), SIGNAL(textChanged( const QString& )), this,
           SLOT(onTextChanged( const QString& )));