Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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



  • 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).


  • Lifetime Qt Champion

    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.


Log in to reply