iOS: add spell checking support

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ø <tor.arne.vestbo@digia.com>
This commit is contained in:
Richard Moe Gustavsen 2014-01-28 15:55:48 +01:00 committed by The Qt Project
parent 7eb8b67c8b
commit 60fe9fb018
2 changed files with 3 additions and 0 deletions

View File

@ -62,6 +62,7 @@
@property(nonatomic, assign) id<UITextInputDelegate> 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;

View File

@ -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;