+/**
+ Get names of the selected objects.
+ @return the list of names
+*/
+QStringList HYDROGUI_OrderedListWidget::getSelectedNames() const
+{
+ QStringList aNames;
+
+ QSortFilterProxyModel* aFilterModel =
+ dynamic_cast<QSortFilterProxyModel*>( myList->model() );
+ if ( aFilterModel ) {
+ HYDROGUI_ListModel* aSourceModel =
+ dynamic_cast<HYDROGUI_ListModel*>( aFilterModel->sourceModel() );
+ if ( aSourceModel ) {
+ QModelIndexList aSelectedIndexes = myList->selectionModel()->selectedIndexes();
+ foreach ( const QModelIndex& anIndex, aSelectedIndexes ) {
+ QModelIndex aSourceIndex = aFilterModel->mapToSource( anIndex );
+ QString anEntry = aSourceModel->data( aSourceIndex, Qt::DisplayRole ).toString();
+ aNames << anEntry;
+ }
+ }
+ }
+
+ return aNames;
+}
+
+/**
+ Get names of all objects.
+ @return the list of names
+*/
+QStringList HYDROGUI_OrderedListWidget::getAllNames() const
+{
+ QStringList aNames;
+
+
+ foreach ( const Handle(HYDROData_Entity)& anObject, getObjects() ) {
+ aNames << anObject->GetName();
+ }
+
+ return aNames;
+}
+