This example shows some AppTextFields with inputMethodHints. It works fine on iOS, it restricts keys and shows the appropriate keyboards. However, it does not work on desktop (at least on Linux). Is this supposed to work only on mobile devices? Below, there is a link to the web editor and the code.
https://felgo.com/web-editor/?snippet=503d97d1
import QtQuick 2.10
import Felgo 3.0
import QtQuick.Controls 1.3
App{
NavigationStack{
Page{
title: "Input method hints"
Column {
anchors.fill: parent
spacing: dp(20)
Item{
width: 1
height: dp(10)
}
AppTextField{
anchors.horizontalCenter: parent.horizontalCenter
borderColor: "black"
borderWidth: 2
width: parent.width - dp(20)
inputMethodHints: Qt.ImhDigitsOnly
placeholderText: qsTr("Only digits")
}
AppTextField{
anchors.horizontalCenter: parent.horizontalCenter
borderColor: "black"
borderWidth: 2
width: parent.width - dp(20)
validator: RegExpValidator { regExp: /^[0-9\+\-\#\*\ ]{6,}$/ }
inputMethodHints: Qt.ImhDialableCharactersOnly
placeholderText: qsTr("Only dialable characters")
}
AppTextField{
anchors.horizontalCenter: parent.horizontalCenter
borderColor: "black"
borderWidth: 2
width: parent.width - dp(20)
inputMethodHints: Qt.ImhEmailCharactersOnly | Qt.ImhNoAutoUppercase
placeholderText: qsTr("Only email characters")
}
AppTextField{
anchors.horizontalCenter: parent.horizontalCenter
borderColor: "black"
borderWidth: 2
width: parent.width - dp(20)
inputMethodHints: Qt.ImhUrlCharactersOnly
placeholderText: qsTr("Only URL characters")
}
}
}
}
}