X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetFeature.cpp;h=faf664fe53e9d48180ac7323988e5be4e256808f;hb=9585dccdd4d56657ced8ef9b25797979ea237f76;hp=6586a491a104783222dc1d23b58a43ffa35636c6;hpb=489132d99e1d417d5c7ce93fed8fb8ee138befbc;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetFeature.cpp b/src/ModuleBase/ModuleBase_WidgetFeature.cpp index 6586a491a..faf664fe5 100644 --- a/src/ModuleBase/ModuleBase_WidgetFeature.cpp +++ b/src/ModuleBase/ModuleBase_WidgetFeature.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include @@ -20,6 +21,7 @@ #include #include #include +#include #include #include @@ -33,7 +35,7 @@ ModuleBase_WidgetFeature::ModuleBase_WidgetFeature(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()); myLabel = new QLabel(aLabelText, myContainer); @@ -47,7 +49,6 @@ ModuleBase_WidgetFeature::ModuleBase_WidgetFeature(QWidget* theParent, QString aTTip = QString::fromStdString(theData->widgetTooltip()); myEditor->setToolTip(aTTip); - aControlLay->addWidget(myEditor); aControlLay->setStretch(1, 1); } @@ -137,10 +138,9 @@ bool ModuleBase_WidgetFeature::restoreValue() boost::shared_ptr aRef = boost::dynamic_pointer_cast< ModelAPI_AttributeRefAttr>(aData->attribute(attributeID())); - ObjectPtr aObj = aRef->object(); - FeaturePtr aFeature = boost::dynamic_pointer_cast(aRef->object()); - if (aFeature) { - myObject = aFeature; + ObjectPtr anObjPtr = aRef->object(); + if (anObjPtr) { + myObject = anObjPtr; myEditor->setText(myObject ? myObject->data()->name().c_str() : ""); return true; }