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 ?
Forum Update on Monday, May 27th 2025

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.
  • C Offline
    C Offline
    CharlieG
    wrote on 23 Sept 2015, 09:47 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

    P 1 Reply Last reply 23 Sept 2015, 11:38
    0
    • C CharlieG
      23 Sept 2015, 09:47

      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

      P Offline
      P Offline
      p3c0
      Moderators
      wrote on 23 Sept 2015, 11:38 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

      1/2

      23 Sept 2015, 09:47

      • Login

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