Salome HOME
According to "operation-widget_factory-property"
[modules/shaper.git] / src / XGUI / XGUI_ObjectsBrowser.cpp
index 125e1aaf4bc17cd6d52adda9f90296f88e671bb0..27b92756283b4e6304239e698a03adb627b4ba26 100644 (file)
@@ -146,7 +146,7 @@ XGUI_ObjectsBrowser::XGUI_ObjectsBrowser(QWidget* theParent)
   aLabelWgt->setFrameShape(myTreeView->frameShape());
   aLabelWgt->setFrameShadow(myTreeView->frameShadow());
 
-  connect(myTreeView, SIGNAL(selectionChanged()), this, SIGNAL(selectionChanged()));
+  connect(myTreeView, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
   connect(myTreeView, SIGNAL(activePartChanged(FeaturePtr)), this, SLOT(onActivePartChanged(FeaturePtr)));
   connect(myTreeView, SIGNAL(activePartChanged(FeaturePtr)), this, SIGNAL(activePartChanged(FeaturePtr)));
 
@@ -315,4 +315,33 @@ void XGUI_ObjectsBrowser::onEditItem()
       myActiveDocLbl->setProperty("OldText", myActiveDocLbl->text());
     }
   }
-}
\ No newline at end of file
+}
+
+//***************************************************
+void XGUI_ObjectsBrowser::onSelectionChanged()
+{
+  myFeaturesList = myTreeView->selectedFeatures();
+  emit selectionChanged();
+}
+
+//***************************************************
+void XGUI_ObjectsBrowser::rebuildDataTree()
+{
+  myDocModel->rebuildDataTree();
+  update();
+}
+
+//***************************************************
+void XGUI_ObjectsBrowser::setFeaturesSelected(const QFeatureList& theFeatures)
+{
+  QList<QModelIndex> theIndexes;
+  QItemSelectionModel* aSelectModel = myTreeView->selectionModel();
+  aSelectModel->clear();
+
+  foreach(FeaturePtr aFeature, theFeatures) {
+    QModelIndex aIndex = myDocModel->featureIndex(aFeature);
+    if (aIndex.isValid()) {
+      aSelectModel->select(aIndex, QItemSelectionModel::Select);
+    }
+  }
+}