Salome HOME
Correction for boolean control after refactoring
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetBoolValue.cpp
index f1d5f2ba08a1443c15d63d9da31ea051d9bfaae9..7d5e2855b374980f097d019acf159c0869bb8121 100644 (file)
@@ -5,6 +5,7 @@
 // Author:      Vitaly Smetannikov
 
 #include <ModuleBase_WidgetBoolValue.h>
+#include <ModuleBase_Tools.h>
 
 #include <ModelAPI_AttributeBoolean.h>
 #include <ModelAPI_Data.h>
@@ -28,10 +29,15 @@ ModuleBase_WidgetBoolValue::ModuleBase_WidgetBoolValue(QWidget* theParent,
   QString aToolTip = QString::fromStdString(theData->widgetTooltip());
   bool isChecked = theData->getBooleanAttribute(ATTR_DEFAULT, false);
 
-  myCheckBox = new QCheckBox(aText, theParent);
+  myCheckBox = new QCheckBox(aText, this);
   myCheckBox->setToolTip(aToolTip);
   myCheckBox->setChecked(isChecked);
 
+  QVBoxLayout* aMainLayout = new QVBoxLayout(this);
+  ModuleBase_Tools::adjustMargins(aMainLayout);
+  aMainLayout->addWidget(myCheckBox);
+  setLayout(aMainLayout);
+
   connect(myCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(valuesChanged()));
 }