Make qt_setDockMenu work and call it.

The application delegate code from Qt 4 implements
a non-working qt_setDockMenu. Correct the signature
of the applicationDockMenu method.

Change-Id: I6f531a78f91e0550b0e66cc4f2fa072006a030f4
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
Morten Johan Sørvig 2013-03-25 09:31:47 +01:00 committed by The Qt Project
parent c0065187d7
commit fc8759064c
2 changed files with 3 additions and 6 deletions

View File

@ -145,8 +145,9 @@ static void cleanupCocoaApplicationDelegate()
dockMenu = newMenu;
}
- (NSMenu *)applicationDockMenu
- (NSMenu *)applicationDockMenu:(NSApplication *)sender
{
Q_UNUSED(sender);
return [[dockMenu retain] autorelease];
}

View File

@ -192,11 +192,7 @@ 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.
if ([NSApp respondsToSelector:@selector(setDockMenu:)])
[NSApp setDockMenu: menu];
else
qWarning("Could not set dock menu: [NSApp setDockMenu] is not available.");
[NSApp QT_MANGLE_NAMESPACE(qt_setDockMenu): menu];
}
void *QCocoaNativeInterface::qMenuToNSMenu(QPlatformMenu *platformMenu)