How can I show on my keyboard only numbers with qt

3.9k views Asked by At

I'm using Qt Quick Virtual Keyboard on my project and when I click on an object I want to show the keyboard but just the numbers. How can I do that?

This is what I'm trying to do

just showing the numeric keyboard like this

1

There are 1 answers

0
Tazo leladze On BEST ANSWER

You can use Qt.ImhFormattedNumbersOnly which allows only number input. This includes also decimal point and minus sign.

Example usage:

TextField {
    id: your_id

    placeholderText: qsTr("სახელი")

    inputMethodHints: Qt.ImhFormattedNumbersOnly
}