summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/themes
diff options
context:
space:
mode:
authorDmitry Shachnev <mitya57@gmail.com>2016-02-27 20:55:41 +0300
committerDmitry Shachnev <mitya57@gmail.com>2016-03-21 21:21:30 +0000
commite4d79e1fdeb6b26ba0b12b578daacf7cd672b960 (patch)
tree7eef57661c0a5a1fc06eb27f44d7beb5dbf85a41 /src/platformsupport/themes
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 <jpnurmi@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Diffstat (limited to 'src/platformsupport/themes')
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes.cpp21
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes_p.h3
2 files changed, 0 insertions, 24 deletions
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index aee12eed76..720b032ea5 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -191,13 +191,6 @@ QStringList QGenericUnixTheme::xdgIconThemePaths()
}
#ifndef QT_NO_DBUS
-QPlatformMenu *QGenericUnixTheme::createPlatformMenu() const
-{
- if (isDBusGlobalMenuAvailable())
- return new QDBusPlatformMenu();
- return nullptr;
-}
-
QPlatformMenuBar *QGenericUnixTheme::createPlatformMenuBar() const
{
if (isDBusGlobalMenuAvailable())
@@ -594,13 +587,6 @@ QPlatformTheme *QKdeTheme::createKdeTheme()
}
#ifndef QT_NO_DBUS
-QPlatformMenu *QKdeTheme::createPlatformMenu() const
-{
- if (isDBusGlobalMenuAvailable())
- return new QDBusPlatformMenu();
- return nullptr;
-}
-
QPlatformMenuBar *QKdeTheme::createPlatformMenuBar() const
{
if (isDBusGlobalMenuAvailable())
@@ -706,13 +692,6 @@ QString QGnomeTheme::gtkFontName() const
}
#ifndef QT_NO_DBUS
-QPlatformMenu *QGnomeTheme::createPlatformMenu() const
-{
- if (isDBusGlobalMenuAvailable())
- return new QDBusPlatformMenu();
- return nullptr;
-}
-
QPlatformMenuBar *QGnomeTheme::createPlatformMenuBar() const
{
if (isDBusGlobalMenuAvailable())
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
index b7e0d53d6f..952658e130 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
@@ -86,7 +86,6 @@ public:
static QStringList xdgIconThemePaths();
#ifndef QT_NO_DBUS
- QPlatformMenu *createPlatformMenu() const Q_DECL_OVERRIDE;
QPlatformMenuBar *createPlatformMenuBar() const Q_DECL_OVERRIDE;
#endif
#if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON)
@@ -112,7 +111,6 @@ public:
const QFont *font(Font type) const Q_DECL_OVERRIDE;
#ifndef QT_NO_DBUS
- QPlatformMenu *createPlatformMenu() const Q_DECL_OVERRIDE;
QPlatformMenuBar *createPlatformMenuBar() const Q_DECL_OVERRIDE;
#endif
#if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON)
@@ -136,7 +134,6 @@ public:
virtual QString gtkFontName() const;
#ifndef QT_NO_DBUS
- QPlatformMenu *createPlatformMenu() const Q_DECL_OVERRIDE;
QPlatformMenuBar *createPlatformMenuBar() const Q_DECL_OVERRIDE;
#endif
#if !defined(QT_NO_DBUS) && !defined(QT_NO_SYSTEMTRAYICON)