From 488cf78e44947efffcf3ebde62d7fb2d4fbf4345 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Fri, 22 Jan 2016 10:46:05 +0300 Subject: 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 --- src/widgets/widgets/qmenu.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/widgets/widgets/qmenu.cpp') diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index ae20159473..514cb1a8c9 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -3231,6 +3231,7 @@ static void copyActionToPlatformItem(const QAction *action, QPlatformMenuItem *i item->setShortcut(action->shortcut()); item->setCheckable(action->isCheckable()); item->setChecked(action->isChecked()); + item->setHasExclusiveGroup(action->actionGroup() && action->actionGroup()->isExclusive()); item->setFont(action->font()); item->setRole((QPlatformMenuItem::MenuRole) action->menuRole()); item->setEnabled(action->isEnabled()); -- cgit v1.2.3