Qt Forum

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

    Call for Presentations - Qt World Summit

    How to call setModelData with new value from editor if old value is not valid.

    QML and Qt Quick
    2
    2
    918
    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.
    • A
      Ajay_11 last edited by

      My problem is that I receive the data from QlineEdit editor and then I process it. In processing I found it invalid(say wrong value entered by user etc). Now I want that after I have done this validation if the data is not valid user comes back to QLineEdit and shows it editable(i.e. user can put value again).

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        I would say, don't allow to return from you editor until the user has given a valid input. That's not the job of the model to check that.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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