Important: Please read the Qt Code of Conduct -

Sub class QAbstractProxyModel

  • Hi, I am trying to subclass proxymodel to add one more column to model other than columns exists on database table. i need model editable. what function i must implement to achieve this. i already try to do it but model is not editable.

  • Moderators

    For item to be editable you would implement flags() in your model and make sure the returned flag set contains Qt::ItemIsEditable. You'd also need to implement the setData() method and handle Qt::EditRole in the data() method.

    For the columns from the database just return the base implementation of these methods and provide override only for your extra column.