diff options
author | Tor Arne Vestbø <[email protected]> | 2023-11-04 11:17:30 +0100 |
---|---|---|
committer | Tor Arne Vestbø <[email protected]> | 2023-11-17 22:10:48 +0100 |
commit | 99c70de9a6943ed3f0a81be7b2a395f24ab567ba (patch) | |
tree | 0d912b8620c01770cb0e971506b9bfd033ff1373 /examples/opengl/contextinfo/main.cpp | |
parent | c94bcecb22bce80101de79f4b3c0aff143ff34b5 (diff) |
Add dedicated child and parent events for QWindow reparenting
When a QWindow is parented into another window, either via its constructor,
or via setParent(), we also update the QObject parent of the window. This
in turn sends ChildAdded and ChildRemoved events to the new and old parent
of the window, as well as ParentAboutToChange and ParentChange to the window
itself.
But at the point when these events are sent, the QWindow parent relationship
has not been fully established. We have not updated d->parentWindow, nor
have we propagated the parent relationship to the platform window.
This is problematic because clients can not use these events to react to
window parent changes synchronously. For example. trying to raise a child
window when added to a parent is not going to work, because at that point
the child window isn't a native child of the parent.
Instead of re-using the QObject events for QWindow, like QWidget does,
by delaying the events or sending them manually at a point when the
window parent relationship has been fully formed, we opt to add new
dedicated events.
Change-Id: I019c14eba444861f537e4f68ab3a82297f843cf7
Reviewed-by: Volker Hilsheimer <[email protected]>
Reviewed-by: Qt CI Bot <[email protected]>
Diffstat (limited to 'examples/opengl/contextinfo/main.cpp')
0 files changed, 0 insertions, 0 deletions