#include <sstream>
+const double tolerance = 1e-7;
+
+
namespace ModuleBase_Tools {
//******************************************************************
void setSpinValue(QDoubleSpinBox* theSpin, double theValue)
{
- if (theSpin->value() == theValue)
+ if (fabs(theSpin->value() - theValue) < tolerance)
return;
bool isBlocked = theSpin->blockSignals(true);
theSpin->setValue(theValue);
void setSpinValue(ModuleBase_ParamSpinBox* theSpin, double theValue)
{
- //if (theSpin->value() == theValue)
- // return;
+ if (fabs(theSpin->value() - theValue) < tolerance)
+ return;
bool isBlocked = theSpin->blockSignals(true);
theSpin->setValue(theValue);
theSpin->blockSignals(isBlocked);