From 7fc567eda8a187e365f4c29c6e8f08440bf31218 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sat, 30 Jan 2016 17:21:55 +0100 Subject: Make popups work without ApplicationWindow, to some degree Using ApplicationWindow is highly recommended. First of all, with a plain Window, QQuickPopup attempts to set a high z-value, but cannot guarantee correct stacking order. Secondly, we cannot provide style- specific background dimming for modal popups, because it is styled as part of ApplicationWindow. Last but not least, QQuickPopup has to install a window-level event filter, which is far less efficient than how event handling done in QQuickOverlay. Change-Id: I08915abce7a1764177b92f7539eef77c054a405a Task-number: QTBUG-49921 Reviewed-by: J-P Nurmi --- src/templates/qquickcombobox.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/templates/qquickcombobox.cpp') diff --git a/src/templates/qquickcombobox.cpp b/src/templates/qquickcombobox.cpp index f4cb17af..dfb01e83 100644 --- a/src/templates/qquickcombobox.cpp +++ b/src/templates/qquickcombobox.cpp @@ -711,6 +711,10 @@ void QQuickComboBox::keyPressEvent(QKeyEvent *event) return; switch (event->key()) { + case Qt::Key_Escape: + if (d->isPopupVisible()) + event->accept(); + break; case Qt::Key_Space: if (!event->isAutoRepeat()) setPressed(true); -- cgit v1.2.3