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

QSortFilterProxyModel: inconsistent mappings can cause ASSERT/crash/qWarning

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P3: Somewhat important
    • None
    • 5.12.5, 5.13.2, 5.14.0 Beta2
    • Core: Item Models
    • None
    • Cannot reproduce the bug in Qt >= 5.15

    Description

      The attached example application (based on Qt's TreeModel example) does some model transformations (moving items, removing items) with indexes filtered-out by the proxy. This can trigger two problems with QSortFilterProxyModel:

      • an ASSERT when using Qt Debug build (possibly a crash with a release build)
      • a misleading qWarning about an inconsistent model

      Both cases can be triggered by activating/deactivating the FORCE_ASSERT macro in MyFilterModel::filterAcceptsRow.

      Attachments

        For Gerrit Dashboard: QTBUG-79800
        # Subject Branch Project Status CR V

        Activity

          People

            dfaure_kdab David Faure
            njeisecke Nils Jeisecke
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes