diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-01-30 17:21:55 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-01-30 22:13:11 +0000 |
commit | 7fc567eda8a187e365f4c29c6e8f08440bf31218 (patch) | |
tree | 9aabcb48b936d94f52369f8f110fe7cd916f2af1 /src/templates/qquickmenu.cpp | |
parent | cb86fefb321a05eb50b905a696401542acf7d441 (diff) |
Make popups work without ApplicationWindow, to some degreev5.6.0-rc1v5.6.0
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 <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/templates/qquickmenu.cpp')
-rw-r--r-- | src/templates/qquickmenu.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/templates/qquickmenu.cpp b/src/templates/qquickmenu.cpp index 692395ff..d3fc88d9 100644 --- a/src/templates/qquickmenu.cpp +++ b/src/templates/qquickmenu.cpp @@ -489,11 +489,8 @@ void QQuickMenu::contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) bool QQuickMenu::eventFilter(QObject *object, QEvent *event) { Q_D(QQuickMenu); - if (d->contentModel->count() == 0) - return false; - - if (object != d->contentItem || event->type() != QEvent::KeyRelease) - return false; + if (object != d->contentItem || event->type() != QEvent::KeyRelease || d->contentModel->count() == 0) + return QQuickPopup::eventFilter(object, event); // QTBUG-17051 // Work around the fact that ListView has no way of distinguishing between @@ -517,7 +514,7 @@ bool QQuickMenu::eventFilter(QObject *object, QEvent *event) break; } - return false; + return QQuickPopup::eventFilter(object, event); } QT_END_NAMESPACE |