QList<QListWidgetItem*> aItems = myListControl->selectedItems();
myCopyAction->setEnabled(!aItems.isEmpty());
myDeleteAction->setEnabled(!aItems.isEmpty());
-}
\ No newline at end of file
+}
+
+//********************************************************************
+bool ModuleBase_ListView::hasItem(const QString& theTextValue) const
+{
+ return myListControl->findItems(theTextValue, Qt::MatchExactly).length() > 0;
+}
/// \param theIndex an item internal index
void addItem(const QString& theTextValue, const int theIndex);
+ /// Returns True if the control already contains an item with the given text
+ /// \param theTextValue tex of item to find
+ bool hasItem(const QString& theTextValue) const;
+
/// Returns list of internal list view item indices
/// \param theIndices an output container for indices
void getSelectedIndices(std::set<int>& theIndices);
const NCollection_List<TopoDS_Shape>& theHiddenSubShapes)
{
switch (theShape.ShapeType()) {
+ case TopAbs_COMPSOLID:
case TopAbs_COMPOUND: {
for (TopoDS_Iterator aChildIter (theShape); aChildIter.More(); aChildIter.Next())
collectSubShapes(theBuilder, theCompound, aChildIter.Value(), theHiddenSubShapes);
aPrs->interactive());
if (aResultPrs.IsNull())
continue;
+ QString aItemName = generateName(aPrs);
+ if (myListView->hasItem(aItemName))
+ return;
myItems.insert(myLastItemIndex, aPrs);
- myListView->addItem(generateName(aPrs), myLastItemIndex);
+ myListView->addItem(aItemName, myLastItemIndex);
myLastItemIndex++;
isModified = true;