Commit 302c8687f929ea29beba02a65a52c4507d7ab1c2
- Diff rendering mode:
- inline
- side by side
src/gui/itemviews/qabstractitemview.cpp
(8 / 2)
|   | |||
| 2902 | 2902 | void QAbstractItemView::update(const QModelIndex &index) | |
| 2903 | 2903 | { | |
| 2904 | 2904 | 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 | } | ||
| 2907 | 2913 | } | |
| 2908 | 2914 | ||
| 2909 | 2915 | /*! |
Comments
Add a new comment:
Login or create an account to post a comment
Add your comment
Please log in to comment

