path: root/src/plugins/platforms/ios/qiosinputcontext.h
diff options
authorTor Arne Vestbø <>2014-11-25 15:08:04 +0100
committerTor Arne Vestbø <>2014-12-02 10:56:47 +0100
commitc59c8ddf1f98938441925e01d9931c3c1eb3f5cc (patch)
tree54e37b980eee49c652760709f56f2e7aa3af4f9c /src/plugins/platforms/ios/qiosinputcontext.h
parent1018502722ee70dd077304e35ff4600853143571 (diff)
iOS: Refactor QIOSKeyboardListener implementation and usage
QIOSKeyboardListener takes care of both maintaining the virtual keyboard state, and acting as a gesture recognizer for the hide keyboard gesture. We make this explicit though a union in QIOSInputContext, so that we can access each 'mode' separately. This improved code readability and allows later refactoring of the state and gesture into separate classes without changing the call sites. Change-Id: Icc60f4a542983cda7ca0fd6622963d32d1e90db9 Reviewed-by: Richard Moe Gustavsen <>
Diffstat (limited to 'src/plugins/platforms/ios/qiosinputcontext.h')
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/platforms/ios/qiosinputcontext.h b/src/plugins/platforms/ios/qiosinputcontext.h
index b4ff695f1a..174c44751c 100644
--- a/src/plugins/platforms/ios/qiosinputcontext.h
+++ b/src/plugins/platforms/ios/qiosinputcontext.h
@@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE
@class QIOSKeyboardListener;
@class QIOSTextInputResponder;
+@protocol KeyboardState;
struct ImeState
@@ -90,7 +91,10 @@ public:
static QIOSInputContext *instance();
- QIOSKeyboardListener *m_keyboardListener;
+ union {
+ QIOSKeyboardListener *m_keyboardHideGesture;
+ id <KeyboardState> m_keyboardState;
+ };
QIOSTextInputResponder *m_textResponder;
ImeState m_imeState;