From 1e10fced4ceb59455b19f5e054b480f91aad273d Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 5 May 2010 12:16:53 +0200 Subject: 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 --- src/gui/widgets/qmenu_wince.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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; } } -- cgit v0.12