File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ namespace Maliit {
4444 // ! only integer numbers allowed
4545 NumberContentType,
4646
47+ // ! only numbers and formatted characters
48+ FormattedNumberContentType,
49+
4750 // ! allows numbers and certain other characters used in phone numbers
4851 PhoneNumberContentType,
4952
Original file line number Diff line number Diff line change @@ -137,8 +137,9 @@ Maliit::TextContentType contentTypeFromWayland(uint32_t purpose)
137137 case QtWayland::zwp_text_input_v2::content_purpose_normal:
138138 return Maliit::FreeTextContentType;
139139 case QtWayland::zwp_text_input_v2::content_purpose_digits:
140- case QtWayland::zwp_text_input_v2::content_purpose_number:
141140 return Maliit::NumberContentType;
141+ case QtWayland::zwp_text_input_v2::content_purpose_number:
142+ return Maliit::FormattedNumberContentType;
142143 case QtWayland::zwp_text_input_v2::content_purpose_phone:
143144 return Maliit::PhoneNumberContentType;
144145 case QtWayland::zwp_text_input_v2::content_purpose_url:
Original file line number Diff line number Diff line change @@ -643,8 +643,10 @@ Maliit::TextContentType MInputContext::contentType(Qt::InputMethodHints hints) c
643643 Maliit::TextContentType type = Maliit::FreeTextContentType;
644644 hints &= Qt::ImhExclusiveInputMask;
645645
646- if (hints == Qt::ImhFormattedNumbersOnly || hints == Qt::ImhDigitsOnly) {
646+ if ( hints == Qt::ImhDigitsOnly) {
647647 type = Maliit::NumberContentType;
648+ } else if (hints == Qt::ImhFormattedNumbersOnly) {
649+ type = Maliit::FormattedNumberContentType;
648650 } else if (hints == Qt::ImhDialableCharactersOnly) {
649651 type = Maliit::PhoneNumberContentType;
650652 } else if (hints == Qt::ImhEmailCharactersOnly) {
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ class MaliitQuick: public QObject
3737 enum ContentType {
3838 FreeTextContentType = Maliit::FreeTextContentType,
3939 NumberContentType = Maliit::NumberContentType,
40+ FormattedNumberContentType = Maliit::FormattedNumberContentType;
4041 PhoneNumberContentType = Maliit::PhoneNumberContentType,
4142 EmailContentType = Maliit::EmailContentType,
4243 UrlContentType = Maliit::UrlContentType,
You can’t perform that action at this time.
0 commit comments