From 5097e310305beaa27d6b87699a04c43e598b6688 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 4 Aug 2014 11:01:29 +0200 Subject: 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 Reviewed-by: Gabriel de Dietrich --- src/gui/kernel/qplatformmenu.h | 3 +++ 1 file changed, 3 insertions(+) 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) { -- cgit v1.2.3