qt5base-lts/tests/auto/widgets
Volker Hilsheimer 505ed52cd4 Dialogs: clean up native dialogs when object gets destroyed
QWidget::setVisible is virtual, and called via hide() by both the
QDialog and the QWidget destructor. A dialog that becomes invisible
when getting destroyed will at most execute the QDialog override.
Subclassing QDialog and overriding setVisible() to update the state
of the native platform dialog will not work, unless we explicitly
call hide() in the respective subclass's destructor.

Since e0bb9e81ab, QDialogPrivate::setVisible is
also virtual, and gets called by QDialog::setVisible. So the clean
solution is to move the implementation of the native dialog status
update into an override of QDialogPrivate::setVisible.

Add test that verifies that the transient parent of the dialog
becomes inactive when the (native) dialog shows (and skip if that
fails), and then becomes active again when the (native) dialog is
closed through the destructor of the Q*Dialog class. The test of
QFileDialog has to be skipped on Android for the same reason as the
widgetlessNativeDialog.

Fixes: QTBUG-116277
Pick-to: 6.6 6.5
Change-Id: Ie3f93980d8653b8d933bf70aac3ef90de606f0ef
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-09-06 23:12:33 +02:00
..
dialogs Dialogs: clean up native dialogs when object gets destroyed 2023-09-06 23:12:33 +02:00
effects Stabilize tst_QGraphicsEffect::draw() 2023-08-25 09:04:37 +02:00
graphicsview QtWidgets tests: port remaining users away from Q_FOREACH 2023-08-14 23:11:54 +03:00
itemviews QAbstractScrollArea: Don't include size of invisible scrollbars 2023-07-11 01:34:19 +02:00
kernel QtWidgets tests: port remaining users away from Q_FOREACH 2023-08-14 23:11:54 +03:00
styles Reset palette resolve mask in windows vista style 2023-09-05 10:59:00 +02:00
util Remove redundant QPair includes 2023-09-06 17:24:40 +00:00
widgets QCheckBox: add new checkStateChanged(Qt::CheckState) signal 2023-09-05 13:43:44 +00:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00