path: root/src/platformsupport/dbusmenu/qdbusmenubar_p.h
diff options
authorDmitry Shachnev <>2016-02-27 20:55:41 +0300
committerDmitry Shachnev <>2016-03-21 21:21:30 +0000
commite4d79e1fdeb6b26ba0b12b578daacf7cd672b960 (patch)
tree7eef57661c0a5a1fc06eb27f44d7beb5dbf85a41 /src/platformsupport/dbusmenu/qdbusmenubar_p.h
parentd804ea01f06fcde5af9a85db77ef87934b709ce7 (diff)
Add createMenu() method to QPlatformMenuBar
The D-Bus platform menus are only useful inside menu bars and system tray icons, and should not be created for other cases (like the context menus). This adds a new virtual createMenu() method to QPlatformMenuBar class, analogous to the already existing QPlatformSystemTrayIcon::createMenu() method, and adds support for it to QMenuBar. The D-Bus platform menus are now created from QDBusMenuBar class. As an additional benefit, we no longer have to check whether the AppMenu Registrar service is present for every created menu, and check it only once (this should speed things a bit up). Change-Id: Ic7d94e58a501ab9d2954aeb342ebd46ef8e62d49 Reviewed-by: J-P Nurmi <> Reviewed-by: Friedemann Kleint <> Reviewed-by: Shawn Rutledge <>
Diffstat (limited to 'src/platformsupport/dbusmenu/qdbusmenubar_p.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/src/platformsupport/dbusmenu/qdbusmenubar_p.h b/src/platformsupport/dbusmenu/qdbusmenubar_p.h
index 157befe9e3..8266a395f5 100644
--- a/src/platformsupport/dbusmenu/qdbusmenubar_p.h
+++ b/src/platformsupport/dbusmenu/qdbusmenubar_p.h
@@ -72,6 +72,7 @@ public:
void syncMenu(QPlatformMenu *menu) Q_DECL_OVERRIDE;
void handleReparent(QWindow *newParentWindow) Q_DECL_OVERRIDE;
QPlatformMenu *menuForTag(quintptr tag) const Q_DECL_OVERRIDE;
+ QPlatformMenu *createMenu() const Q_DECL_OVERRIDE;
QDBusPlatformMenu *m_menu;