summaryrefslogtreecommitdiffstats
path: root/src/controls/qquickmenu.cpp
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2014-08-04 11:29:29 +0200
committerRichard Moe Gustavsen <richard.gustavsen@digia.com>2014-08-06 16:17:20 +0200
commit42a5930a75b5b05926da8895faa228da9d1e20e5 (patch)
treeb88736d756ef6c41be1352de25ace2c297a42667 /src/controls/qquickmenu.cpp
parent6c3d951e14e235477b95bace1e2a2c9e12e7a063 (diff)
QQuickMenu: add enum MenuType that reflects QPlatformMenu::MenuType
On mobile platforms several different popup menu types exist. E.g on iOS, you have a special popup just for selecting text. A recent patch added to QtBase added a new enum to QPlatformMenu that lets UI controls select/hint which one to use. This patch adds the same enum to QQuickMenu so that we can control this from Controls as well. Change-Id: Ibf4bdc84577b5a6527021b1cb15578b56bb4a92e Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/controls/qquickmenu.cpp')
-rw-r--r--src/controls/qquickmenu.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/controls/qquickmenu.cpp b/src/controls/qquickmenu.cpp
index 385db3c0b..f1c4e24b2 100644
--- a/src/controls/qquickmenu.cpp
+++ b/src/controls/qquickmenu.cpp
@@ -388,7 +388,7 @@ void QQuickMenu::popup()
__popup(mousePos.x(), mousePos.y());
}
-void QQuickMenu::__popup(qreal x, qreal y, int atItemIndex)
+void QQuickMenu::__popup(qreal x, qreal y, int atItemIndex, MenuType menuType)
{
if (popupVisible()) {
__closeMenu();
@@ -415,6 +415,7 @@ void QQuickMenu::__popup(qreal x, qreal y, int atItemIndex)
screenPosition.rx() -= qMax(static_cast<qreal>(m_minimumWidth), m_menuContentItem->width());
screenPosition = visualItem()->mapToScene(screenPosition);
}
+ m_platformMenu->setMenuType(QPlatformMenu::MenuType(menuType));
m_platformMenu->showPopup(parentWindow, screenPosition.toPoint(), atItem ? atItem->platformItem() : 0);
} else {
m_popupWindow = new QQuickMenuPopupWindow();