diff --git a/src/Gui/Action.cpp b/src/Gui/Action.cpp index cbc94c304a..cdc92643d1 100644 --- a/src/Gui/Action.cpp +++ b/src/Gui/Action.cpp @@ -252,8 +252,10 @@ void ActionGroup::addTo(QWidget *w) // and adding this action to the widget doesn't work. if (_dropDown) { if (w->inherits("QMenu")) { - QMenu* menu = qobject_cast(w); - menu = menu->addMenu(_action->text()); + QMenu *menu = new QMenu(w); + QAction* action = qobject_cast(w)->addMenu(menu); + action->setMenuRole(_action->menuRole()); + menu->setTitle(_action->text()); menu->addActions(_group->actions()); } else if (w->inherits("QToolBar")) { diff --git a/src/Gui/Command.cpp b/src/Gui/Command.cpp index 983f423b6d..e5a735232b 100644 --- a/src/Gui/Command.cpp +++ b/src/Gui/Command.cpp @@ -995,6 +995,7 @@ Command *GroupCommand::addCommand(const char *name) { Action * GroupCommand::createAction(void) { ActionGroup* pcAction = new ActionGroup(this, getMainWindow()); + pcAction->setMenuRole(QAction::NoRole); pcAction->setDropDownMenu(true); pcAction->setExclusive(false); pcAction->setCheckable(true); diff --git a/src/Gui/CommandStd.cpp b/src/Gui/CommandStd.cpp index e3551d2375..0a6698f08e 100644 --- a/src/Gui/CommandStd.cpp +++ b/src/Gui/CommandStd.cpp @@ -377,6 +377,7 @@ Action * StdCmdDlgPreferences::createAction(void) { Action *pcAction = Command::createAction(); pcAction->setMenuRole(QAction::PreferencesRole); + return pcAction; }