A Toplevel QWidget can hold a pointer to the screen where it will
eventually show contents, before a QWidgetWindow is created which then
takes precedence.
The screen member of QWindows is always kept up-to-date when a screen is
removed, but not the contents of a toplevel window. If a widget has
setScreen called but is never shown, it has potentially dangling pointer
which can cause issues in the future.
Pick-to: 6.7 6.5
Change-Id: Ia7c80549e8b3c90a75cdde745487e87ecddaca63
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d67acf94afffde6a71498be6e30447f3acf7558e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>