QCocoaNSMenuItem: Add default initializer
Just tidying code a bit. Change-Id: I492535094533ee307d757bfbbcb41376291f8878 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>bb10
parent
388c4ef9f7
commit
446916c927
|
|
@ -96,7 +96,7 @@
|
|||
appItem.submenu = appMenu;
|
||||
|
||||
// About Application
|
||||
aboutItem = [[QCocoaNSMenuItem alloc] initWithPlatformMenuItem:nullptr];
|
||||
aboutItem = [[QCocoaNSMenuItem alloc] init];
|
||||
aboutItem.title = [@"About " stringByAppendingString:appName];
|
||||
// FIXME This seems useless since barely adding a QAction
|
||||
// with AboutRole role will reset the target/action
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
[appMenu addItem:aboutItem];
|
||||
|
||||
// About Qt (shameless self-promotion)
|
||||
aboutQtItem = [[QCocoaNSMenuItem alloc] initWithPlatformMenuItem:nullptr];
|
||||
aboutQtItem = [[QCocoaNSMenuItem alloc] init];
|
||||
aboutQtItem.title = @"About Qt";
|
||||
// Disable until a QAction is associated
|
||||
aboutQtItem.enabled = NO;
|
||||
|
|
@ -118,7 +118,7 @@
|
|||
[appMenu addItem:[NSMenuItem separatorItem]];
|
||||
|
||||
// Preferences
|
||||
preferencesItem = [[QCocoaNSMenuItem alloc] initWithPlatformMenuItem:nullptr];
|
||||
preferencesItem = [[QCocoaNSMenuItem alloc] init];
|
||||
preferencesItem.title = @"Preferences…";
|
||||
preferencesItem.keyEquivalent = @",";
|
||||
// Disable until a QAction is associated
|
||||
|
|
@ -168,7 +168,7 @@
|
|||
[appMenu addItem:[NSMenuItem separatorItem]];
|
||||
|
||||
// Quit Application
|
||||
quitItem = [[QCocoaNSMenuItem alloc] initWithPlatformMenuItem:nullptr];
|
||||
quitItem = [[QCocoaNSMenuItem alloc] init];
|
||||
quitItem.title = [@"Quit " stringByAppendingString:appName];
|
||||
quitItem.keyEquivalent = @"q";
|
||||
// This will remain true until synced with a QCocoaMenuItem.
|
||||
|
|
@ -319,7 +319,6 @@
|
|||
|
||||
- (void)qtTranslateApplicationMenu
|
||||
{
|
||||
|
||||
#ifndef QT_NO_TRANSLATION
|
||||
[servicesItem setTitle:qt_mac_applicationmenu_string(ServicesAppMenuItem).toNSString()];
|
||||
[hideItem setTitle:qt_mac_applicationmenu_string(HideAppMenuItem).arg(qt_mac_applicationName()).toNSString()];
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ QT_FORWARD_DECLARE_CLASS(QCocoaMenuItem);
|
|||
|
||||
+ (instancetype)separatorItemWithPlatformMenuItem:(QCocoaMenuItem *)menuItem;
|
||||
- (instancetype)initWithPlatformMenuItem:(QCocoaMenuItem *)menuItem;
|
||||
- (instancetype)init;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
|||
|
|
@ -119,6 +119,11 @@ static NSString *qt_mac_removePrivateUnicode(NSString* string)
|
|||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
return [self initWithPlatformMenuItem:nullptr];
|
||||
}
|
||||
|
||||
- (QCocoaMenuItem *)platformMenuItem
|
||||
{
|
||||
return _platformMenuItem.data();
|
||||
|
|
|
|||
Loading…
Reference in New Issue