aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-04-23 14:05:25 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2018-04-23 19:37:49 +0000
commitdef92f7b657ee9247beffffcb0cadd1eca8be3c6 (patch)
treec804d09050f9ba05a47aa6d27f652261b24f7f5f /src
parentec0ad4ca9207acbc524a109ffbacb6cbb0fa18a8 (diff)
ComboBox: don't block the escape/back key
Accept Key_Escape or Key_Back only if it actually close the popup. If the popup is not visible, the key is not handled, and the event should therefore propagate (and potentially close the app on Android). Change-Id: Ibdb0cab8e0ac47005c5112f7ca4882288f1f5a17 Task-number: QTBUG-67684 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quicktemplates2/qquickcombobox.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/quicktemplates2/qquickcombobox.cpp b/src/quicktemplates2/qquickcombobox.cpp
index d3226baf..4d5efece 100644
--- a/src/quicktemplates2/qquickcombobox.cpp
+++ b/src/quicktemplates2/qquickcombobox.cpp
@@ -1624,9 +1624,11 @@ void QQuickComboBox::keyReleaseEvent(QKeyEvent *event)
break;
case Qt::Key_Escape:
case Qt::Key_Back:
- d->hidePopup(false);
- setPressed(false);
- event->accept();
+ if (d->isPopupVisible()) {
+ d->hidePopup(false);
+ setPressed(false);
+ event->accept();
+ }
break;
default:
break;