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

Edit QSqlRelationalTableModel data from QML view



  • Hello,
    i have QSqlRelationalTableModel subclass where i reimplemented roleNames, data, setData methods, on QML side i want show model data in ListView with ability to change values.
    Displaying model data is ok, but there is problems with changing model values...

    With that delegate no changes provided to model and setData method never called:

    Component {
      id: delegate
      Item {
         SpinBox {
           value: treshold //treshold is an role
         }
      }
    }
    

    If i add:

           onValueCnaged: {
             treshold = value;
           }
    

    that brings endless binding loop