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.
This commit is contained in:
Zheng, Lei
2019-09-30 11:41:17 +08:00
committed by wmayer
parent a230d0d9a3
commit f14dfd41cd

View File

@@ -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