X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_ListView.cpp;h=5fd8909eefb4374cf7f6a24549fe17f26668cc24;hb=9e7c2106b3a1a502db995e8cde557a31759eac42;hp=d9fe13d2c18339a17daaafebe041484adacb8e43;hpb=c4eab94a20a0d93100549a210582d46409fec1cc;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_ListView.cpp b/src/ModuleBase/ModuleBase_ListView.cpp index d9fe13d2c..5fd8909ee 100644 --- a/src/ModuleBase/ModuleBase_ListView.cpp +++ b/src/ModuleBase/ModuleBase_ListView.cpp @@ -77,6 +77,19 @@ void ModuleBase_ListView::getSelectedIndices(std::set& theIndices) } } +//******************************************************************** +void ModuleBase_ListView::selectIndices(const std::set& theIndices) +{ + myListControl->clearSelection(); + for (int i = 0; i < myListControl->count(); i++) { + QListWidgetItem* anItem = myListControl->item(i); + int aId = anItem->data(ATTRIBUTE_SELECTION_INDEX_ROLE).toInt(); + if (theIndices.find(aId) != theIndices.end()) { + anItem->setSelected(true); + } + } +} + //******************************************************************** void ModuleBase_ListView::removeSelectedItems() {