qt5base-lts/tests/auto
Volker Hilsheimer c95de359b4 QComboBox: Don't dereference potential nullptr, simplify
Amends a874087504, which tested whether
d->container is nullptr to decide whether to hide the popup, and then
dereferences d->container later without checking again. This raised a
correct static analyzer warning.

Simplify that logic. hidePopup() does nothing if there is no visible
container, and we don't want to accept() the cancel key if there isn't.
So the closeOnCancel logic isn't actually needed, we only need to accept
the ShortcutOverride to make sure that QComboBox sees the Cancel key
even if there is a shortcut registered, and then we can handle and
accept the cancel key to call hidePopup() only if the popup is visible.

Add test to verify that this interaction works as expected.

Pick-to: 6.4
Task-number: QTBUG-108908
Change-Id: I60d92b068f0f5139d629cf4a58e225512170df77
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-12-08 15:14:17 +01:00
..
bic/data Revert "Add binary compatibility file generated against 6.4.0" 2022-11-17 13:52:02 +00:00
cmake Move Some of the Private CMake Helper Scripts from bin/ to libexec/ 2022-12-05 18:02:59 +00:00
concurrent Temporarily skip tst_qtcuncurrentrun::pollForIsFinished in emulator 2022-11-30 18:01:47 +01:00
corelib tst_QDateTime: explain one test-case more carefully 2022-12-07 14:58:41 +01:00
dbus Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
gui Fix missing text when Harfbuzz fails to shape a substring 2022-12-05 07:55:43 +01:00
guiapplauncher
network tst_QNetworkReply: check whether we actually use six TCP connections in HTTP/1 2022-12-06 07:02:53 +01:00
opengl
other Blacklist tst_gestures on OpenSuSE 2022-11-24 09:06:47 +00:00
printsupport Port from qAsConst() to std::as_const() 2022-10-11 23:17:18 +02:00
shared Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
sql SQL/MySQL: fix handling of json column 2022-12-05 01:56:45 +00:00
testlib Use QString/QByteArray range erase() 2022-12-07 15:03:03 +02:00
tools moc: Output the "cloned" flag for methods 2022-11-27 12:47:30 +01:00
wasm Fix typo in QWasmWindowStack's name 2022-10-20 16:36:23 +02:00
widgets QComboBox: Don't dereference potential nullptr, simplify 2022-12-08 15:14:17 +01:00
xml Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
CMakeLists.txt Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
network-settings.h Use SPDX license identifiers 2022-05-16 16:37:38 +02:00