void ModuleBase_ParamSpinBox::showEvent(QShowEvent* theEvent)
{
ModuleBase_DoubleSpinBox::showEvent(theEvent);
- //setText(myTextValue);
+ if (hasVariable(myTextValue)) {
+ setText(myTextValue);
+ }
}
void ModuleBase_WidgetDoubleValue::reset()
{
- if (isComputedDefault()) {
+ if (isComputedDefault() || mySpinBox->hasVariable()) {
return;
//if (myFeature->compute(myAttributeID))
// restoreValue();
- }
- else {
+ } else {
bool isOk;
double aDefValue = QString::fromStdString(getDefaultValue()).toDouble(&isOk);
// reset the value just if there is a default value definition in the XML definition
std::string aTextRepr = aReal->text();
if (mySpinBox->hasVariable()) {
aTextRepr = mySpinBox->text().toStdString();
+ } else {
+ aTextRepr = "";
}
aReal->setText(aTextRepr);
updateObject(myFeature);