*/
void ModuleBase_ParamSpinBox::stepBy(int steps)
{
- if (hasVariable())
+ if ((!myTextValue.isEmpty()) && hasVariable())
return;
ModuleBase_DoubleSpinBox::stepBy(steps);
QString ModuleBase_ParamSpinBox::textFromValue (double theValue) const
{
- if (hasVariable(myTextValue)){
+ if ((!myTextValue.isEmpty()) && hasVariable(myTextValue)){
return myTextValue;
}
return ModuleBase_DoubleSpinBox::textFromValue(theValue);
*/
void ModuleBase_ParamSpinBox::setValue(const double value)
{
- ModuleBase_DoubleSpinBox::setValue(value);
-
myTextValue = ModuleBase_DoubleSpinBox::textFromValue(value);
+ ModuleBase_DoubleSpinBox::setValue(value);
}
/*!
void ModuleBase_ParamSpinBox::showEvent(QShowEvent* theEvent)
{
ModuleBase_DoubleSpinBox::showEvent(theEvent);
- if (hasVariable(myTextValue)) {
+ if ((!myTextValue.isEmpty()) && hasVariable(myTextValue)) {
setText(myTextValue);
}
}