From b6bc41f9dfe2223f9f3abd9cde848c669d29d152 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Wed, 17 Feb 2016 15:06:41 -0800 Subject: QMenu: Add delegate related notes to OS X-only API Change-Id: I88bb4fdb2c11da0602e4c9f6637bbdeaa715aba0 Reviewed-by: Jake Petroules --- src/widgets/widgets/qmenu_mac.mm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/widgets/widgets/qmenu_mac.mm') diff --git a/src/widgets/widgets/qmenu_mac.mm b/src/widgets/widgets/qmenu_mac.mm index 5322a8f3f5..184e4d7bb1 100644 --- a/src/widgets/widgets/qmenu_mac.mm +++ b/src/widgets/widgets/qmenu_mac.mm @@ -67,8 +67,11 @@ inline QPlatformNativeInterface::NativeResourceForIntegrationFunction resolvePla \since 5.2 Returns the native NSMenu for this menu. Available on OS X only. + + \note Qt sets the delegate on the native menu. If you need to set your own + delegate, make sure you save the original one and forward any calls to it. */ -NSMenu* QMenu::toNSMenu() +NSMenu *QMenu::toNSMenu() { // Call into the cocoa platform plugin: qMenuToNSMenu(platformMenu()) QPlatformNativeInterface::NativeResourceForIntegrationFunction function = resolvePlatformFunction("qmenutonsmenu"); @@ -133,8 +136,11 @@ void QMenuPrivate::moveWidgetToPlatformItem(QWidget *widget, QPlatformMenuItem* \since 5.2 Returns the native NSMenu for this menu bar. Available on OS X only. + + \note Qt may set the delegate on the native menu bar. If you need to set your + own delegate, make sure you save the original one and forward any calls to it. */ -NSMenu* QMenuBar::toNSMenu() +NSMenu *QMenuBar::toNSMenu() { // Call into the cocoa platform plugin: qMenuBarToNSMenu(platformMenuBar()) QPlatformNativeInterface::NativeResourceForIntegrationFunction function = resolvePlatformFunction("qmenubartonsmenu"); -- cgit v1.2.3