{
QList<QListWidgetItem*> aSelection = myList->selectedItems();
foreach( QListWidgetItem* anItem, aSelection )
- {
- int anIndex = myList->row( anItem );
- myList->takeItem( anIndex );
- mySelection.Remove( anIndex, anIndex );
- }
+ delete anItem;
}
void HYDROGUI_ObjListBox::Append( const HYDROData_SequenceOfObjects& theObjects )
if( isOK )
{
QString aName = anObject->GetName();
- myList->addItem( aName );
- mySelection.Append( anObject );
+ if (myList->findItems(aName, Qt::MatchExactly).size() == 0)
+ {
+ myList->addItem( aName );
+ mySelection.Append( anObject );
+ }
}
}
}