From e4d79e1fdeb6b26ba0b12b578daacf7cd672b960 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Sat, 27 Feb 2016 20:55:41 +0300 Subject: 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 --- src/widgets/widgets/qmenubar_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/widgets/widgets/qmenubar_p.h') diff --git a/src/widgets/widgets/qmenubar_p.h b/src/widgets/widgets/qmenubar_p.h index 04f608d22f..05b1878c20 100644 --- a/src/widgets/widgets/qmenubar_p.h +++ b/src/widgets/widgets/qmenubar_p.h @@ -143,6 +143,7 @@ public: QBasicTimer autoReleaseTimer; QPlatformMenuBar *platformMenuBar; + QPlatformMenu *getPlatformMenu(QAction *action); inline int indexOf(QAction *act) const { return q_func()->actions().indexOf(act); } -- cgit v1.2.3