Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetChoice.cpp
index ea04160b52f36ff0e1af50ffa770e24f68448f57..c2d15b828e4bccf2b70aa19a3f9f4fe429f39321 100644 (file)
@@ -133,16 +133,23 @@ bool ModuleBase_WidgetChoice::restoreValueCustom()
         myChoiceCtrl->setChoiceList(aChoiceList);
       }
     }
-    if (aIntAttr->isInitialized())
+    if (aIntAttr->isInitialized()) {
       myChoiceCtrl->setValue(aIntAttr->value());
+
+      myChoiceCtrl->blockSignals(isBlocked);
+      emit itemSelected(this, aIntAttr->value());
+      myDefValue = aIntAttr->value();
+    }
     else {
       bool aHasDefaultValue;
       int aDefaultVal = QString::fromStdString(getDefaultValue()).toInt(&aHasDefaultValue);
-      myChoiceCtrl->setValue(aHasDefaultValue ? aDefaultVal : 0);
+      int aVal = aHasDefaultValue ? aDefaultVal : 0;
+      myChoiceCtrl->setValue(aVal);
+
+      myChoiceCtrl->blockSignals(isBlocked);
+      emit itemSelected(this, aVal);
+      myDefValue = aVal;
     }
-    myChoiceCtrl->blockSignals(isBlocked);
-    emit itemSelected(this, aIntAttr->value());
-    myDefValue = aIntAttr->value();
     myIsFirst = false;
   }
   return true;