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

QAbstractItemView::dataChanged / update on single cells not working in Qt 4.5.3

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.7.1
    • 4.5.3
    • Widgets: Itemviews
    • None
    • Qt 4.5.3
      Not OS specific
    • 0baa15e68c7b2e009c1f81f81148939725c216c8

    Description

      dataChange on single cells calls update.
      but the funtion never calls the update on the rect, because the rect never intersects the viewport geometry.
      I think the geometry give an the geometry to the parent widget and visualRect the geometry to the viewport. so that the two rect shifted by header sizes.

      i use an own implementation of headerview, but also with the default tablewidget this does not working.
      the only workaround is to send an dataChanged for more than one cell, but this updates all cells.

      //4.5.3
      void QAbstractItemView::update(const QModelIndex &index)
      {
      Q_D(QAbstractItemView);
      if (index.isValid())

      { const QRect rect = visualRect(index); //this test is important for peformance reason //For example in dataChanged we simply update all the cells without checking //it can be a major bottleneck to update rects that aren't even part of the viewport if (d->viewport->geometry().intersects(rect)) d->viewport->update(rect); }

      }

      //4.5.2
      void QAbstractItemView::update(const QModelIndex &index)
      {
      Q_D(QAbstractItemView);
      if (index.isValid())
      d->viewport->update(visualRect(index));
      }

      Attachments

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

        Activity

          People

            goffart Olivier Goffart (closed Nokia identity) (Inactive)
            brat brat
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes