Salome HOME
projects
/
modules
/
hydro.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refs #727, #736: fix for the first bug and for the second part (Bug2) of the last...
[modules/hydro.git]
/
src
/
HYDROGUI
/
HYDROGUI_ObjListBox.cxx
diff --git
a/src/HYDROGUI/HYDROGUI_ObjListBox.cxx
b/src/HYDROGUI/HYDROGUI_ObjListBox.cxx
index f63b7fdfe86716f33689b04064d5177e6b9ab413..38ffb4c16dbb1261d47e29c54d513338a113b864 100644
(file)
--- a/
src/HYDROGUI/HYDROGUI_ObjListBox.cxx
+++ b/
src/HYDROGUI/HYDROGUI_ObjListBox.cxx
@@
-18,7
+18,7
@@
#include <HYDROGUI_ObjListBox.h>
#include <HYDROGUI_ObjComboBox.h>
#include <HYDROGUI_ObjListBox.h>
#include <HYDROGUI_ObjComboBox.h>
-#include <HYDROGUI_Tool.h>
+#include <HYDROGUI_Tool
2
.h>
#include <QGridLayout>
#include <QListWidget>
#include <QLabel>
#include <QGridLayout>
#include <QListWidget>
#include <QLabel>
@@
-123,11
+123,7
@@
void HYDROGUI_ObjListBox::OnExclude()
{
QList<QListWidgetItem*> aSelection = myList->selectedItems();
foreach( QListWidgetItem* anItem, aSelection )
{
QList<QListWidgetItem*> aSelection = myList->selectedItems();
foreach( QListWidgetItem* anItem, aSelection )
- {
- int anIndex = myList->row( anItem );
- myList->takeItem( anIndex );
- mySelection.Remove( anIndex, anIndex );
- }
+ delete anItem;
emit selectionChanged();
}
emit selectionChanged();
}
@@
-143,8
+139,11
@@
void HYDROGUI_ObjListBox::Append( const HYDROData_SequenceOfObjects& theObjects
if( isOK )
{
QString aName = anObject->GetName();
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 );
+ }
}
}
}
}
}
}