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

QSortFilterProxyModel - headerDataChanged continues to emit despite filterAcceptsColumn returning false.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 4.8.0
    • Widgets: Itemviews
    • None
    • All.

    Description

      Hi,

      With reference to the minimal sourcecode in the attachment:

      When having a QSortFilterProxyModel (FirstSorter) as source
      model to another QSortFilterProxyModel (SecondSorter), if
      the source model of the the first level QSortFilterProxyModel
      (FirstSorter) emits headerDataChanged, the first level sorter
      does not verify the column/row prior to re-emitting the signal.
      This causes the code in the next level of headerDataChanged
      to assert due to -1 being used in the call to <at>.

      ASSERT failure in QVector<T>::at: "index out of range", file ..\..\include/QtCore/../../src/corelib/tools/qvector.h, line 339

      This behaviour is inconsistent with how dataChanged is handled
      and seems incorrect, as ignoring the fact that the column is
      filtered negates the purpose of QSortFilterProxyModel.

      Kind regards,

      Werner

      Attachments

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

        Activity

          People

            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            werasmus Werner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes