diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2015-05-19 12:36:55 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@digia.com> | 2015-05-21 05:17:08 +0000 |
commit | d8bfd812c3383e24196588f5d3e1de4719fcac02 (patch) | |
tree | a852f31638a8ec0e9289db7fdb0ea610995c64d3 /src/gui/kernel/qplatformmenu.h | |
parent | 2858a3c91b745357c1fa99b49b24705a155c6609 (diff) |
D-Bus system tray icon: submenus can be created after context menu
QMenuPrivate::init() calls QPlatformTheme::createPlatformMenu() to
create a platform menu, but on Linux, that returns null for now.
QSystemTrayIcon::setContextMenu() results in recursive calls to
QSystemTrayIconPrivate::addPlatformMenu() which then calls
QDBusTrayIcon::createMenu() for the context menu and each submenu.
However if a submenu is added afterwards, a corresponding platform
menu is not immediately created. Now copyActionToPlatformItem()
will detect and create the missing platform submenu, by calling
a new method: DBusPlatformMenu::createSubMenu(). This is because
there is no way of knowing that it's a tray-specific context menu
(which is so far the only case in which we use DBusPlatformMenu).
So, QPlatformMenu::createSubMenu() needs to exist as a new
QPA interface for this use case.
Task-number: QTBUG-45803
Change-Id: Ib319e873082196515ea0580d70d069099cf2c175
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel/qplatformmenu.h')
-rw-r--r-- | src/gui/kernel/qplatformmenu.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformmenu.h b/src/gui/kernel/qplatformmenu.h index baa1e460d7..1022d0ed4a 100644 --- a/src/gui/kernel/qplatformmenu.h +++ b/src/gui/kernel/qplatformmenu.h @@ -123,6 +123,7 @@ public: virtual QPlatformMenuItem *menuItemForTag(quintptr tag) const = 0; virtual QPlatformMenuItem *createMenuItem() const; + virtual QPlatformMenu *createSubMenu() const; Q_SIGNALS: void aboutToShow(); void aboutToHide(); |