summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@digia.com>2014-08-04 11:01:29 +0200
committerRichard Moe Gustavsen <richard.gustavsen@digia.com>2014-08-05 17:00:45 +0200
commit5097e310305beaa27d6b87699a04c43e598b6688 (patch)
tree1e42c45366b756f90f96e030042db22de90ceaf9 /src
parentd7fea8e5d2146af4df40b136c8265287f3a8a8c5 (diff)
QPlatformMenu: add MenuType enum
On mobile platforms several different popup menu types exist. E.g on iOS, you have a special popup just for selecting text. This patch will add a new enum that lets UI controls select/hint which one to use for a particular QPlatformMenu. It's likely that the enum needs to be extended later (DropdownMenu, PopoverMenu etc), but being able to specify the edit menu at least will do for now. Change-Id: I2aefa5eedb9429921560ac2b778a88721f153459 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qplatformmenu.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformmenu.h b/src/gui/kernel/qplatformmenu.h
index b88f2a7e84..f95fd4603e 100644
--- a/src/gui/kernel/qplatformmenu.h
+++ b/src/gui/kernel/qplatformmenu.h
@@ -98,6 +98,8 @@ class Q_GUI_EXPORT QPlatformMenu : public QObject
{
Q_OBJECT
public:
+ enum MenuType { DefaultMenu = 0, EditMenu };
+
virtual void insertMenuItem(QPlatformMenuItem *menuItem, QPlatformMenuItem *before) = 0;
virtual void removeMenuItem(QPlatformMenuItem *menuItem) = 0;
virtual void syncMenuItem(QPlatformMenuItem *menuItem) = 0;
@@ -112,6 +114,7 @@ public:
virtual void setVisible(bool visible) = 0;
virtual void setMinimumWidth(int width) { Q_UNUSED(width); }
virtual void setFont(const QFont &font) { Q_UNUSED(font); }
+ virtual void setMenuType(MenuType type) { Q_UNUSED(type); }
virtual void showPopup(const QWindow *parentWindow, QPoint pos, const QPlatformMenuItem *item)
{