From 9c54fb01877c455abb5b5ff22e384468f795b328 Mon Sep 17 00:00:00 2001 From: nds Date: Fri, 13 Feb 2015 18:04:56 +0300 Subject: [PATCH] Issue #394 Undo-ing a Sketch element A fix for the default constraint distance value --- src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index cd1cc4565..b18aa2089 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp @@ -82,7 +82,7 @@ ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent, double aDefVal = QString::fromStdString(myDefaultValue).toDouble(&isOk); if (isOk) { mySpinBox->setValue(aDefVal); - } else if (aProp == DOUBLE_WDG_DEFAULT_COMPUTED){ + } else if (theData->getProperty(ATTR_DEFAULT) == DOUBLE_WDG_DEFAULT_COMPUTED){ myIsComputedDefault = true; } @@ -101,6 +101,9 @@ ModuleBase_WidgetDoubleValue::~ModuleBase_WidgetDoubleValue() void ModuleBase_WidgetDoubleValue::reset() { + if (myIsComputedDefault) + return; + bool isOk; double aDefValue = QString::fromStdString(myDefaultValue).toDouble(&isOk); mySpinBox->setValue(isOk ? aDefValue : 0.0); -- 2.39.2