]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Ergonomic improvement: restore selection after deletion of item
authorvsv <vitaly.smetannikov@opencascade.com>
Wed, 4 May 2016 14:41:27 +0000 (17:41 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Wed, 4 May 2016 14:41:42 +0000 (17:41 +0300)
src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp

index 2e0c7e0ea0ce4b38b61fdb2dc5ad55dfa6567584..b7f2995afc00f3f3339b5642c4e9ab8c2fa2ac8f 100755 (executable)
@@ -325,6 +325,11 @@ bool ModuleBase_WidgetMultiSelector::processDelete()
   std::set<int> 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;
 }