X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_ListView.cpp;h=b0ca3c8e82bec2897387ec90dcbed2ff28b491b1;hb=9628c44ddd75b2adc08bb7c4ddc690b2e09db3c5;hp=d9fe13d2c18339a17daaafebe041484adacb8e43;hpb=c4eab94a20a0d93100549a210582d46409fec1cc;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_ListView.cpp b/src/ModuleBase/ModuleBase_ListView.cpp index d9fe13d2c..b0ca3c8e8 100644 --- a/src/ModuleBase/ModuleBase_ListView.cpp +++ b/src/ModuleBase/ModuleBase_ListView.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// Copyright (C) 2014-2022 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -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() {