diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index 867526ff52..09a4c95469 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -37,6 +37,7 @@ #include "qcocoaautoreleasepool.h" #include +#include #include #include #include "qcocoaapplication.h" @@ -124,7 +125,8 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QCocoaMenuDelegate); QCocoaMenuItem *cocoaItem = reinterpret_cast([item tag]); QScopedLoopLevelCounter loopLevelCounter(QGuiApplicationPrivate::instance()->threadData); QGuiApplicationPrivate::modifier_buttons = [QNSView convertKeyModifiers:[NSEvent modifierFlags]]; - cocoaItem->activated(); + static QMetaMethod activatedSignal = QMetaMethod::fromSignal(&QCocoaMenuItem::activated); + activatedSignal.invoke(cocoaItem, Qt::QueuedConnection); } - (BOOL)validateMenuItem:(NSMenuItem*)menuItem