X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetFeature.cpp;h=faf664fe53e9d48180ac7323988e5be4e256808f;hb=dcd54507eb794c21a02c95ad26c1779c36481274;hp=e7c510a8385a0cfaea7d3fa94b6e5eb16246289a;hpb=cb7a02e2d7e5f4c675571888b8119a8c58069a0d;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetFeature.cpp b/src/ModuleBase/ModuleBase_WidgetFeature.cpp index e7c510a83..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); } @@ -71,7 +72,7 @@ bool ModuleBase_WidgetFeature::setValue(ModuleBase_WidgetValue* theValue) bool ModuleBase_WidgetFeature::setObject(const ObjectPtr& theObject, bool theSendEvent) { - PluginManagerPtr aMgr = ModelAPI_PluginManager::get(); + SessionPtr aMgr = ModelAPI_Session::get(); ModelAPI_ValidatorsFactory* aFactory = aMgr->validators(); std::list aValidators; std::list > anArguments; @@ -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; }