- myProfiles->clear();
- for ( int i = 0, n = theProfiles.length(); i < n; ++i )
- {
- const QString& aProfileName = theProfiles.at( i );
- QListWidgetItem* aListItem = new QListWidgetItem( aProfileName, myProfiles );
- aListItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
+ HYDROGUI_ListModel::Object2VisibleList aProfiles;
+ foreach ( const QString& aProfileName, theProfiles ) {
+ Handle(HYDROData_Profile) anObject = Handle(HYDROData_Profile)::DownCast(
+ HYDROGUI_Tool::FindObjectByName( module(), aProfileName ) );
+ if ( !anObject.IsNull() ) {
+ aProfiles.append( HYDROGUI_ListModel::Object2Visible( anObject, true ) );
+ }