From: Paul RASCLE Date: Wed, 1 Mar 2017 10:59:13 +0000 (+0100) Subject: clear PyQt selection on close study X-Git-Tag: SHAPER_2.7.0~2^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=93ed31b34ee8468729519da9b4c64fbcb3515eab;p=modules%2Fgui.git clear PyQt selection on close study --- diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx index 80f3e8ea0..9e53d0350 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx @@ -180,6 +180,8 @@ void SALOME_PYQT_ModuleLight::onModelClosed() { // call helper myHelper->modelClosed(application()->activeStudy()); + if (mySelector) + mySelector->clear(); LightApp_Module::onModelClosed(); } diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_Selector.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_Selector.cxx index 0a2d61f8f..84e6e641c 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_Selector.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_Selector.cxx @@ -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. diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_Selector.h b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_Selector.h index 36ef872b5..97b894684 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_Selector.h +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_Selector.h @@ -54,6 +54,7 @@ public: unsigned long getModifiedTime() const; void setModified(); void setLocalEntries(const QStringList& entries) { myLocalEntries = entries; }; + void clear(); private slots: void onSelectionChanged();