From 55f0582f0c216aac1da2a480ba9705d8ec11e2d8 Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 25 May 2015 11:13:37 +0300 Subject: [PATCH] Set empty text if double value is set in editor --- src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp | 4 +--- src/ModuleBase/ModuleBase_WidgetEditor.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index 38d47563f..e2e8fa4e5 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp @@ -117,9 +117,7 @@ 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()); + aReal->setText(""); } else { // Here is a text of a real value or an expression. std::string aText = mySpinBox->text().toStdString(); diff --git a/src/ModuleBase/ModuleBase_WidgetEditor.cpp b/src/ModuleBase/ModuleBase_WidgetEditor.cpp index 1c26b11eb..29e07a1f3 100644 --- a/src/ModuleBase/ModuleBase_WidgetEditor.cpp +++ b/src/ModuleBase/ModuleBase_WidgetEditor.cpp @@ -62,7 +62,7 @@ void editedValue(double& outValue, QString& outText) double aValue = outText.toDouble(&isDouble); if (isDouble) { outValue = aValue; - // outText = ""; // return empty string, if it's can be converted to a double + outText = ""; // return empty string, if it's can be converted to a double } aPopup->deleteLater(); } -- 2.39.2