diff options
| author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2014-08-04 11:29:29 +0200 |
|---|---|---|
| committer | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2014-08-06 16:17:20 +0200 |
| commit | 42a5930a75b5b05926da8895faa228da9d1e20e5 (patch) | |
| tree | b88736d756ef6c41be1352de25ace2c297a42667 /src/controls/qquickmenu_p.h | |
| parent | 6c3d951e14e235477b95bace1e2a2c9e12e7a063 (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_p.h')
| -rw-r--r-- | src/controls/qquickmenu_p.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/controls/qquickmenu_p.h b/src/controls/qquickmenu_p.h index 73f5c5050..f20a87343 100644 --- a/src/controls/qquickmenu_p.h +++ b/src/controls/qquickmenu_p.h @@ -75,8 +75,12 @@ class QQuickMenu : public QQuickMenuText Q_PROPERTY(qreal __yOffset READ yOffset WRITE setYOffset) Q_PROPERTY(QQuickAction *__action READ action CONSTANT) Q_PROPERTY(QRect __popupGeometry READ popupGeometry NOTIFY __popupGeometryChanged) + Q_ENUMS(MenuType) public: + // MenuType must stay in sync with QPlatformMenu::MenuType + enum MenuType { DefaultMenu = 0, EditMenu }; + Q_INVOKABLE void popup(); Q_INVOKABLE QQuickMenuItem *addItem(QString); Q_INVOKABLE QQuickMenuItem *insertItem(int, QString); @@ -87,7 +91,7 @@ public: Q_INVOKABLE void removeItem(QQuickMenuBase *); Q_INVOKABLE void clear(); - Q_INVOKABLE void __popup(qreal x, qreal y, int atActionIndex = -1); + Q_INVOKABLE void __popup(qreal x, qreal y, int atActionIndex = -1, MenuType menuType = DefaultMenu); public Q_SLOTS: void __closeMenu(); |
