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

QSortFilterModel forwards dataChanged() when the source model changes data incolumns that the filter model refuses

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.1.0
    • 5.15.1
    • Core: Item Models
    • None
    • All
    • 66acca3316e3c333e4cc3abfc343e58e3516c8b4 (qt/qtbase/dev) 61281b928bf5f2d228fb810af38bba71032f63a6 (qt/qtbase/5.15)

    Description

      if a QSortFilterModel implements filterAcceptsColumns and the source model emits datachanged with either topLeft or bottomRight on a column which is not accepted, QSortFilterModel will forward the datachanged signal with topLeft and/or bottomRight as an invalid QModelIndex(), making a spurious signal, either wil both useless parameters or with one of the two invalid, making impossible to actually know where the change of data started or ended.

      This is kinda similar but not completely the same as this old Qt bug (as this one was about headerDataChanged) https://bugreports.qt.io/browse/QTBUG-26515

       

      attached a test case which will print a warning when such signal is emitted by the QSortfilterProxyModel

      Attachments

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

        Activity

          People

            dfaure_kdab David Faure
            notmart Marco Martin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes