summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/controls/qquickmenu.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/controls/qquickmenu.cpp b/src/controls/qquickmenu.cpp
index 41f5833ed..385db3c0b 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;
+ }
}
}