From 7d68d799dbff00a252e9075e2e31648447d45ca6 Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 18 May 2015 17:03:55 +0300 Subject: [PATCH] Synchronize double value and text representation stored in attribute --- src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index c9416f4a2..38d47563f 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp @@ -117,6 +117,9 @@ bool ModuleBase_WidgetDoubleValue::storeValueCustom() const AttributeDoublePtr aReal = aData->real(attributeID()); if (!mySpinBox->hasVariable()) { aReal->setValue(mySpinBox->value()); + // In order to synchronize value and text + // If it is not synchronized sometimes it could take vale not as a digit but as a string + aReal->setText(mySpinBox->text().toStdString()); } else { // Here is a text of a real value or an expression. std::string aText = mySpinBox->text().toStdString(); -- 2.39.2