X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_ObjListBox.cxx;h=38ffb4c16dbb1261d47e29c54d513338a113b864;hb=a0964e8c4caecf35f149dbc669714901c5fd2336;hp=f20715a645dc821e748bbf359ea14fe14f745ccb;hpb=b51f9d9384bca57f8a0536490c6e372f4c10394a;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_ObjListBox.cxx b/src/HYDROGUI/HYDROGUI_ObjListBox.cxx index f20715a6..38ffb4c1 100644 --- a/src/HYDROGUI/HYDROGUI_ObjListBox.cxx +++ b/src/HYDROGUI/HYDROGUI_ObjListBox.cxx @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include #include @@ -94,6 +94,7 @@ void HYDROGUI_ObjListBox::reset() { myList->clear(); mySelection.Clear(); + emit selectionChanged(); } void HYDROGUI_ObjListBox::setSelectedObjects( const HYDROData_SequenceOfObjects& theObjects ) @@ -115,17 +116,15 @@ HYDROData_SequenceOfObjects HYDROGUI_ObjListBox::selectedObjects() const void HYDROGUI_ObjListBox::OnInclude() { Append( HYDROGUI_Tool::GetSelectedObjects( module() ) ); + emit selectionChanged(); } 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; + emit selectionChanged(); } void HYDROGUI_ObjListBox::Append( const HYDROData_SequenceOfObjects& theObjects ) @@ -140,8 +139,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 ); + } } } }