diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2016-11-11 08:01:29 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-11-14 20:59:51 +0000 |
commit | 246fe271878dbe586b5f3222a78d67dfecd1ca83 (patch) | |
tree | 12a6f614b79d893c4f7b5a3a74043acee9ccc58c | |
parent | 291eba6f8099a0fec8fbd9cf8a1fb67e5c9f4f8d (diff) | |
download | qtbase-246fe271878dbe586b5f3222a78d67dfecd1ca83.tar.gz |
Cocoa: Make dictation via speech recognition work
Returning NSNotFound from the NSTextInputClient selectedRange
implementation when there is no selection prevents
dictation from activating (for unknown reasons).
Return an empty {0, 0} range instead. Text input
methods such as Pinyin still work after this change.
[ChangeLog][macOS] Speech to text dictation now works
for Qt text input.
Change-Id: Ibf1729bdd271e8ed5ce3c9d2a0373c8ab3613d8e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 1ad9b5f327..50dda52a7b 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -1783,9 +1783,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) - (NSRange) selectedRange { - NSRange selectedRange = {NSNotFound, 0}; - selectedRange.location = NSNotFound; - selectedRange.length = 0; + NSRange selectedRange = {0, 0}; QObject *fo = QGuiApplication::focusObject(); if (!fo) |