summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2024-03-02 17:21:14 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2024-03-03 17:07:55 +0100
commit7ff1285e7a93d51e1f2a079ae33349906d9e9fea (patch)
tree4a204ae0d0100091f05a1b7d5ca4e009c5486871 /src/widgets
parent7cf39bd785e8ba817960d48b120983cafcc539f3 (diff)
Disconnect QWindowContainer::focusWindowChanged on destruction
Regression after 9e78256579e8dc704066a98cb4816a1aab0e7e3b. Apparently the string based connection syntax is more lenient, as with PMF-style connects, we (correctly) get: ASSERT failure in QWindowContainer: "Called object is not of the correct type (class destructor may have already run)" when the QWidget destructor closes the QWindow and we get a synchronous callback from the platform that we've lost the focus window. Pick-to: 6.7 Change-Id: I8f25b3b050e11913ec0f0941eaf831c88b4249f9 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qwindowcontainer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp
index 1247c4c6a6..cfd785a82c 100644
--- a/src/widgets/kernel/qwindowcontainer.cpp
+++ b/src/widgets/kernel/qwindowcontainer.cpp
@@ -245,6 +245,9 @@ QWindowContainer::~QWindowContainer()
d->window->destroy();
delete d->window;
+
+ disconnect(qGuiApp, &QGuiApplication::focusWindowChanged,
+ this, &QWindowContainer::focusWindowChanged);
}