Salome HOME
Issue #1351: partition is not done
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetDoubleValue.cpp
index 06cfe0c0496cde8457a649cc5548cca53905badd..fbe80ec1897a1c38369dcd1da4b4595c6d209573 100644 (file)
@@ -45,7 +45,10 @@ ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent,
   if (!aLabelIcon.isEmpty())
     myLabel->setPixmap(QPixmap(aLabelIcon));
 
+  bool aAcceptVariables = theData->getBooleanAttribute(DOUBLE_WDG_ACCEPT_EXPRESSIONS, true);
+
   mySpinBox = new ModuleBase_ParamSpinBox(this);
+  mySpinBox->setAcceptVariables(aAcceptVariables);
   QString anObjName = QString::fromStdString(attributeID());
   mySpinBox->setObjectName(anObjName);
 
@@ -102,7 +105,7 @@ bool ModuleBase_WidgetDoubleValue::resetCustom()
     bool isOk;
     double aDefValue = QString::fromStdString(getDefaultValue()).toDouble(&isOk);
     // reset the value just if there is a default value definition in the XML definition
-    // if the double value can not be found by the default value, do nothing
+    // if the value can not be found by the default value, do nothing
     if (isOk) {
       ModuleBase_Tools::setSpinValue(mySpinBox, aDefValue);
       storeValue();
@@ -159,10 +162,8 @@ QList<QWidget*> ModuleBase_WidgetDoubleValue::getControls() const
 bool ModuleBase_WidgetDoubleValue::processEnter()
 {
   bool isModified = getValueState() == ModifiedInPP;
-  //bool isModified = mySpinBox->isModified();
   if (isModified) {
     emit valuesChanged();
-    //mySpinBox->clearModified();
     mySpinBox->selectAll();
   }
   return isModified;