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 to call setModelData with new value from editor if old value is not valid.

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

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 1.0k 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.
  • A Offline
    A Offline
    Ajay_11
    wrote on last edited by
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0

      • Login

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