Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How use inputMethodHints property ?
QtWS25 Last Chance

How use inputMethodHints property ?

Scheduled Pinned Locked Moved QML and Qt Quick
inputmethodhinttextfielduse
2 Posts 2 Posters 3.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CharlieGC Offline
    CharlieGC Offline
    CharlieG
    wrote on last edited by
    #1

    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

    Charlie

    p3c0P 1 Reply Last reply
    0
    • CharlieGC CharlieG

      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

      Charlie

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by p3c0
      #2

      @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
          }
      }
      

      157

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved