diff options
author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2014-06-20 19:02:20 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2014-08-04 15:58:19 +0200 |
commit | 29f4ed3d6a50800ff0fb93c12451d7f962958a1e (patch) | |
tree | 91c3ea9f400248a22dd4a979b02fb44cc0e7ae8c /src/controls/qquickmenu.cpp | |
parent | 288b0b64322c312a70f3d1692f2e3b0be2503ea2 (diff) | |
download | qtquickcontrols-29f4ed3d6a50800ff0fb93c12451d7f962958a1e.tar.gz |
QQuickMenu: dismiss platform menu, not only QQuickMenuPopupWindow
This patch will fill in the missing code path that tells a native
platform menu to dismiss when requested.
Change-Id: I2625fddd0a735ca9ec7fabaf783921a1f99caa1d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/controls/qquickmenu.cpp')
-rw-r--r-- | src/controls/qquickmenu.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/controls/qquickmenu.cpp b/src/controls/qquickmenu.cpp index 41f5833e..385db3c0 100644 --- a/src/controls/qquickmenu.cpp +++ b/src/controls/qquickmenu.cpp @@ -468,12 +468,16 @@ void QQuickMenu::__closeMenu() void QQuickMenu::__dismissMenu() { - QQuickMenuPopupWindow *topMenuWindow = m_popupWindow; - while (topMenuWindow) { - QQuickMenuPopupWindow *pw = qobject_cast<QQuickMenuPopupWindow *>(topMenuWindow->transientParent()); - if (!pw) - topMenuWindow->dismissPopup(); - topMenuWindow = pw; + if (m_platformMenu) { + m_platformMenu->dismiss(); + } else { + QQuickMenuPopupWindow *topMenuWindow = m_popupWindow; + while (topMenuWindow) { + QQuickMenuPopupWindow *pw = qobject_cast<QQuickMenuPopupWindow *>(topMenuWindow->transientParent()); + if (!pw) + topMenuWindow->dismissPopup(); + topMenuWindow = pw; + } } } |