]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
clear PyQt selection on close study
authorPaul RASCLE <paul.rascle@edf.fr>
Wed, 1 Mar 2017 10:59:13 +0000 (11:59 +0100)
committerPaul RASCLE <paul.rascle@edf.fr>
Wed, 1 Mar 2017 10:59:13 +0000 (11:59 +0100)
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_Selector.cxx
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_Selector.h

index 80f3e8ea012dff22b5657289e683d5ebfd2e91d0..9e53d0350ef7e5e232a180645bc2e578e391fe66 100644 (file)
@@ -180,6 +180,8 @@ void SALOME_PYQT_ModuleLight::onModelClosed()
 {
   // call helper
   myHelper->modelClosed(application()->activeStudy());
+  if (mySelector)
+    mySelector->clear();
   LightApp_Module::onModelClosed();
 }
 
index 0a2d61f8f3475abbf8e644dbe1e8ba34c066c990..84e6e641c70c54bc893bbf195af3277b0aee2841 100644 (file)
@@ -51,6 +51,10 @@ SALOME_PYQT_Selector::SALOME_PYQT_Selector(SALOME_PYQT_ModuleLight* pymod, SUIT_
     SUIT_Selector(mgr, pymod), myPyModule(pymod)
 {
   MESSAGE("constructor");
+  myLocalEntries.clear();
+  mySelectedList.clear();
+  myEntries.clear();
+  myModifiedTime = 0;
   if (myPyModule)
     {
       connect(myPyModule, SIGNAL(localSelectionChanged()), this, SLOT(onSelectionChanged()));
@@ -66,6 +70,17 @@ SALOME_PYQT_Selector::~SALOME_PYQT_Selector()
   MESSAGE("destructor");
 }
 
+/*!
+ \brief Reset selection internally. Used on close study.
+ */
+void SALOME_PYQT_Selector::clear()
+{
+  MESSAGE("clear");
+  myLocalEntries.clear();
+  mySelectedList.clear();
+  myEntries.clear();
+}
+
 /*!
  \brief Get Python module interface instance.
  \return a pointer to the Python module interface instance.
index 36ef872b526562281c6807925d188e51815eb513..97b89468492f4a7292b08f23d5549e8570944cc9 100644 (file)
@@ -54,6 +54,7 @@ public:
   unsigned long      getModifiedTime() const;
   void               setModified();
   void               setLocalEntries(const QStringList& entries) { myLocalEntries = entries; };
+  void               clear();
 
 private slots:
   void               onSelectionChanged();