diff options
author | Robert Griebl <robert.griebl@qt.io> | 2022-10-06 14:45:23 +0200 |
---|---|---|
committer | Robert Griebl <robert.griebl@qt.io> | 2022-10-17 15:53:32 +0200 |
commit | f7e2984a1a8ce6fbe933f3905ae79b39ff5438df (patch) | |
tree | 72b72357ffff86d486794df063eae14f0b68daab /src/widgets/widgets/qcombobox.cpp | |
parent | 3d6f5e95f0cdf6bc36b5f8483da0c14f3535bce2 (diff) |
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 <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/widgets/qcombobox.cpp')
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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(); |