qt6-bb10/tests/auto/widgets
Tor Arne Vestbø 12203e94f5 QWidget: Clean up state that depends on QWindow from ~QWidgetWindow()
We were assuming that QWidget was in full control of QWidgetWindow
destruction, via deleteTLSysExtra(), and that we could limit any
cleanups to that function.

But in some situations QWidgetWindow is destructed from other code paths,
in which case we were left with dangling pointers to the QWidgetWindow
in both QTLWExtra, as well as the backingstore.

This can happen if there's a child widget hierarchy where there is not
a 1:1 mapping between QWidgets and QWindows, for example if the window
attribute WA_DontCreateNativeAncestors has been set. In this situation
our normal recursion into children in QWidget::destroy() stops at the
first widget without a window handle. When we then delete the top level
QWindow, the QWindow destructor will delete any child QWindows, which
includes our leaf QWidgetWindow.

We should probably fix up QWidget::destroy to continue looking for
children, even if we don't destroy the current child. But independently
of that we should make sure the QWidgetWindow cleans up when it's being
deleted, regardless of how it ended up there.

There's further room to clean up the deleteTLSysExtra() function and
friends, but that's been left for a later time.

Fixes: QTBUG-120509
Pick-to: 6.7 6.6 6.6.2 6.5
Change-Id: Ib691df164d7c9c83cb464c0a6bf3bc2116e8ca43
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-01-23 12:56:54 +00:00
..
dialogs QDialogButtonBox: Fix focus chain and default button assignment 2023-12-20 17:16:53 +01:00
effects Stabilize tst_QGraphicsEffect::draw() 2023-08-25 09:04:37 +02:00
graphicsview Skip test which resizes window in graphic scene while using EGLFS 2023-12-22 15:25:20 +00:00
itemviews Skip test which resizes window with EGLFS 2024-01-09 04:04:22 +01:00
kernel QWidget: Clean up state that depends on QWindow from ~QWidgetWindow() 2024-01-23 12:56:54 +00:00
styles Reset palette resolve mask in windows vista style 2023-09-05 10:59:00 +02:00
util Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
widgets QPushButton with a menu remains in sunken state after menu closed 2024-01-22 08:19:20 +01:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00