diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2021-09-13 16:41:08 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2021-09-13 19:54:18 +0200 |
commit | f06f39779c11cabc9b4fc281f38c80edb65bd86a (patch) | |
tree | cc76818c6d5456e036b482674ecd84fd2681d379 /src/gui/kernel/qplatformwindow.cpp | |
parent | 73753ee3af58456bfccba8281bda19228aa98bd1 (diff) |
QPlatformWindow: fix isAncestorOf not breaking recursion
The current implementation got stuck always asking for
the parent of the same child
This patch will make sure we actually walk up the
parent chain.
Pick-to: 6.2 6.2.0 6.1 5.15
Change-Id: I9f67f6305e0143526f53952a563d496e760ac2e7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/kernel/qplatformwindow.cpp')
-rw-r--r-- | src/gui/kernel/qplatformwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index 0bee2968f7..633a262d56 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -229,7 +229,7 @@ bool QPlatformWindow::isActive() const */ bool QPlatformWindow::isAncestorOf(const QPlatformWindow *child) const { - for (const QPlatformWindow *parent = child->parent(); parent; parent = child->parent()) { + for (const QPlatformWindow *parent = child->parent(); parent; parent = parent->parent()) { if (parent == this) return true; } |