summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiostheme.mm
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@theqtcompany.com>2015-08-17 12:36:14 +0200
committerRichard Moe Gustavsen <richard.gustavsen@theqtcompany.com>2015-09-01 08:49:19 +0000
commit82538aebe4b22978a6f7735924f5451304c3e2a8 (patch)
tree22d637d96ec7174f339d36f27ec533d254dbe36d /src/plugins/platforms/ios/qiostheme.mm
parent06be9f026f042f994d7c3548a331babca8d03545 (diff)
iOS: send arrow keys to Qt to handle cursor movement
Controlling cursor position through input methods in Qt is very limited. You cannot e.g move the cursor vertically, or select text that spans several paragraphs. The reason for the latter is that Qt works with input methods on a per-paragraph basis, which effectively locks UIKit to only being able to move the cursor and select text within a single paragraph. Fixing up input methods to support more advanced navigation means changing the whole design (working on a whole document, instead of per paragraph), and is out of scope. Instead we choose to listen for arrow keys and forward them to Qt in the same fashing as we already do for backspace and enter. This will make the iOS port on-par with the other platforms, which also sends control characters like these on the side of IM events. Note that registering shortcuts and overriding default IM navigation behavior will only take effect when a hardware keyboard is connected. Only then will [UIresponder keyCommands] be called from UIKit. Change-Id: I634205e0578447c4aa6e9fdff342ee3b281901ea Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/ios/qiostheme.mm')
-rw-r--r--src/plugins/platforms/ios/qiostheme.mm2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/qiostheme.mm b/src/plugins/platforms/ios/qiostheme.mm
index edeabf66dc..bc40069670 100644
--- a/src/plugins/platforms/ios/qiostheme.mm
+++ b/src/plugins/platforms/ios/qiostheme.mm
@@ -107,6 +107,8 @@ QVariant QIOSTheme::themeHint(ThemeHint hint) const
switch (hint) {
case QPlatformTheme::StyleNames:
return QStringList(QStringLiteral("fusion"));
+ case KeyboardScheme:
+ return QVariant(int(MacKeyboardScheme));
default:
return QPlatformTheme::themeHint(hint);
}