Commit 302c8687f929ea29beba02a65a52c4507d7ab1c2

  • avatar
  • thierry
  • Tue Jun 16 15:49:12 GMT 2009
Fixed a bottleneck in itemviews that would ask for an update outside
of the boundaries of the viewport.

Now we catch this and don't call update. This was a performance
regression against 4.4.

Task-number: 256183
Reviewed-by: alexis
src/gui/itemviews/qabstractitemview.cpp
(8 / 2)
  
29022902void QAbstractItemView::update(const QModelIndex &index)
29032903{
29042904 Q_D(QAbstractItemView);
2905 if (index.isValid())
2906 d->viewport->update(visualRect(index));
2905 if (index.isValid()) {
2906 const QRect rect = visualRect(index);
2907 //this test is important for peformance reason
2908 //For example in dataChanged we simply update all the cells without checking
2909 //it can be a major bottleneck to update rects that aren't even part of the viewport
2910 if (d->viewport->geometry().intersects(rect))
2911 d->viewport->update(rect);
2912 }
29072913}
29082914
29092915/*!

Comments

Add a new comment:

Login or create an account to post a comment

Add your comment