1
I’m trying to use a TextField
who receives only numbers QML
. I’m using the property inputMethodHints
to make the device display only the number pad. Works well on Android but when I run on iOS it shows the complete 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 tried other options like inputMethodHints: Qt.ImhDigitsOnly | Qt.ImhNoPredictiveText
and only inputMethodHints: Qt.ImhNoPredictiveText
but none of these options work on iOS.