summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiostextresponder.mm
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2014-10-28 10:42:56 +0100
committerTor Arne Vestbø <tor.arne.vestbo@digia.com>2014-11-03 18:46:34 +0100
commitc4cfe9091e4f2e4b3054718a4b876413b48e1563 (patch)
tree586b7e944ab61591bd51b88a596f0596741039ce /src/plugins/platforms/ios/qiostextresponder.mm
parentc432960718de8afb43512f35d5339b3a5b8ead2c (diff)
iOS: Allow virtual keyboard returnKeyType to be set through IM platformData
The result of pressing the key is still a Qt::Key_Return press/release sequence, which needs to be handled manually. Change-Id: I72c7b0067bd3ec1bc315ab2c84361800b7be0943 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Marius Bugge Monsen <marius@cutehacks.com>
Diffstat (limited to 'src/plugins/platforms/ios/qiostextresponder.mm')
-rw-r--r--src/plugins/platforms/ios/qiostextresponder.mm10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm
index b809fc4b51..e3c73f5222 100644
--- a/src/plugins/platforms/ios/qiostextresponder.mm
+++ b/src/plugins/platforms/ios/qiostextresponder.mm
@@ -173,9 +173,13 @@
m_inSendEventToFocusObject = NO;
m_inputContext = inputContext;
+ QVariantMap platformData = [self imValue:Qt::ImPlatformData].toMap();
Qt::InputMethodHints hints = Qt::InputMethodHints([self imValue:Qt::ImHints].toUInt());
- self.returnKeyType = (hints & Qt::ImhMultiLine) ? UIReturnKeyDefault : UIReturnKeyDone;
+ self.returnKeyType = platformData.value(kImePlatformDataReturnKeyType).isValid() ?
+ UIReturnKeyType(platformData.value(kImePlatformDataReturnKeyType).toInt()) :
+ (hints & Qt::ImhMultiLine) ? UIReturnKeyDefault : UIReturnKeyDone;
+
self.secureTextEntry = BOOL(hints & Qt::ImhHiddenText);
self.autocorrectionType = (hints & Qt::ImhNoPredictiveText) ?
UITextAutocorrectionTypeNo : UITextAutocorrectionTypeDefault;
@@ -202,7 +206,6 @@
else
self.keyboardType = UIKeyboardTypeDefault;
- QVariantMap platformData = [self imValue:Qt::ImPlatformData].toMap();
if (UIView *inputView = static_cast<UIView *>(platformData.value(kImePlatformDataInputView).value<void *>()))
self.inputView = [[[WrapperView alloc] initWithView:inputView] autorelease];
if (UIView *accessoryView = static_cast<UIView *>(platformData.value(kImePlatformDataInputAccessoryView).value<void *>()))
@@ -625,8 +628,7 @@
[self sendEventToFocusObject:press];
[self sendEventToFocusObject:release];
- Qt::InputMethodHints imeHints = static_cast<Qt::InputMethodHints>([self imValue:Qt::ImHints].toUInt());
- if (!(imeHints & Qt::ImhMultiLine))
+ if (self.returnKeyType == UIReturnKeyDone)
[self resignFirstResponder];
return;