path: root/src/plugins/platforms/ios/qiosinputcontext.h
diff options
authorTor Arne Vestbø <>2014-10-28 12:54:26 +0100
committerTor Arne Vestbø <>2014-11-08 00:20:32 +0100
commit719a6fd50d590e819fa541dc5b31661b38537344 (patch)
tree98173785f17350bd926b53b318a31e10f1429486 /src/plugins/platforms/ios/qiosinputcontext.h
parent370d7bf48afb20017852c0c7faff45d40dbf81a5 (diff)
iOS: Allow virtual keyboard to be hidden by QInputMethod::hide()
Calling the function has the same effect as dismissing the keyboard using the native keyboard dismiss button or the hide-keyboard gesture, and will result in the QIOSTextInputResponder losing first-responder status and the current focus object being cleared. QtWidgets and other parts of Qt will try to hide the keyboard during focus changes between widgets, which we already take care of when the focus object changes, so we detect the situation and ignore it, by requiring that the current focus object matches the one we've brought up the text responder for. Showing the virtual keyboard is still a no-op, as there is no way to show the virtual keyboard without a focus-object. Change-Id: Iefcb403c2b6d3da8a4df3fcd53bc1244ba9c4d23 Reviewed-by: Richard Moe Gustavsen <>
Diffstat (limited to 'src/plugins/platforms/ios/qiosinputcontext.h')
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/qiosinputcontext.h b/src/plugins/platforms/ios/qiosinputcontext.h
index f07408db81..1f1130f932 100644
--- a/src/plugins/platforms/ios/qiosinputcontext.h
+++ b/src/plugins/platforms/ios/qiosinputcontext.h
@@ -51,9 +51,10 @@ QT_BEGIN_NAMESPACE
struct ImeState
- ImeState() : currentState(0) {}
+ ImeState() : currentState(0), focusObject(0) {}
Qt::InputMethodQueries update(Qt::InputMethodQueries properties);
QInputMethodQueryEvent currentState;
+ QObject *focusObject;
class QIOSInputContext : public QPlatformInputContext