From: vsv Date: Wed, 4 May 2016 14:41:27 +0000 (+0300) Subject: Ergonomic improvement: restore selection after deletion of item X-Git-Tag: V_2.3.0~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d2c3360c403afa3c5edfa90aa64f85d46e4641a4;p=modules%2Fshaper.git Ergonomic improvement: restore selection after deletion of item --- diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 2e0c7e0ea..b7f2995af 100755 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -325,6 +325,11 @@ bool ModuleBase_WidgetMultiSelector::processDelete() std::set anAttributeIds; getSelectedAttributeIndices(anAttributeIds); + QModelIndexList aIndexes = myListControl->selectionModel()->selectedIndexes(); + //foreach(QModelIndex aIndex, aIndexes) { + // aIndex.row(); + //} + // refill attribute by the items which indices are not in the list of ids bool aDone = false; DataPtr aData = myFeature->data(); @@ -358,6 +363,9 @@ bool ModuleBase_WidgetMultiSelector::processDelete() myWorkshop->module()->customizeObject(myFeature, ModuleBase_IModule::CustomizeArguments, true); /// hope that something is redisplayed by object updated } + foreach(QModelIndex aIndex, aIndexes) { + myListControl->selectionModel()->select(aIndex, QItemSelectionModel::Select); + } return aDone; }