qt6-bb10/tests/auto/widgets/kernel
Tor Arne Vestbø 5b09d9e6d6 Sync QWindow visible state during QWidget destruction
A call to QWidget::destroy() will end up in QWindow::destroy(), which
calls QWindow::setVisible(false).

A call to QWindow::setVisible(false) on a widget's window will under
normal circumstances end up in QWidgetPrivate::setVisible(), which in
turn recurses back into QWindowPrivate::setVisible(), via
QWidgetPrivate::hide_helper(), ensuring that the QWindow internal
state is updated, visibleChanged emitted, and show/hide events sent.

Durin QWidget::destroy() we end up in QWindow::destroy(), which calls
QWindow::setVisible(false), but in this case the widget no longer has
Qt::WA_WState_Created, so the hide_helper() call is skipped, and the
corresponding QWindow is not kept in the loop.

To work around this we could have checked for windowHandle() instead
of Qt::WA_WState_Created before calling hide_helper(), but that had
many other side effects, so we opt for a more targeted fix.

Pick-to: 6.7 6.6 6.5
Change-Id: I68f80e5f7df9ee811afcd274a7ee4de31a110da5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-12-20 14:33:49 +01:00
..
qaction CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qactiongroup CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qapplication Debounce QDeferredDeleteEvents in QObject::deleteLater() 2023-12-15 18:21:22 +01:00
qboxlayout CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qformlayout Purge empty BLACKLIST files from tests 2023-11-24 18:09:16 +01:00
qgesturerecognizer tst_QGestureRecognizer: port away from Q_FOREACH 2023-08-07 23:56:10 +02:00
qgridlayout QtWidgets tests: port remaining users away from Q_FOREACH 2023-08-14 23:11:54 +03:00
qlayout CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qshortcut Use QtGui to match QWindow based shortcuts, even when QApplication is used 2023-10-11 20:32:05 +02:00
qsizepolicy CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qstackedlayout CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qtooltip Set correct content size for tool tip label 2023-12-15 19:42:19 +01:00
qwidget Sync QWindow visible state during QWidget destruction 2023-12-20 14:33:49 +01:00
qwidget_window Tests: remove blacklisted CIs no longer available 2023-12-06 22:07:44 +01:00
qwidgetaction CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qwidgetmetatype CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qwidgetrepaintmanager CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qwidgetsvariant CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
qwindowcontainer CMake: Make widgets tests standalone projects 2023-07-05 15:09:32 +02:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00