Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
5.10
-
None
Description
I have read this great article about the new recursive filtering capability of QSortFilterProxyModel.
Under said article I asked in a comment about what happens when recursive filtering is enabled on a model that is an infinitely deep tree. Think of the child objects in an ownership tree having a reference to their parents, or a symbolic link in a directory to one of its ancestor directories.
The answer was that it will currently recurse infinitely, fill the stack and crash.
Perhaps the QAbstractItemModel API could be extended with something like representsTheSameThing(QModelIndex a, QModelIndex b) (with a better name of course), or isBackReference(QModelIndex i). This way the user supplied domain model has a way to provide the abstract model in Qt with sufficient information to avoid this infinite recursion.