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

QSortFilterProxyModel calls filterAcceptsRow too many times

    XMLWordPrintable

Details

    • a7df98a9a72ee460c6bd23388d52b1200e7ed3ba

    Description

      When a QSFPM's source model calls "endResetModel" this internally emits the "modelReset" private signal. This is handled internally by QSFPM::_q_sourceReset() which calls _q_clearMapping() which calls update_source_sort_column() which calls create_mapping() which calls filterAcceptsRow for each row. After _q_clearMapping() returns, _q_sourceReset then calls update_source_sort_column() which then iterates over all the rows again calling filterAcceptsRow again for every row. This means that for a source model reset, filterAcceptsRow is called for each row twice. For large models, this can be very expensive.

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            miketrahearn Mike Trahearn
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes