Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-62050

Recursive filtering of infinitely deep trees with QSortFilterProxyModel

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: 5.10
    • Fix Version/s: None
    • Component/s: Core: Item Models
    • Labels:
      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.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            dfaure_kdab David Faure
            Reporter:
            torokati44 Attila
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes