X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_ParamSpinBox.cpp;h=17b9307ca014ab936354b3cf1f4f0464c3cdff34;hb=cf8f82e87c5bec5bef69549ce628bfdb093b92a1;hp=bfd0823866a868242e6e83567dd7933792166e2d;hpb=3b6472899555f2186d09f45f4f1fde38b3af969a;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_ParamSpinBox.cpp b/src/ModuleBase/ModuleBase_ParamSpinBox.cpp index bfd082386..17b9307ca 100644 --- a/src/ModuleBase/ModuleBase_ParamSpinBox.cpp +++ b/src/ModuleBase/ModuleBase_ParamSpinBox.cpp @@ -67,7 +67,7 @@ double ModuleBase_ParamSpinBox::valueFromText(const QString& theText) const 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); } @@ -101,9 +101,14 @@ QValidator::State ModuleBase_ParamSpinBox::validate(QString& str, int& pos) cons /*! \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); }