summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2021-09-13 16:41:08 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-14 12:50:30 +0000
commit90d6871370f8e4832d42a67fb5ba093729b0c8e7 (patch)
tree6a0dfb5cbb5f680c0b7987d1e81873f9898b0316 /src/gui
parent066eee3700736627fab9199eb4e42e78e0246f61 (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. Change-Id: I9f67f6305e0143526f53952a563d496e760ac2e7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit f06f39779c11cabc9b4fc281f38c80edb65bd86a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/kernel/qplatformwindow.cpp2
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;
}