qt5base-lts/tests/auto
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
..
bic/data Add binary compatibility files for 6.1 2021-09-03 13:41:25 +00:00
cmake CMake: Bump almost all cmake_minimum_required calls to 3.16 2021-09-22 19:36:49 +02:00
concurrent Compile autotests for Integrity 2021-09-20 17:29:04 +03:00
corelib Q{Elf,Mach}Parser: simplify the return codes 2021-09-24 20:16:05 -07:00
dbus tests: Remove unused SRCDIR defines 2021-08-17 12:41:57 +00:00
gui Preserve QImage metadata when converting format with color table 2021-09-28 15:59:31 +02:00
guiapplauncher Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
network QLocalSocket: reorder device closing 2021-09-21 21:40:27 +00:00
opengl Remove the qmake project files 2021-01-07 15:32:28 +01:00
other Add testing of QPdfWriter output to QPainter lancelot test 2021-09-28 17:06:57 +02:00
printsupport Compile autotests for Integrity 2021-09-20 17:29:04 +03:00
shared Remove false Q_UNREACHABLE from shaping code 2021-02-03 09:44:44 +01:00
sql testlib: Deprecate QWARN() in favor of qWarning() 2021-08-04 19:31:51 +02:00
testlib Add missing dependencies of tests on their helper programs 2021-09-17 12:57:25 +02:00
tools Support QNX QCC compiler 2021-09-16 20:54:17 +03:00
widgets Don't clear focus if setParent doesn't change the parent 2021-09-28 17:42:57 +02:00
xml tst_qdom: clean-up the code enabled only before Qt 6 2021-01-15 15:22:08 +01:00
CMakeLists.txt CMake: Build a subset of tests when targeting iOS in the CI 2021-08-26 16:40:15 +02:00
network-settings.h Replace QtTest headers with QTest 2020-12-22 15:20:30 +01:00