+ QString aText = mySpinBox->text();
+ if (aText.contains('=')) {
+ if (!myParameter.get()) {
+ myParameter = ModuleBase_Tools::createParameter(aText);
+ if (!myParameter.get()) {
+ aReal->setExpressionError("Parameter cannot be created");
+ aReal->setExpressionInvalid(true);
+ updateObject(myFeature);
+ return false;
+ } else if (aReal->expressionInvalid()) {
+ aReal->setExpressionError("");
+ aReal->setExpressionInvalid(false);
+ }
+ } else {
+ ModuleBase_Tools::editParameter(myParameter, aText);
+ }
+ aText = aText.split('=').at(0);
+ } else if (myParameter.get()){
+ // Nullyfy the parameter reference without deletion of the created
+ myParameter = FeaturePtr();
+ }
+ aReal->setText(aText.toStdWString());
+ } else {
+ // it is important to set the empty text value to the attribute before set the value
+ // because setValue tries to calculate the attribute value according to the
+ // attribute current text
+ if (aReal->expressionInvalid()) {
+ aReal->setExpressionError("");
+ aReal->setExpressionInvalid(false);
+ }
+ aReal->setText(L"");
+ aReal->setValue(mySpinBox->value());