summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformmenu.cpp
Commit message (Collapse)AuthorAgeFilesLines
* D-Bus system tray icon: submenus can be created after context menuShawn Rutledge2015-05-211-0/+5
| | | | | | | | | | | | | | | | | | | | QMenuPrivate::init() calls QPlatformTheme::createPlatformMenu() to create a platform menu, but on Linux, that returns null for now. QSystemTrayIcon::setContextMenu() results in recursive calls to QSystemTrayIconPrivate::addPlatformMenu() which then calls QDBusTrayIcon::createMenu() for the context menu and each submenu. However if a submenu is added afterwards, a corresponding platform menu is not immediately created. Now copyActionToPlatformItem() will detect and create the missing platform submenu, by calling a new method: DBusPlatformMenu::createSubMenu(). This is because there is no way of knowing that it's a tray-specific context menu (which is so far the only case in which we use DBusPlatformMenu). So, QPlatformMenu::createSubMenu() needs to exist as a new QPA interface for this use case. Task-number: QTBUG-45803 Change-Id: Ib319e873082196515ea0580d70d069099cf2c175 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Allow QPlatformSystemTrayIcon to create the QPlatformMenuMartin Gräßlin2014-02-171-0/+55
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>