Salome HOME
Merge branch 'Dev_1.2.0' of newgeom:newgeom into Dev_1.2.0
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetBoolValue.cpp
index 87e26a78f5c4b03a9a61ad35adc3e99e95929f08..a019404f5dbf0d5346392a3cc716f229540cf342 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()));
 }
 
@@ -39,12 +45,7 @@ ModuleBase_WidgetBoolValue::~ModuleBase_WidgetBoolValue()
 {
 }
 
-QWidget* ModuleBase_WidgetBoolValue::getControl() const
-{
-  return myCheckBox;
-}
-
-bool ModuleBase_WidgetBoolValue::storeValue() const
+bool ModuleBase_WidgetBoolValue::storeValueCustom() const
 {
   DataPtr aData = myFeature->data();
   std::shared_ptr<ModelAPI_AttributeBoolean> aBool = aData->boolean(attributeID());
@@ -71,3 +72,8 @@ QList<QWidget*> ModuleBase_WidgetBoolValue::getControls() const
   aList.append(myCheckBox);
   return aList;
 }
+
+void ModuleBase_WidgetBoolValue::setHighlighted(bool)
+{
+  return;
+}