From: vsv Date: Thu, 29 Dec 2016 12:51:44 +0000 (+0300) Subject: Issue #1953: Synchronize selection on widget activation X-Git-Tag: V_2.7.0~351^2~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a6677508dfcc77446305c17509779accad261b54;p=modules%2Fshaper.git Issue #1953: Synchronize selection on widget activation --- diff --git a/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp b/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp index a9e83048f..55b806612 100644 --- a/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp +++ b/src/CollectionPlugin/CollectionPlugin_WidgetField.cpp @@ -969,3 +969,24 @@ void CollectionPlugin_WidgetField::onColumnResize(int theIndex, int theOld, int aTable->setColumnWidth(theIndex, theNew); } } + +//********************************************************************************** +QList> + CollectionPlugin_WidgetField::getAttributeSelection() const +{ + QList> aList; + if(myFeature) { + DataPtr aData = myFeature->data(); + AttributeSelectionListPtr aSelList = + aData->selectionList(CollectionPlugin_Field::SELECTED_ID()); + AttributeSelectionPtr aAttr; + ObjectPtr anObject; + for (int i = 0; i < aSelList->size(); i++) { + aAttr = aSelList->value(i); + ModuleBase_ViewerPrsPtr + aPrs(new ModuleBase_ViewerPrs(aAttr->context(), aAttr->value(), NULL)); + aList.append(aPrs); + } + } + return aList; +} \ No newline at end of file diff --git a/src/CollectionPlugin/CollectionPlugin_WidgetField.h b/src/CollectionPlugin/CollectionPlugin_WidgetField.h index 78af65eb1..3bd98f95c 100644 --- a/src/CollectionPlugin/CollectionPlugin_WidgetField.h +++ b/src/CollectionPlugin/CollectionPlugin_WidgetField.h @@ -101,6 +101,11 @@ protected: //virtual void showEvent(QShowEvent* theEvent); + /// Return the attribute values wrapped in a list of viewer presentations + /// \return a list of viewer presentations, which contains an attribute result and + /// a shape. If the attribute do not uses the shape, it is empty + virtual QList> getAttributeSelection() const; + protected slots: /// Slot which is called on selection event virtual void onSelectionChanged();