createIndex() is protected, how can we call it on sourceModel()?Your implementation will only preserve row and column and maybe also the internal pointer. But certainly not the model (thus calling index.data(...) will return wrong values) and probably not the parent.
Do you mean QIdentityProxyModel internally calls sourceModel().createIndex()? If yes then my question was not clear.
Can you give a sample implementation of mapToSouce() and mapFromSource() of the proxy (to add a column) when using QIdentityProxyModel as base class, if you say one does not need to implement these, then how can QIdentityProxyModel know about the extra column and there indexes?
BTW, a proxy based on QAbstractItemModel in post #15 works well with QSortFilterProxyModel and hopefuly other models too.





Reply With Quote

Bookmarks