Qt Forum

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

    Qt Academy Launch in California!

    Solved Validation in QML

    QML and Qt Quick
    2
    3
    424
    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.
    • D
      deleted379 last edited by deleted379

      Hello,

      There is something not very clear in documentation.

      Say, I am using RegExpValidator for e-mail address form field.

      How to trigger validation of this field upon submission of the form?

      Currently, with the correctly set validator property of the TextField QML type, I am able to leave the field with malformed e-mail address and there is no complaint shown in the user interface.

      What am I missing?

      Thank you in advance.

      1 Reply Last reply Reply Quote 0
      • IntruderExcluder
        IntruderExcluder last edited by

        When validator is set you can use acceptableInput property of input, to check if it valid.

        D 1 Reply Last reply Reply Quote 3
        • D
          deleted379 @IntruderExcluder last edited by

          @intruderexcluder said in Validation in QML:

          When validator is set you can use acceptableInput property of input, to check if it valid.

          Excellent!

          I have now noticed how this relates to accepted() signal and onAccepted handler.

          Thank you for the prompt reply.

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