From 93bc6be21d7a572f4a04b91441babecdc9a22447 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 6 May 2020 15:02:04 +0200 Subject: QStringView: add toNSString() / toCFString() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use it in QString and QCocoaMenuItem. As a drive-by, s,OS X,\macos,g. [ChangeLog][QtCore][QStringView] Added toNSString(), toCFString() on macOS. Change-Id: Ib05818015a4be11a0d72d4487fb82c580d27854e Reviewed-by: Tor Arne Vestbø Reviewed-by: Mårten Nordheim Reviewed-by: Volker Hilsheimer --- src/plugins/platforms/cocoa/qcocoamenuitem.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm index c117ce6a84..653e4a337e 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm @@ -103,7 +103,7 @@ NSString *keySequenceToKeyEqivalent(const QKeySequence &accel) // Similar to qt_mac_removePrivateUnicode change the delete key so the symbol is correctly seen in native menubar if (cocoa_key.unicode() == NSDeleteFunctionKey) cocoa_key = NSDeleteCharacter; - return [NSString stringWithCharacters:&cocoa_key.unicode() length:1]; + return QStringView{&cocoa_key, 1}.toNSString(); } // return the cocoa modifier mask for the QKeySequence (currently only looks at the first one). -- cgit v1.2.3