From: isn Date: Fri, 19 Jun 2015 08:16:52 +0000 (+0300) Subject: ObjListBox // small corrections X-Git-Tag: v1.4.2~57 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ebfa4c8c5bd4c843e62303f57b03e3e16bea26d2;p=modules%2Fhydro.git ObjListBox // small corrections --- diff --git a/src/HYDROGUI/HYDROGUI_ObjListBox.cxx b/src/HYDROGUI/HYDROGUI_ObjListBox.cxx index f20715a6..3eef3832 100644 --- a/src/HYDROGUI/HYDROGUI_ObjListBox.cxx +++ b/src/HYDROGUI/HYDROGUI_ObjListBox.cxx @@ -121,11 +121,7 @@ void HYDROGUI_ObjListBox::OnExclude() { QList 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 ) @@ -140,8 +136,11 @@ 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 ); + } } } }