From 17bf553b76ebd688e58e4de4271407e2058d89ef Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 15 Mar 2021 12:27:00 +0100 Subject: Include minus sign in ImhFormattedNumbersOnly's available keys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Pick-to: 6.1 6.0 5.15 Change-Id: I0418946014e0a66d503e61704154fd7798a0b785 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qiostextresponder.mm | 4 +--- 1 file changed, 1 insertion(+), 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; -- cgit v1.2.3