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>
This commit is contained in:
parent
d7fea8e5d2
commit
5097e31030
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user