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>
bb10
Richard Moe Gustavsen 2021-09-13 16:41:08 +02:00
parent 73753ee3af
commit f06f39779c
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}