summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2012-05-22 13:38:19 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-23 14:18:34 +0200
commit321a5495101b769feb6dae1dcb703effc9e3bd52 (patch)
tree66915ce4f639e8a74d4a8103f239c5665e8c392e
parent2d05d3bd2815c220474b3c07bf3f2ef7417d3070 (diff)
Cocoa: Avoid UTF-16 to UTF-8 to UTF-16 conversion in key handling
When coverting NSEvent characters to a QString, use QCFString::toQString(), which copies the UTF-16 characters out of the NSString into a QString (instead of converting to UTF-8 and back again on each key press). Change-Id: I78f7c46e75283b7b51c762fd7f22e351ac068072 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 755b393af2..09ba1c50ae 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -623,7 +623,7 @@ static QTouchDevice *touchDevice = 0;
// ignore text for the U+F700-U+F8FF range. This is used by Cocoa when
// delivering function keys (e.g. arrow keys, backspace, F1-F35, etc.)
if ([charactersIgnoringModifiers length] == 1 && (ch.unicode() < 0xf700 || ch.unicode() > 0xf8ff))
- text = QString::fromUtf8([[nsevent characters] UTF8String]);
+ text = QCFString::toQString([nsevent characters]);
if (m_composingText.isEmpty())
m_sendKeyEvent = !QWindowSystemInterface::tryHandleSynchronousShortcutEvent(m_window, timestamp, keyCode, modifiers, text);