commit 1e10fced4ceb59455b19f5e054b480f91aad273d Author: Joerg Bornemann Date: Wed May 5 12:16:53 2010 +0200 WinCE: QMenuBar::triggered(QAction*) was emitted too often Calling QMenuPrivate::activateAction instead of QAction::activate makes use of the internal recursion guard and fixes this problem. Also emitting QMenuBar::triggered in the command-in-menu-bar case will QAction::activate do for us. Task-number: QTBUG-10358 Reviewed-by: thartman diff --git a/src/gui/widgets/qmenu_wince.cpp b/src/gui/widgets/qmenu_wince.cpp index ea313f1..37ff4c4 100644 --- a/src/gui/widgets/qmenu_wince.cpp +++ b/src/gui/widgets/qmenu_wince.cpp @@ -312,14 +312,13 @@ bool QMenuBarPrivate::wceEmitSignals(QList actions, uint comman { QAction *foundAction = 0; for (int i = 0; i < actions.size(); ++i) { - if (foundAction) - break; QWceMenuAction *action = actions.at(i); if (action->action->menu()) { foundAction = action->action->menu()->wceCommands(command); + if (foundAction) + break; } else if (action->command == command) { - emit q_func()->triggered(action->action); action->action->activate(QAction::Trigger); return true; } @@ -361,7 +360,7 @@ QAction *QMenuPrivate::wceCommands(uint command) foundAction = action->action->menu()->d_func()->wceCommands(command); } else if (action->command == command) { - action->action->activate(QAction::Trigger); + activateAction(action->action, QAction::Trigger); return action->action; } }