Salome HOME
This is an improvement to use one AND filter in the viewer context. It serves to...
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetChoice.cpp
index ba5a281eda49256daa308c3571deff2a360c2da0..b2d017db6b5aa0d39c3879270a2d0854e242e28e 100644 (file)
@@ -3,6 +3,7 @@
 // Author:      Vitaly Smetannikov
 
 #include "ModuleBase_WidgetChoice.h"
+#include <ModuleBase_Tools.h>
 
 #include <ModelAPI_AttributeInteger.h>
 #include <ModelAPI_Data.h>
@@ -20,7 +21,7 @@ ModuleBase_WidgetChoice::ModuleBase_WidgetChoice(QWidget* theParent,
 {
   myContainer = new QWidget(theParent);
   QHBoxLayout* aLayout = new QHBoxLayout(myContainer);
-  aLayout->setContentsMargins(0, 0, 0, 0);
+  ModuleBase_Tools::adjustMargins(aLayout);
 
   QString aLabelText = QString::fromStdString(theData->widgetLabel());
   QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
@@ -46,7 +47,7 @@ ModuleBase_WidgetChoice::~ModuleBase_WidgetChoice()
 bool ModuleBase_WidgetChoice::storeValue() const
 {
   DataPtr aData = myFeature->data();
-  boost::shared_ptr<ModelAPI_AttributeInteger> aIntAttr = aData->integer(attributeID());
+  std::shared_ptr<ModelAPI_AttributeInteger> aIntAttr = aData->integer(attributeID());
 
   aIntAttr->setValue(myCombo->currentIndex());
   updateObject(myFeature);
@@ -56,7 +57,7 @@ bool ModuleBase_WidgetChoice::storeValue() const
 bool ModuleBase_WidgetChoice::restoreValue()
 {
   DataPtr aData = myFeature->data();
-  boost::shared_ptr<ModelAPI_AttributeInteger> aIntAttr = aData->integer(attributeID());
+  std::shared_ptr<ModelAPI_AttributeInteger> aIntAttr = aData->integer(attributeID());
 
   bool isBlocked = myCombo->blockSignals(true);
   myCombo->setCurrentIndex(aIntAttr->value());
@@ -73,7 +74,6 @@ bool ModuleBase_WidgetChoice::focusTo()
 QList<QWidget*> ModuleBase_WidgetChoice::getControls() const
 {
   QList<QWidget*> aControls;
-  aControls.append(myLabel);
   aControls.append(myCombo);
   return aControls;
 }
@@ -82,4 +82,4 @@ void ModuleBase_WidgetChoice::onCurrentIndexChanged(int theIndex)
 {
   emit valuesChanged();
   emit focusOutWidget(this);
-}
\ No newline at end of file
+}