DataPtr aData = myFeature->data();
AttributeDoublePtr aReal = aData->real(attributeID());
if (!mySpinBox->hasVariable()) {
- aReal->setValue(mySpinBox->value());
+ // it is important to set the empty text value to the attribute before set the value
+ // because setValue tries to calculate the attrubyte bakye according to the
+ // attribute current text
aReal->setText("");
+ aReal->setValue(mySpinBox->value());
} else {
// Here is a text of a real value or an expression.
std::string aText = mySpinBox->text().toStdString();
ModuleBase_ParamSpinBox* aEditor = new ModuleBase_ParamSpinBox(&aDlg);
aEditor->setMinimum(0);
aEditor->setMaximum(DBL_MAX);
- aEditor->setValue(outValue);
+ if (outText.isEmpty())
+ aEditor->setValue(outValue);
+ else
+ aEditor->setText(outText);
+
aLay->addWidget(aEditor);
aEditor->setFocus();
//QApplication::processEvents();
double aValue = mySpinBox->value();
QString aText;
+ if (mySpinBox->hasVariable())
+ aText = mySpinBox->text();
+
editedValue(aValue, aText);
if (aText.isEmpty()) {
ModuleBase_Tools::setSpinValue(mySpinBox, aValue);