qt5base-lts/src
Martin Gräßlin 824f080468 Allow QPlatformSystemTrayIcon to create the QPlatformMenu
In case the QPlatformTheme does not provide a QPlatformMenu the
QPlatformSystemTrayIcon is not able to forward the menu because the
QPlatformMenu pointer passed to updateMenu is always null. Providing a
QPlatformMenu in the QPlatformTheme implementation should not be a
requirement for having the menu in the system tray icon. There are
cases where no QPlatformMenu should be created by the theme, e.g. if
the X11 implementation of QSystemTrayIcon gets provided by the xcb
plugin.

The change adds a virtual method to QPlatformSystemTrayIcon to create
a QPlatformMenu. This method is called from the QPA implementation of
QSystemTrayIcon if the QMenu's platformMenu is not present. Thus the
system tray icon is able to provide a custom implementation of the
menu. This gets installed through a new internal method in QMenu to set
the platform menu. It creates the required connections and sync the
state to the QMenu to the newly created QPlatformMenu.

Last but not least QPlatformMenu is extended by a method to create a
QPlatformMenuItem. The default implementation delegates to the platform
theme. This allows to provide the menu item implementation for the
system tray icon without providing the QPlatformMenuItem through the
platform theme.

Change-Id: I17234bd8bcf8c05f8bd786feff0cf8f860430e82
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-02-17 16:47:05 +01:00
..
3rdparty Update HarfBuzz-NG path on Mac 2014-02-13 09:35:29 +01:00
android Android: Add enablers for listening to activity results 2014-02-15 22:25:36 +01:00
angle Merge remote-tracking branch 'origin/stable' into dev 2014-02-07 13:07:25 +01:00
concurrent QtConcurrent: Workaround GCC bug 58800 in median calculation 2013-12-03 11:45:18 +01:00
corelib Remove a not required whitespace when writing JSON in compact format 2014-02-16 16:56:10 +01:00
dbus QDBus: replace arg-chain with multi-arg 2014-02-14 00:34:25 +01:00
gui Allow QPlatformSystemTrayIcon to create the QPlatformMenu 2014-02-17 16:47:05 +01:00
network Increase the number of concurrent DNS lookups. 2014-02-16 19:14:59 +01:00
opengl Dynamic GL switch on Windows 2014-02-14 10:51:44 +01:00
openglextensions Use BSD licensing for QtOpenGLExtensions instead of LGPL 2013-06-24 10:16:32 +02:00
platformsupport QOpenGLTextureBlitter: Remove Origin location for the Target rect 2014-02-16 11:06:19 +01:00
plugins [QNX] Don't deactivate windows focus 2014-02-16 20:21:59 +01:00
printsupport Merge remote-tracking branch 'origin/stable' into dev 2014-02-12 16:28:07 +01:00
sql Merge remote-tracking branch 'origin/stable' into dev 2014-02-07 13:07:25 +01:00
testlib Make the printing of complex Unicode in a QString prettier 2014-02-16 06:54:18 +01:00
tools Merge remote-tracking branch 'origin/stable' into dev 2014-02-12 16:28:07 +01:00
widgets Allow QPlatformSystemTrayIcon to create the QPlatformMenu 2014-02-17 16:47:05 +01:00
winmain WinRT winmain: handle -qdevel parameter for additional debugging tooling 2014-01-30 22:09:55 +01:00
xml expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
src.pro Dynamic GL switch on Windows 2014-02-14 10:51:44 +01:00