diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-03-15 12:27:00 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-03-30 15:12:09 +0000 |
commit | c0220acd71f547f27e50b96bc8fe5f115fd4d9a1 (patch) | |
tree | 52bff1ee398585fb83fc66450ec9445507e02c2f /src | |
parent | 97ffc571aed8b1cd945ac2cea57158054e50f135 (diff) |
Include minus sign in ImhFormattedNumbersOnly's available keys
UIKeyboardTypeDecimalPad only provides digits and decimal point, no
minus sign, but ImhFormattedNumbersOnly is documented to provide a
minus sign as well. UIKeyboardTypeNumbersAndPunctuation includes
punctuation, which should cover signs as well as decimal separator, so
use that - same as for ImhPreferNumbers. A little more permissive than
we want here, but that's better than more restrictive !
Fixes: QTBUG-91455
Change-Id: I0418946014e0a66d503e61704154fd7798a0b785
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 17bf553b76ebd688e58e4de4271407e2058d89ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/ios/qiostextresponder.mm | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/plugins/platforms/ios/qiostextresponder.mm b/src/plugins/platforms/ios/qiostextresponder.mm index e030ec200c..c9ecaecb6d 100644 --- a/src/plugins/platforms/ios/qiostextresponder.mm +++ b/src/plugins/platforms/ios/qiostextresponder.mm @@ -227,13 +227,11 @@ self.keyboardType = UIKeyboardTypeEmailAddress; else if (hints & Qt::ImhDigitsOnly) self.keyboardType = UIKeyboardTypeNumberPad; - else if (hints & Qt::ImhFormattedNumbersOnly) - self.keyboardType = UIKeyboardTypeDecimalPad; else if (hints & Qt::ImhDialableCharactersOnly) self.keyboardType = UIKeyboardTypePhonePad; else if (hints & Qt::ImhLatinOnly) self.keyboardType = UIKeyboardTypeASCIICapable; - else if (hints & Qt::ImhPreferNumbers) + else if (hints & (Qt::ImhPreferNumbers | Qt::ImhFormattedNumbersOnly)) self.keyboardType = UIKeyboardTypeNumbersAndPunctuation; else self.keyboardType = UIKeyboardTypeDefault; |