I'm trying to use a TextField
that only receives QML
numbers. It is using the inputMethodHints
property to make the device show only the numeric keypad. It works fine on Android but when I run on iOS it shows the full keyboard with digits, characters and suggested words.
Code below:
TextField {
id: numeroTelefoneTextField
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
width: parent.width * 0.70
height: parent.height * 0.6
placeholderText: qsTr("Seu número")
font.bold: true
validator: RegExpValidator{regExp: /\d+/}
inputMethodHints: Qt.ImhDigitsOnly
}
I've tried other options like inputMethodHints: Qt.ImhDigitsOnly | Qt.ImhNoPredictiveText
and only inputMethodHints: Qt.ImhNoPredictiveText
but none of these options works on iOS.