From f7e2984a1a8ce6fbe933f3905ae79b39ff5438df Mon Sep 17 00:00:00 2001 From: Robert Griebl Date: Thu, 6 Oct 2022 14:45:23 +0200 Subject: Fix QComboBox supressing a QDialogs default button Commit 64ffe0a broke pressing RETURN aka. the default key in a dialog to close it, when a read-only QComboBox has the focus. Before that patch, Enter + Return were actively ignore()d, but this code path was removed, resulting in those keys to be auto-accepted. Fixes: QTBUG-107262 Pick-to: 6.4 Change-Id: I3dd8dca7d2f9d94f5172adc92ef508fe81c0df57 Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qcombobox.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/widgets/widgets/qcombobox.cpp') diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index d4a33c5dc0..7c5de0e2cb 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -3212,6 +3212,8 @@ void QComboBox::keyPressEvent(QKeyEvent *e) return; } break; + case Qt::Key_Enter: + case Qt::Key_Return: case Qt::Key_Escape: if (!d->lineEdit) e->ignore(); -- cgit v1.2.3