diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-01-07 09:58:17 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2010-01-07 10:11:55 (GMT) |
commit | 5339d24dc09525a67295adf98e9042971f4a9b2e (patch) | |
tree | 5733357b4add74b6b485152d671aadc7d5a9ae6c /src/gui/widgets/qmenu_mac.mm | |
parent | 4d786b6961f23af6edccf75c6b41267285fefcda (diff) | |
download | Qt-5339d24dc09525a67295adf98e9042971f4a9b2e.zip Qt-5339d24dc09525a67295adf98e9042971f4a9b2e.tar.gz Qt-5339d24dc09525a67295adf98e9042971f4a9b2e.tar.bz2 |
QMenuBar::triggered(QAction *) fires twice in Mac (carbon).
The signal was being emitted both from the carbon event handler and the
platform independent code of QMenu. The one in the event handler is now
removed.
Task-number: 6741
Reviewed-by: Richard Moe Gustavsen
Diffstat (limited to 'src/gui/widgets/qmenu_mac.mm')
-rw-r--r-- | src/gui/widgets/qmenu_mac.mm | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index 30bbd31..99301ee 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -231,7 +231,7 @@ bool qt_mac_activate_action(MenuRef menu, uint command, QAction::ActionEvent act //now walk up firing for each "caused" widget (like in the platform independent menu) QWidget *caused = 0; - if (GetMenuItemProperty(menu, 0, kMenuCreatorQt, kMenuPropertyCausedQWidget, sizeof(caused), 0, &caused) == noErr) { + if (action_e == QAction::Hover && GetMenuItemProperty(menu, 0, kMenuCreatorQt, kMenuPropertyCausedQWidget, sizeof(caused), 0, &caused) == noErr) { MenuRef caused_menu = 0; if (QMenu *qmenu2 = qobject_cast<QMenu*>(caused)) caused_menu = qmenu2->macMenu(); @@ -244,25 +244,17 @@ bool qt_mac_activate_action(MenuRef menu, uint command, QAction::ActionEvent act QWidget *widget = 0; GetMenuItemProperty(caused_menu, 0, kMenuCreatorQt, kMenuPropertyQWidget, sizeof(widget), 0, &widget); if (QMenu *qmenu = qobject_cast<QMenu*>(widget)) { - if (action_e == QAction::Trigger) { - emit qmenu->triggered(action->action); - } else if (action_e == QAction::Hover) { - action->action->showStatusText(widget); - emit qmenu->hovered(action->action); - } + action->action->showStatusText(widget); + emit qmenu->hovered(action->action); } else if (QMenuBar *qmenubar = qobject_cast<QMenuBar*>(widget)) { - if (action_e == QAction::Trigger) { - emit qmenubar->triggered(action->action); - } else if (action_e == QAction::Hover) { - action->action->showStatusText(widget); - emit qmenubar->hovered(action->action); - } + action->action->showStatusText(widget); + emit qmenubar->hovered(action->action); break; //nothing more.. } //walk up if (GetMenuItemProperty(caused_menu, 0, kMenuCreatorQt, kMenuPropertyCausedQWidget, - sizeof(caused), 0, &caused) != noErr) + sizeof(caused), 0, &caused) != noErr) break; if (QMenu *qmenu2 = qobject_cast<QMenu*>(caused)) caused_menu = qmenu2->macMenu(); |