qt6-bb10/tests/auto
Axel Spoerl 78a3301372 QDialogButtonBox: Don't set focus in a dialog with StrongFocus children
A QDialogButtonBox with the first accept button becoming default, didn't
explicitly set focus on such a button in a QDialog.
d44413d526 implemented this missing
functionality. It set focus to the automatic default button, unless the
QDialog had a focusWidget() set.

That has caused a regression, in cases where
- the QDialog has a QWidget child with a Qt::StrongFocus policy, and
- the QDialog is not yet visible, so focusWidget() returns nullptr.

Amend d44413d526ec12ed83acd7343c2005782178c7ad:

Implement a helper in QWidgetPrivate, that returns true, if a child
with a given focus policy is found.

Do not set focus to a QDialogButtonBox's automatic default button, when
- not located inside a QDialog, or
- a focusWidget() exists, or
- the dialog has QWidget child with Qt::StrongFocus, that is not a
child of the QDialogButtonBox.

Add an autotest function.

Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-121514
Fixes: QTBUG-120049
Change-Id: I3c65ae36b56657f9af4a3a4b42f9b66e8bc5c534
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-07 23:00:33 +00:00
..
bic/data Add binary compatibility file for 6.6.0 2023-10-17 22:23:42 +03:00
cmake Add the support for custom definitions to the qt_manual_moc function 2024-02-23 20:41:30 +01:00
concurrent Correct license for tools files 2024-03-05 12:59:21 +01:00
corelib JNI: Fix error with overload resolution when passing string types 2024-03-06 13:00:19 +00:00
dbus Remove extra semi-colons 2024-02-06 20:17:18 +09:00
gui Add A2B tables, and PCSLab support to QIcc 2024-03-07 23:42:41 +01:00
guiapplauncher Turn the "concentriccircles" example into snippets, update screenshot 2023-12-14 20:06:32 +01:00
network Add a QHttpHeaders convenience method for unique header name setting 2024-03-07 23:38:09 +02:00
opengl tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00
other tst_toolsupport: make the i386 case really about i386 2024-03-06 11:09:16 +01:00
printsupport Change license for tests files 2024-02-04 09:56:42 +01:00
shared Change license for tests files 2024-02-04 09:56:42 +01:00
sql Change license for tests files 2024-02-04 09:56:42 +01:00
testlib Correct license for tools files 2024-03-05 12:59:21 +01:00
tools Long live QT_TECH_PREVIEW_API 2024-02-20 05:01:09 +01:00
wasm wasm: Temporarily disable selenium tests 2024-03-07 11:39:17 +01:00
widgets QDialogButtonBox: Don't set focus in a dialog with StrongFocus children 2024-03-07 23:00:33 +00:00
xml QtXml: fix leak in QDomText::splitText 2024-03-02 21:22:53 +01:00
CMakeLists.txt wasm: Add auto test corelib/io/qabstractfileengine 2024-02-23 19:11:05 +01:00
network-settings.h Change license for tests files 2024-02-04 09:56:42 +01:00