Go to file
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
bin Merge "Merge remote-tracking branch 'origin/release' into stable" into refs/staging/stable 2013-06-15 22:39:25 +02:00
config.tests QNX: Add support for lgmon 2014-02-14 10:51:44 +01:00
dist Merge remote-tracking branch 'origin/stable' into dev 2014-02-12 16:28:07 +01:00
doc Merge remote-tracking branch 'origin/release' into stable 2014-01-27 18:58:04 +01:00
examples Dynamic GL switch on Windows 2014-02-14 10:51:44 +01:00
lib Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
mkspecs Initial support for the Intel Compiler 14.0 on OS X 2014-02-16 05:12:09 +01:00
qmake WinRT qmake vcproj: Fix icon locator 2014-02-11 18:53:10 +01:00
src Allow QPlatformSystemTrayIcon to create the QPlatformMenu 2014-02-17 16:47:05 +01:00
tests Remove a not required whitespace when writing JSON in compact format 2014-02-16 16:56:10 +01:00
tools Dynamic GL switch on Windows 2014-02-14 10:51:44 +01:00
util Introduce QChar::JoiningType enum and QChar::joiningType() method 2014-01-29 23:19:47 +01:00
.gitattributes Update the git-archive export options 2012-09-07 15:39:31 +02:00
.gitignore GitIgnore updates 2013-12-09 17:28:18 +01:00
.qmake.conf Enable -Werror for all of qtbase 2013-09-04 01:50:10 +02:00
.tag Update the git-archive export options 2012-09-07 15:39:31 +02:00
configure QNX: Add support for lgmon 2014-02-14 10:51:44 +01:00
configure.bat get rid of syncqt wrapper scripts 2013-05-13 21:54:48 +02:00
header.BSD Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
header.FDL Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
header.LGPL Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
header.LGPL-ONLY Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
INSTALL Doc: Update links in INSTALL file 2014-01-16 20:37:25 +01:00
LGPL_EXCEPTION.txt Change copyrights from Nokia to Digia 2012-09-22 19:20:11 +02:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.GPL Add the LICENSE.GPL file to the module referenced from license headers 2012-05-20 22:41:08 +02:00
LICENSE.LGPL Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
LICENSE.PREVIEW.COMMERCIAL Update LICENSE.PREVIEW.COMMERCIAL license 2013-06-03 20:04:26 +02:00
qtbase.pro QNX: Add support for lgmon 2014-02-14 10:51:44 +01:00
sync.profile generate qfeatures.h at build time 2013-10-29 15:37:58 +01:00