Details
-
Suggestion
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
None
Description
Subclassing a QSortFilterProxyModel to have more items than the original model is difficult because of the parent-child relationship of the indexes.
A problem when subclassing QSortFilterProxyModel is that the void* pointer of QModelIndex is opaque. When a subclass add its own QModelIndex to extend the data range, the internalPointer leads to failure when the methods of QSortFilterProxyModel are called.
A way to avoid this problem would be to have a helper class responsible for handling the mapping between the original model indexes, and the proxy model indexes, and the relations between parent and child. Such a class would make it easier to create subclass of QAbstractProxyModel.