From ebfa4c8c5bd4c843e62303f57b03e3e16bea26d2 Mon Sep 17 00:00:00 2001 From: isn Date: Fri, 19 Jun 2015 11:16:52 +0300 Subject: [PATCH] ObjListBox // small corrections --- src/HYDROGUI/HYDROGUI_ObjListBox.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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 ); + } } } } -- 2.39.2