qt6-bb10/tests/auto/widgets/kernel
Tor Arne Vestbø 5ba0982b28 Don't set ExplicitShowHide on children when showing parent widget
As a result of using QWidget::setVisible to show the child widgets we
would end up also setting ExplicitShowHide. This is not in line with
the intent of ExplicitShowHide, which is to flag a widget as explicitly
shown/hidden by the developer, which in turn prevents Qt Widgets from
toggling WState_Hidden when the widget is reparented.

By using QWidgetPrivate::setVisible instead, we can show the child
without setting ExplicitShowHide.

As side effect of this is that we no longer reset WA_WState_Hidden
from QWidgetWindowPrivate::setVisible(). This is an issue when the
setVisible call comes as a result of destroying the QWidgetWindow,
as that is an implicit hide, and should not result in the widget
having WA_WState_Hidden. QWidget handles this case in hideChildren
by not calling QWidgetPrivate::setVisible -- instead doing its own
reset of WA_WState_Visible. We don't want to untangle this just yet,
so as a workaround we detect that the widget is already !isVisible(),
thanks to hideChildren having hidden it, and then skip the call
to QWidgetPrivate::setVisible that results from QWindow::destroy().

Task-number: QTBUG-121398
Pick-to: 6.7
Change-Id: Ib5b4d9c84f0569124c5f3ca2169cabff18934e2d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-01 15:28:56 +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 Don't set ExplicitShowHide on children when showing parent widget 2024-02-01 15:28:56 +01:00
qwidget_window QWidget: Clean up state that depends on QWindow from ~QWidgetWindow() 2024-01-23 12:56:54 +00: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 QWindowContainer: Don't embed a QWidget 2023-12-21 18:49:29 +00:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00