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

When dataChanged() is emitted with indexes indicating a range, then the whole viewport will be updated

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Duplicate
    • Affects Version/s: 5.7.0
    • Fix Version/s: None
    • Component/s: Widgets: Itemviews
    • Labels:
      None

      Description

      When dataChanged() is emitted with indexes indicating a range, then the whole viewport will be updated as the range is not taken into consideration. If only a single index is covered by the "range" indicated in the emitted signal then it only updates that index.
      Attached is an example that reproduces the problem, the signal is emitted with only rows 2-3 in the range yet all of the rows are updated.

      I have seen this problem QTreeView, it may happen with other view classes as well.

      This seems grossly inefficient.
      This could probably be fixed by forming a rectangle containing the begin and end elements of the range, and invalidating that rectangle.

      ( Modified from bug report https://bugreports.qt.io/browse/QTBUG-13668 )

      The guilty code is in QAbstractItemView::dataChanged(),
      where an if branch on 'topLeft == bottomRight' is done.
      If false, d->viewport->update() is called.

        Attachments

          Issue Links

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

            Activity

              People

              • Assignee:
                mmutz Marc Mutz
                Reporter:
                NChapman Nicholas Chapman
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes