Skip to content

Commit

Permalink
Gui: fix ExpLineEdit::apply()
Browse files Browse the repository at this point in the history
ExpLineEdit was originally created for editing PropertyString with
optional expression. It has since been extended to be used by any type
of property.
  • Loading branch information
realthunder authored and wwmayer committed Oct 7, 2019
1 parent a230d0d commit f14dfd4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Gui/Widgets.cpp
Expand Up @@ -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
Expand Down

0 comments on commit f14dfd4

Please sign in to comment.