diff --git a/src/Gui/Action.cpp b/src/Gui/Action.cpp index 3f7d3d6a2654c..258155395f2b1 100644 --- a/src/Gui/Action.cpp +++ b/src/Gui/Action.cpp @@ -273,8 +273,9 @@ 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->addActions(_group->actions()); } else if (w->inherits("QToolBar")) { diff --git a/src/Gui/Command.cpp b/src/Gui/Command.cpp index a597bf591988e..db6511b9d6ad9 100644 --- a/src/Gui/Command.cpp +++ b/src/Gui/Command.cpp @@ -1020,6 +1020,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 0830670c10245..aa3c78910604c 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; }