Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Solved Limiting TextEdits

    QML and Qt Quick
    2
    2
    267
    Loading More Posts
    • 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.
    • G
      GoldRatio last edited by

      Hey, I'm designing something where someone needs to enter numbers for data entering, and I want it so that there is a limit to how big or small of a number they enter. Currently, I am using "inputMethodHints: Qt.ImhFormattedNumbersOnly" in order to make it so that only numbers are enterable into a text edit. Is there a way to make it so that this text edit only takes in a certain range of number? If not, is there something better to use that would allow for someone to type any number from a range of numbers?

      Thanks in advance!

      raven-worx 1 Reply Last reply Reply Quote 0
      • raven-worx
        raven-worx Moderators @GoldRatio last edited by raven-worx

        @GoldRatio
        the TextInput element has a validator property

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply Reply Quote 1
        • First post
          Last post