src/eric7/UI/PythonAstViewer.py

branch
eric7
changeset 11215
d07c71a34adf
parent 11090
f5f5f5803935
--- a/src/eric7/UI/PythonAstViewer.py	Thu Apr 10 18:36:24 2025 +0200
+++ b/src/eric7/UI/PythonAstViewer.py	Thu Apr 10 18:39:29 2025 +0200
@@ -36,16 +36,16 @@
     EndLineRole = Qt.ItemDataRole.UserRole + 2
     EndIndexRole = Qt.ItemDataRole.UserRole + 3
 
-    def __init__(self, viewmanager, parent=None):
+    def __init__(self, viewmanager, ui):
         """
         Constructor
 
         @param viewmanager reference to the viewmanager object
         @type ViewManager
-        @param parent reference to the parent widget
+        @param ui reference to the main ui widget
         @type QWidget
         """
-        super().__init__(parent)
+        super().__init__(None)
 
         self.__layout = QVBoxLayout(self)
         self.setLayout(self.__layout)
@@ -76,6 +76,8 @@
 
         self.__vm.astViewerStateChanged.connect(self.__astViewerStateChanged)
 
+        ui.shutdown.connect(self.__shutdown)
+
         self.hide()
 
     def __editorChanged(self, editor):
@@ -168,9 +170,9 @@
             self.__vm.editorLanguageChanged.disconnect(self.__editorLanguageChanged)
             self.__vmConnected = False
 
-    def shutdown(self):
+    def __shutdown(self):
         """
-        Public method to perform shutdown actions.
+        Private method to perform shutdown actions.
         """
         self.__editor = None
 

eric ide

mercurial