diff options
author | Dmitry Shachnev <mitya57@gmail.com> | 2016-01-22 10:46:05 +0300 |
---|---|---|
committer | Dmitry Shachnev <mitya57@gmail.com> | 2016-02-09 16:54:58 +0000 |
commit | 488cf78e44947efffcf3ebde62d7fb2d4fbf4345 (patch) | |
tree | e8857d0de4d8eb21f57df5a8ed358709f70ef656 /src/platformsupport/dbusmenu/qdbusplatformmenu.cpp | |
parent | b30edc51535c389bdee9f676c4b5003d37242092 (diff) |
dbusmenu: Use proper toggle-type for items that are part of group
To achieve that, add a new virtual setHasExclusiveGroup() method to
QPlatformMenuItem class (optional because we don't want to break existing
platform themes), call it when converting QActions into platform menu items,
and use it when exporting the menu items over D-Bus.
Also, send ActionChanged event for actions when their group is changed, so
that the platform menus are updated too.
Change-Id: I8d951ace8c4097decec2a0154163e3672214effb
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Diffstat (limited to 'src/platformsupport/dbusmenu/qdbusplatformmenu.cpp')
-rw-r--r-- | src/platformsupport/dbusmenu/qdbusplatformmenu.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/platformsupport/dbusmenu/qdbusplatformmenu.cpp b/src/platformsupport/dbusmenu/qdbusplatformmenu.cpp index c813d8255b..70a908a9d6 100644 --- a/src/platformsupport/dbusmenu/qdbusplatformmenu.cpp +++ b/src/platformsupport/dbusmenu/qdbusplatformmenu.cpp @@ -61,6 +61,7 @@ QDBusPlatformMenuItem::QDBusPlatformMenuItem(quintptr tag) , m_isCheckable(false) , m_isChecked(false) , m_dbusID(nextDBusID++) + , m_hasExclusiveGroup(false) { menuItemsByID.insert(m_dbusID, this); } @@ -124,6 +125,11 @@ void QDBusPlatformMenuItem::setChecked(bool isChecked) m_isChecked = isChecked; } +void QDBusPlatformMenuItem::setHasExclusiveGroup(bool hasExclusiveGroup) +{ + m_hasExclusiveGroup = hasExclusiveGroup; +} + void QDBusPlatformMenuItem::setShortcut(const QKeySequence &shortcut) { m_shortcut = shortcut; |