From 60fe9fb018fda423754941e41be17186fd98fa85 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 28 Jan 2014 15:55:48 +0100 Subject: [PATCH] iOS: add spell checking support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't have a separate enum just for spell checking in Qt, but Qt::ImhNoPredicitiveText should cover it. So use it to enable/disable both spell checking and auto completion. Change-Id: I7ad661cb7d720988f13bc1ed940573006c0ce229 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/quiview.h | 1 + src/plugins/platforms/ios/quiview_textinput.mm | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/plugins/platforms/ios/quiview.h b/src/plugins/platforms/ios/quiview.h index 8984561dd8..575dedab89 100644 --- a/src/plugins/platforms/ios/quiview.h +++ b/src/plugins/platforms/ios/quiview.h @@ -62,6 +62,7 @@ @property(nonatomic, assign) id inputDelegate; @property(nonatomic) UITextAutocapitalizationType autocapitalizationType; @property(nonatomic) UITextAutocorrectionType autocorrectionType; +@property(nonatomic) UITextSpellCheckingType spellCheckingType; @property(nonatomic) BOOL enablesReturnKeyAutomatically; @property(nonatomic) UIKeyboardAppearance keyboardAppearance; @property(nonatomic) UIKeyboardType keyboardType; diff --git a/src/plugins/platforms/ios/quiview_textinput.mm b/src/plugins/platforms/ios/quiview_textinput.mm index 06d6fb4078..21ef93c4ed 100644 --- a/src/plugins/platforms/ios/quiview_textinput.mm +++ b/src/plugins/platforms/ios/quiview_textinput.mm @@ -496,6 +496,8 @@ Q_GLOBAL_STATIC(StaticVariables, staticVariables); self.secureTextEntry = BOOL(hints & Qt::ImhHiddenText); self.autocorrectionType = (hints & Qt::ImhNoPredictiveText) ? UITextAutocorrectionTypeNo : UITextAutocorrectionTypeDefault; + self.spellCheckingType = (hints & Qt::ImhNoPredictiveText) ? + UITextSpellCheckingTypeNo : UITextSpellCheckingTypeDefault; if (hints & Qt::ImhUppercaseOnly) self.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters;