Guard usage of [NSApp setDockMenu].

setDockMenu is not documented an may disappear.

Closest documented replacement seems to be
[NSApplicationDelegate applicationDockMenu:]. It can't
be used as a direct replacement since it's a "virtual"
getter that the application delegate implements.

Change-Id: Id161196018057b75cbe7d6f6d2610c0932345c5f
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
bb10
Morten Johan Sørvig 2013-03-22 09:33:15 +01:00 committed by The Qt Project
parent 5ad615ae8c
commit 7b5ad88489
1 changed files with 4 additions and 1 deletions

View File

@ -191,7 +191,10 @@ void QCocoaNativeInterface::setDockMenu(QPlatformMenu *platformMenu)
QCocoaMenu *cocoaPlatformMenu = static_cast<QCocoaMenu *>(platformMenu);
NSMenu *menu = cocoaPlatformMenu->nsMenu();
// setDockMenu seems to be undocumented, but this is what Qt 4 did.
[NSApp setDockMenu: menu];
if ([NSApp respondsToSelector:@selector(setDockMenu:)])
[NSApp setDockMenu: menu];
else
qWarning("Could not set dock menu: [NSApp setDockMenu] is not available.");
}
void *QCocoaNativeInterface::qMenuToNSMenu(QPlatformMenu *platformMenu)