summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qabstractitemview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/itemviews/qabstractitemview.cpp')
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 3e85b67..a4f512b 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Qt Software Information (qt-info@nokia.com)
+** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtGui module of the Qt Toolkit.
**
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at qt-sales@nokia.com.
+** contact the sales department at http://www.qtsoftware.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -2906,8 +2906,14 @@ void QAbstractItemView::scrollToBottom()
void QAbstractItemView::update(const QModelIndex &index)
{
Q_D(QAbstractItemView);
- if (index.isValid())
- d->viewport->update(visualRect(index));
+ 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);
+ }
}
/*!