Important: Please read the Qt Code of Conduct -

How use inputMethodHints property ?

  • Hello,

    I don't understand how use the inputMethodHints property of TextField.
    From the documentation I understand that one can restrict user input but it does not work for me.

    By example, with :

    TextField {
            inputMethodHints: Qt.ImhLowercaseOnly

    the user can input upppercase.

    Can you help me.

    Thank you very much


  • Moderators

    @CharlieG AFAIK inputMethodHints is related to the virtual keyboard. Depending upon the flags the correspoding keyboard will be invoked(like for eg. numerical keypad only or the both). Use validator instead. In your case for eg:

    TextField {
        validator: RegExpValidator {
            regExp: /[a-z]+/  //allow only lowercase alphabets