: QTreeView(theParent)
{
setHeaderHidden(true);
- XGUI_DocumentDataModel* aDocModel = new XGUI_DocumentDataModel(this);
- setModel(aDocModel);
+ myDocModel = new XGUI_DocumentDataModel(this);
+ setModel(myDocModel);
+
+ connect(selectionModel(), SIGNAL(selectionChanged(const QItemSelection&, const QItemSelection&)),
+ this, SLOT(onSelectionChanged(const QItemSelection&, const QItemSelection&)));
}
{
}
+
+
+void XGUI_ObjectsBrowser::onSelectionChanged(const QItemSelection& theSelected,
+ const QItemSelection& theDeselected)
+{
+ mySelectedData.clear();
+ QModelIndexList aIndexes = selectionModel()->selectedIndexes();
+ QModelIndexList::const_iterator aIt;
+ for (aIt = aIndexes.constBegin(); aIt != aIndexes.constEnd(); ++aIt) {
+ FeaturePtr aFeature = myDocModel->feature(*aIt);
+ if (aFeature)
+ mySelectedData.append(aFeature);
+ }
+ emit selectionChanged();
+}
\ No newline at end of file