From c34c8a564ef029144db6d2be256de7e46f91199a Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 10 Oct 2016 21:43:05 +0200 Subject: QComboBox: add missing break in switch in keyPressEvent() If the Key_Space case falls through, it does because !d->lineEdit, which makes the following case dead code, because it is guarded by the same condition. Fix by adding the break, which ensures that if those two cases ever diverge, the code stays working by intention, not chance. Independently discovered by GCC 7 and Coverity. Coverity-Id: 11157 Change-Id: Id14114b4157549d0f6fa036e8aa2bf0fa5a863cf Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/widgets/widgets/qcombobox.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/widgets') diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 181671c493..450c27d573 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -3160,6 +3160,7 @@ void QComboBox::keyPressEvent(QKeyEvent *e) showPopup(); return; } + break; case Qt::Key_Enter: case Qt::Key_Return: case Qt::Key_Escape: -- cgit v1.2.3