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

QSortFilterProxyModel suppresses "roles" parameter of the "dataChanged" signal

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.5.0
    • 5.1.0 , 5.1.1
    • Widgets: Itemviews
    • None
    • f96baeb75fc36a41d2b08f880536cee5a8041e79

    Description

      QAbstractItemModel has following signal:
      void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int> ())

      QAbstractItemView has corresponding protected virtual method:
      void QAbstractItemView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int> ()) [virtual protected slot]

      If you add QSortFilterProxyModel (or subclass) between model and view, view receives empty roles vector. As a result, all the pros of that parameter added in Qt 5.0 are negated if QSortFilterProxyModel is used.

      See example in attachment.

      Attachments

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

        Activity

          People

            peppe Giuseppe D'Angelo
            sergei.nevdakh Sergei Nevdakh
            Votes:
            9 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes