X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetDoubleValue.cpp;h=9e222e9869d3d007ef441173dc7b041830977705;hb=872ac5e3e0196ad70c2a01a79bd070c9a7d4a2e6;hp=e131719f38398c3d28a93b714745811264e141aa;hpb=d144b401e8f88a10ec6a51e1e9a920e78003cbf2;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index e131719f3..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 @@ -118,9 +117,11 @@ bool ModuleBase_WidgetDoubleValue::storeValueCustom() const DataPtr aData = myFeature->data(); AttributeDoublePtr aReal = aData->real(attributeID()); aReal->setValue(mySpinBox->value()); - std::string aTextRepr; + 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()); }