Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.14.2
-
None
-
-
3c74ee568289af7500f165c4d29f380eefa1f4b9 (qt/qtbase/dev)
Description
At the moment, implementing a custom proxy model that does not change the parent-child relationship of the source model requires to build an entire 1-to-1 mirror of parent-child relationships of the source model.
QIdentityProxyModel and QTransposeProxyModel go around this limitation by adding themselves as friends of QAbstractItemModel and calling the source model's createIndex()
"Hacking" access to protected methods should not be the solution, QAbstractItemModel should allow proxy models to indirectly use sourceModel()->createIndex
Unfortunately do to the lockdown I don't have access to a dev machine set up to submit patches to Qt directly, as a second best I attach a patch to the current dev branch that implements a solution.