Prevent QWindow transient parent loop
Clients may wrongly set the transient parent to the window itself, causing endless loop when e.g. looking for the top level parent. Change-Id: Ib23cae3a5576320435ae9b76dd618d1e5ae08b5d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
parent
6e649f9714
commit
7f29367c09
@ -1279,6 +1279,10 @@ void QWindow::setTransientParent(QWindow *parent)
|
|||||||
qWarning() << parent << "must be a top level window.";
|
qWarning() << parent << "must be a top level window.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (parent == this) {
|
||||||
|
qWarning() << "transient parent" << parent << "can not be same as window";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
d->transientParent = parent;
|
d->transientParent = parent;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user