Salome HOME
Issue #236: Avoid empty shape types definition
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetDoubleValue.cpp
index 48620cbdc8961d6f4262be001c6853ba0d19c20b..922ab91519dde70b29a459e79aa762472c752bff 100644 (file)
@@ -4,6 +4,7 @@
 
 #include <ModuleBase_WidgetDoubleValue.h>
 #include <ModuleBase_DoubleSpinBox.h>
+#include <ModuleBase_Tools.h>
 
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_Data.h>
@@ -18,7 +19,6 @@
 #include <QLayout>
 #include <QLabel>
 #include <QEvent>
-#include <QKeyEvent>
 #include <QTimer>
 
 #include <math.h>
@@ -37,7 +37,7 @@ ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent,
 {
   myContainer = new QWidget(theParent);
   QHBoxLayout* aControlLay = new QHBoxLayout(myContainer);
-  aControlLay->setContentsMargins(0, 0, 0, 0);
+  ModuleBase_Tools::adjustMargins(aControlLay);
 
   QString aLabelText = QString::fromStdString(theData->widgetLabel());
   QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
@@ -77,7 +77,7 @@ ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent,
     mySpinBox->setSingleStep(aStepVal);
   }
 
-  aProp = theData->getProperty(DOUBLE_WDG_DEFAULT);
+  aProp = theData->getProperty(ANY_WDG_DEFAULT);
   double aDefVal = QString::fromStdString(aProp).toDouble(&isOk);
   if (isOk) {
     mySpinBox->setValue(aDefVal);