Salome HOME
0023170: [CEA 1558] When a file is loaded in python, panels Information, Display...
authorvsr <vsr@opencascade.com>
Thu, 18 Oct 2018 08:50:21 +0000 (11:50 +0300)
committervsr <vsr@opencascade.com>
Thu, 18 Oct 2018 08:50:21 +0000 (11:50 +0300)
src/PVGUI/PVGUI_Module.cxx

index 342af676ab75f1572a9931a45c5f801de88a4a52..a97901b79b583a4112126bc0191223b83c707664 100644 (file)
 #include <pqAnimationScene.h>
 #include <pqServerManagerModel.h>
 #include <pqAnimationTimeToolbar.h>
+#include <pqPipelineBrowserWidget.h>
 
 #if PY_VERSION_HEX < 0x03050000
 static char*
@@ -629,7 +630,13 @@ bool PVGUI_Module::activateModule( SUIT_Study* study )
   }
 
   if ( myRecentMenuId != -1 ) menuMgr()->show(myRecentMenuId);
-  
+
+  // VSR 18/10/2018 - 0023170: Workaround to re-select current index after module activation
+  QItemSelectionModel* selection_model = myGuiElements->getPipelineBrowserWidget()->getSelectionModel();
+  QModelIndex idx = selection_model->currentIndex();
+  selection_model->clearCurrentIndex();
+  selection_model->setCurrentIndex(idx, QItemSelectionModel::ClearAndSelect);
+
   return isDone;
 }