From d2c3360c403afa3c5edfa90aa64f85d46e4641a4 Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 4 May 2016 17:41:27 +0300 Subject: [PATCH] Ergonomic improvement: restore selection after deletion of item --- src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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; } -- 2.39.2