From a1cbf92640f074da52a62dd3072827ffc7ccdf24 Mon Sep 17 00:00:00 2001 From: Michael Otto Date: Thu, 13 Nov 2025 09:32:29 +0100 Subject: [PATCH] Anpassung an Qt6, Fehler beim Beenden behoben --- main.py | 16 ++++++++++++++-- metadata.txt | 2 ++ resources.py | 3 ++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index bf21f7b..3146dc1 100644 --- a/main.py +++ b/main.py @@ -41,14 +41,26 @@ class Plan41: """ Wird aufgerufen, wenn das Dockwidget geschlossen wird. Setzt den Aktivitätsstatus zurück. """ - self.dockwidget.closingPlugin.disconnect(self.onClosePlugin) + try: + self.dockwidget.closingPlugin.disconnect(self.onClosePlugin) + except Exception: + pass self.pluginIsActive = False def unload(self): """ Wird beim Deaktivieren des Plugins aufgerufen. Entfernt Menü- und Toolbar-Eintrag. """ - self.ui.remove_action(self.action_text) + if hasattr(self, "ui"): + self.ui.remove_action(self.action_text) + + if self.dockwidget: + try: + self.iface.removeDockWidget(self.dockwidget) + except Exception: + pass + self.dockwidget.deleteLater() + self.dockwidget = None def run(self): """ diff --git a/metadata.txt b/metadata.txt index f2f76c9..5e760d1 100644 --- a/metadata.txt +++ b/metadata.txt @@ -8,6 +8,8 @@ email=michael.otto@landkreis-mittelsachsen.de about=Provide a brief description of the plugin and its purpose. +supportsQt6=True + hasProcessingProvider=no tags=python diff --git a/resources.py b/resources.py index 5a9d74d..9b71416 100644 --- a/resources.py +++ b/resources.py @@ -6,7 +6,8 @@ # # WARNING! All changes made in this file will be lost! -from PyQt5 import QtCore +#from PyQt5 import QtCore #Qt6 +from qgis.PyQt import QtCore qt_resource_data = b"\ \x00\x00\x02\x5f\