qt5base-lts/tests/auto/widgets/dialogs
Volker Hilsheimer 223066d431 Don't clear focus if setParent doesn't change the parent
QWidget::setParent might be called to change the window flags, without
changing the parent. For those cases, we don't have to clear the focus.

Decouple the newParent state from the wasCreated flag. In most places
where newParent was tested, wasCreated was either tested previously and
can't be false anyway, or the code executed is irrelevant for widgets
that are not yet created (there can't be a paint manager). In the
remaining case, test wasCreated explicitly to maintain existing logic.

Add test for the cases where the previous code broke the focus, both
for QWidget and QDialog.

Fixes: QTBUG-93005
Pick-to: 6.2
Change-Id: I39dc179c2d348054de3927aa8b69eecef4935511
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
2021-09-28 17:42:57 +02:00
..
qcolordialog Remove the qmake project files 2021-01-07 15:32:28 +01:00
qdialog Don't clear focus if setParent doesn't change the parent 2021-09-28 17:42:57 +02:00
qerrormessage Remove the qmake project files 2021-01-07 15:32:28 +01:00
qfiledialog tests: Use QT_TESTCASE_SOURCEDIR define 2021-08-11 21:03:56 +02:00
qfiledialog2 tests: Remove unused SRCDIR defines 2021-08-17 12:41:57 +00:00
qfontdialog testlib: Deprecate QWARN() in favor of qWarning() 2021-08-04 19:31:51 +02:00
qinputdialog Remove the qmake project files 2021-01-07 15:32:28 +01:00
qmessagebox macOS: Don't show QMessageBox::about(Qt) as modal windows 2021-09-09 15:10:36 +00:00
qprogressdialog Re-layout QProgressDialog when setting the cancel button 2021-04-19 09:22:04 +00:00
qsidebar Remove conditioning on Android embedded 2021-09-17 17:30:14 +02:00
qwizard Remove the qmake project files 2021-01-07 15:32:28 +01:00
CMakeLists.txt Android: exclude tests crashing at start 2020-11-16 13:35:44 +02:00