From 12e84748aae0d5b85a502ca2646b6bb57b2f4363 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 9 May 2013 01:46:52 +0200 Subject: Ensure the hovered signal is emitted for the action and menu for Cocoa In the Cocoa platform plugin the hovered signal() was not being emitted for the corresponding QMenu. This now ensures it is emitted for the action itself and its QMenu. Task-number: QTBUG-30841 Change-Id: I3cfe634a71de7b55550e2561eb1c6a939536216d Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoamenu.mm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index c5c5c132bc..18e17a340d 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -96,6 +96,16 @@ static inline QT_MANGLE_NAMESPACE(QCocoaMenuLoader) *getMenuLoader() return self; } + +- (void)menu:(NSMenu*)menu willHighlightItem:(NSMenuItem*)item +{ + Q_UNUSED(menu); + if (item && [item tag]) { + QCocoaMenuItem *cocoaItem = reinterpret_cast([item tag]); + cocoaItem->hovered(); + } +} + - (void) menuWillOpen:(NSMenu*)m { Q_UNUSED(m); -- cgit v1.2.3