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_p.h | |
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_p.h')
-rw-r--r-- | src/platformsupport/dbusmenu/qdbusplatformmenu_p.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/platformsupport/dbusmenu/qdbusplatformmenu_p.h b/src/platformsupport/dbusmenu/qdbusplatformmenu_p.h index 0ff424ec9a..f8316ef89d 100644 --- a/src/platformsupport/dbusmenu/qdbusplatformmenu_p.h +++ b/src/platformsupport/dbusmenu/qdbusplatformmenu_p.h @@ -97,6 +97,8 @@ public: void setCheckable(bool checkable) Q_DECL_OVERRIDE; bool isChecked() const { return m_isChecked; } void setChecked(bool isChecked) Q_DECL_OVERRIDE; + bool hasExclusiveGroup() const { return m_hasExclusiveGroup; } + void setHasExclusiveGroup(bool hasExclusiveGroup) Q_DECL_OVERRIDE; QKeySequence shortcut() const { return m_shortcut; } void setShortcut(const QKeySequence& shortcut) Q_DECL_OVERRIDE; void setIconSize(int size) Q_DECL_OVERRIDE { Q_UNUSED(size); } @@ -123,7 +125,8 @@ private: bool m_isCheckable : 1; bool m_isChecked : 1; int m_dbusID : 16; - int m_reserved : 7; + bool m_hasExclusiveGroup : 1; + int m_reserved : 6; QKeySequence m_shortcut; }; |