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:
parent
c0065187d7
commit
fc8759064c
@ -145,8 +145,9 @@ static void cleanupCocoaApplicationDelegate()
|
||||
dockMenu = newMenu;
|
||||
}
|
||||
|
||||
- (NSMenu *)applicationDockMenu
|
||||
- (NSMenu *)applicationDockMenu:(NSApplication *)sender
|
||||
{
|
||||
Q_UNUSED(sender);
|
||||
return [[dockMenu retain] autorelease];
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user