QuantitySpinBox: Make sure Python code is emitted also when expressions are not used.

In that case, the property should be set directly.
This commit is contained in:
Eivind Kvedalen
2015-11-10 01:09:27 +01:00
committed by wmayer
parent f0b3c2ba35
commit 68fc3b5917
4 changed files with 9 additions and 11 deletions

View File

@@ -64,6 +64,7 @@ void Gui::ExpressionBinding::setExpression(boost::shared_ptr<Expression> expr)
}
lastExpression = getExpression();
docObj->ExpressionEngine.setValue(path, expr);
}
@@ -146,11 +147,11 @@ bool ExpressionBinding::apply(const std::string & propName)
if (!docObj)
throw Base::Exception("Document object not found.");
Gui::Command::doCommand(Gui::Command::Doc,"App.getDocument('%s').%s.setExpression('%s', None)",
docObj->getDocument()->getName(),
docObj->getNameInDocument(),
path.toEscapedString().c_str());
return true;
if (lastExpression)
Gui::Command::doCommand(Gui::Command::Doc,"App.getDocument('%s').%s.setExpression('%s', None)",
docObj->getDocument()->getName(),
docObj->getNameInDocument(),
path.toEscapedString().c_str());
}
return false;