From d004278209aa38852215fc430f131b6be136740c Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Mon, 30 Sep 2019 11:41:17 +0800 Subject: [PATCH] Gui: fix ExpLineEdit::apply() ExpLineEdit was originally created for editing PropertyString with optional expression. It has since been extended to be used by any type of property. --- src/Gui/Widgets.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Gui/Widgets.cpp b/src/Gui/Widgets.cpp index 0326aeaa8f..b760d2da4e 100644 --- a/src/Gui/Widgets.cpp +++ b/src/Gui/Widgets.cpp @@ -1438,8 +1438,10 @@ ExpLineEdit::ExpLineEdit(QWidget* parent, bool expressionOnly) bool ExpLineEdit::apply(const std::string& propName) { if (!ExpressionBinding::apply(propName)) { - QString val = QString::fromUtf8(Base::Interpreter().strToPython(text().toUtf8()).c_str()); - Gui::Command::doCommand(Gui::Command::Doc, "%s = \"%s\"", propName.c_str(), val.constData()); + if(!autoClose) { + QString val = QString::fromUtf8(Base::Interpreter().strToPython(text().toUtf8()).c_str()); + Gui::Command::doCommand(Gui::Command::Doc, "%s = \"%s\"", propName.c_str(), val.constData()); + } return true; } else