#include <ModuleBase_DoubleSpinBox.h>
#include <ModuleBase_IViewWindow.h>
+#include <ModuleBase_Tools.h>
#include <XGUI_ViewerProxy.h>
#include <XGUI_Workshop.h>
// Reconnect to local slot
disconnect(mySpinBox, SIGNAL(valueChanged(double)), this, SIGNAL(valuesChanged()));
connect(mySpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValuesChanged()));
- connect(mySpinBox, SIGNAL(valueChanged(double)), this, SLOT(controlValuesChanged()));
}
PartSet_WidgetPoint2dDistance::~PartSet_WidgetPoint2dDistance()
{
}
+void PartSet_WidgetPoint2dDistance::reset()
+{
+ bool isOk;
+ double aDefValue = QString::fromStdString(getDefaultValue()).toDouble(&isOk);
+
+ ModuleBase_Tools::setSpinValue(mySpinBox, isOk ? aDefValue : 0.0);
+}
+
void PartSet_WidgetPoint2dDistance::setPoint(FeaturePtr theFeature,
const std::shared_ptr<GeomAPI_Pnt2d>& thePnt)
{
AttributeDoublePtr aReal = aData->real(attributeID());
if (aReal && (aReal->value() != aRadius)) {
aReal->setValue(aRadius);
- mySpinBox->blockSignals(true);
- mySpinBox->setValue(aRadius);
- mySpinBox->blockSignals(false);
- emit valuesChanged();
+
+ ModuleBase_Tools::setSpinValue(mySpinBox, aRadius);
+ storeValue();
}
}