qt6-bb10/tests/auto/widgets/widgets
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
..
qabstractbutton Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qabstractscrollarea Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qabstractslider Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qabstractspinbox Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qbuttongroup Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qcalendarwidget Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qcheckbox Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qcombobox QComboBox: Don't dereference potential nullptr, simplify 2022-12-08 15:14:17 +01:00
qcommandlinkbutton Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qdatetimeedit Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qdial Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qdialogbuttonbox Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qdockwidget Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qdoublespinbox Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qfocusframe Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qfontcombobox Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qframe Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qgroupbox Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qkeysequenceedit Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qlabel Deprecate QApplication::setActiveWindow() and mark as internal 2022-08-27 20:22:29 +02:00
qlcdnumber Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qlineedit Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qmainwindow Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qmdiarea Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qmdisubwindow Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qmenu Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qmenubar Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qopenglwidget Blacklist tst_QOpenGLWidget on Ubuntu, RHEL and OpenSuSE 2022-11-24 09:06:50 +00:00
qplaintextedit Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qprogressbar Deprecate QApplication::setActiveWindow() and mark as internal 2022-08-27 20:22:29 +02:00
qpushbutton Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qradiobutton Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qscrollarea Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qscrollbar Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qsizegrip Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qslider Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qspinbox Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qsplashscreen Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qsplitter Introduce QT_NO_AS_CONST and mark QtBase free of it 2022-11-27 17:14:28 +01:00
qstackedwidget Deprecate QApplication::setActiveWindow() and mark as internal 2022-08-27 20:22:29 +02:00
qstatusbar Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qtabbar Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qtabwidget Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qtextbrowser Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qtextedit Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qtoolbar Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
qtoolbox Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qtoolbutton Port from container::count() and length() to size() - V5 2022-11-03 14:59:24 +01:00
CMakeLists.txt Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00