Sub class QAbstractProxyModel
-
wrote on 11 Oct 2015, 06:32 last edited by
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.
-
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.
2/2