X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetDoubleValue.cpp;h=9e222e9869d3d007ef441173dc7b041830977705;hb=872ac5e3e0196ad70c2a01a79bd070c9a7d4a2e6;hp=a17ea26c9793ee4a8c3acab86dc7f5df40b0646b;hpb=04a8a265b25901dd54e34d449f8d0c64304f1e69;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index a17ea26c9..9e222e986 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp @@ -96,12 +96,11 @@ ModuleBase_WidgetDoubleValue::~ModuleBase_WidgetDoubleValue() void ModuleBase_WidgetDoubleValue::reset() { - if (isComputedDefault()) { + if (isComputedDefault() || mySpinBox->hasVariable()) { return; //if (myFeature->compute(myAttributeID)) // restoreValue(); - } - else { + } else { bool isOk; double aDefValue = QString::fromStdString(getDefaultValue()).toDouble(&isOk); // reset the value just if there is a default value definition in the XML definition @@ -121,6 +120,8 @@ bool ModuleBase_WidgetDoubleValue::storeValueCustom() const std::string aTextRepr = aReal->text(); if (mySpinBox->hasVariable()) { aTextRepr = mySpinBox->text().toStdString(); + } else { + aTextRepr = ""; } aReal->setText(aTextRepr); updateObject(myFeature); @@ -133,7 +134,9 @@ bool ModuleBase_WidgetDoubleValue::restoreValue() AttributeDoublePtr aRef = aData->real(attributeID()); std::string aTextRepr = aRef->text(); if (!aTextRepr.empty()) { + bool isBlocked = mySpinBox->blockSignals(true); mySpinBox->setText(QString::fromStdString(aTextRepr)); + mySpinBox->blockSignals(isBlocked); } else { ModuleBase_Tools::setSpinValue(mySpinBox, aRef->value()); }