diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-10-03 19:34:21 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2016-10-06 08:02:59 +0000 |
commit | 669add92d9adc15ecfa0b2d62dd90ea9066d401e (patch) | |
tree | 49ad8ef5a042c1f0cf9aa305bb8836b63e1d282f /src/plugins/platforms/cocoa/qcocoamenuitem.mm | |
parent | 1b567854e4787ac591f8039c88e8cd8a44edaef7 (diff) |
Replace QCFString::to(CF/NS/Q)String usage with QString methods
Slims down QCFString and leaves only one implementation of converting
back and forth between CF/NS strings and QStrings.
Change-Id: I068568ffa25e6f4f6d6c99dcf47078b7a8e70e10
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoamenuitem.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoamenuitem.mm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm index ea094c86ee..b8a64641a8 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm @@ -309,7 +309,7 @@ NSMenuItem *QCocoaMenuItem::sync() } if (!m_native) { - m_native = [[NSMenuItem alloc] initWithTitle:QCFString::toNSString(m_text) + m_native = [[NSMenuItem alloc] initWithTitle:m_text.toNSString() action:nil keyEquivalent:@""]; [m_native setTag:reinterpret_cast<NSInteger>(this)]; @@ -331,20 +331,20 @@ NSMenuItem *QCocoaMenuItem::sync() bool useAttributedTitle = false; // Cocoa Font and title if (m_font.resolve()) { - NSFont *customMenuFont = [NSFont fontWithName:QCFString::toNSString(m_font.family()) + NSFont *customMenuFont = [NSFont fontWithName:m_font.family().toNSString() size:m_font.pointSize()]; if (customMenuFont) { NSArray *keys = [NSArray arrayWithObjects:NSFontAttributeName, nil]; NSArray *objects = [NSArray arrayWithObjects:customMenuFont, nil]; NSDictionary *attributes = [NSDictionary dictionaryWithObjects:objects forKeys:keys]; - NSAttributedString *str = [[[NSAttributedString alloc] initWithString:QCFString::toNSString(finalString) + NSAttributedString *str = [[[NSAttributedString alloc] initWithString:finalString.toNSString() attributes:attributes] autorelease]; [m_native setAttributedTitle: str]; useAttributedTitle = true; } } if (!useAttributedTitle) { - [m_native setTitle: QCFString::toNSString(finalString)]; + [m_native setTitle:finalString.toNSString()]; } #ifndef QT_NO_SHORTCUT |