if (!hasVariable(theText))
return ModuleBase_DoubleSpinBox::valueFromText(theText);
- // small hack: return length of the string to initiate valuesChanged signal
+ // small hack: return hash of the string to initiate valuesChanged signal
return qHash(theText);
}
/*!
\brief This function is used to set a current value for this spinbox.
\param value current value
+
+ The new value is ignored if the spinbox has a variable.
*/
void ModuleBase_ParamSpinBox::setValue(const double value)
{
+ if (hasVariable())
+ return;
+
myTextValue = ModuleBase_DoubleSpinBox::textFromValue(value);
ModuleBase_DoubleSpinBox::setValue(value);
}
}
/*!
- \brief This function is called when the spinbox recieves key press event.
+ \brief This function is called when the spinbox receives key press event.
*/
//void ModuleBase_ParamSpinBox::keyPressEvent(QKeyEvent* e)
//{
//}
/*!
- \brief This function is called when the spinbox recieves show event.
+ \brief This function is called when the spinbox receives show event.
*/
void ModuleBase_ParamSpinBox::showEvent(QShowEvent* theEvent)
{