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

QSortFilterProxyModel - headerDataChanged continues to emit despite filterAcceptsColumn returning false.

XMLWordPrintable

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

      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

        1. main.cpp
          2 kB
          Werner
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes