diff options
author | Paul Olav Tvete <[email protected]> | 2024-08-21 13:25:02 +0200 |
---|---|---|
committer | Paul Olav Tvete <[email protected]> | 2024-09-03 17:38:37 +0200 |
commit | 14481614439a2fcb1f7f3d7820334f5af50be732 (patch) | |
tree | 5dc542cf6c02faf2223ac7fb8e70f76450ce52ba | |
parent | 403b1abcad5f437c51dfabd7095b814e99e197a1 (diff) |
QWindowContainer: Respect WA_DontCreateNativeAncestors
QWindowContainer forces a native window if it has a scroll area or an
MDI area as an ancestor. This breaks if WA_DontCreateNativeAncestors is
set, because the window container logic assumes that either there are no
native widgets in the parent chain, or all of them are native.
To avoid this problem, don't turn the window container native if it has
the WA_DontCreateNativeAncestors attribute set.
Task-number: QTBUG-128029
Pick-to: 6.8
Change-Id: Ifca50c9abd7175a0af5b62b196a86a463a11be31
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
Reviewed-by: Tor Arne Vestbø <[email protected]>
Reviewed-by: David Edmundson <[email protected]>
-rw-r--r-- | src/widgets/kernel/qwindowcontainer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp index 1aaf04af438..c29caf76a8b 100644 --- a/src/widgets/kernel/qwindowcontainer.cpp +++ b/src/widgets/kernel/qwindowcontainer.cpp @@ -62,6 +62,8 @@ public: if (window->parent() == nullptr) return; Q_Q(QWindowContainer); + if (q->testAttribute(Qt::WA_DontCreateNativeAncestors)) + return; if (q->internalWinId()) { // Allow use native widgets if the window container is already a native widget usesNativeWidgets = true; |