summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qabstractitemview.cpp
diff options
context:
space:
mode:
authorIan Walters <ian.walters@nokia.com>2009-04-06 22:47:32 (GMT)
committerIan Walters <ian.walters@nokia.com>2009-04-06 22:47:32 (GMT)
commitbccb7b178c0255c74d648c3972895f66a70fd87b (patch)
treeead94cee89e2ffda4127201b734f1660f1389585 /src/gui/itemviews/qabstractitemview.cpp
parent423d6052844b2026c8acc8826d6546d3afc494d3 (diff)
parentcf42b485ebc1ab3e1f0a804b8c4e404fa99f1f6f (diff)
downloadQt-bccb7b178c0255c74d648c3972895f66a70fd87b.zip
Qt-bccb7b178c0255c74d648c3972895f66a70fd87b.tar.gz
Qt-bccb7b178c0255c74d648c3972895f66a70fd87b.tar.bz2
Merge branch 'master' into contiguouscache
Diffstat (limited to 'src/gui/itemviews/qabstractitemview.cpp')
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 7bd6207..09ea444 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -1421,10 +1421,10 @@ bool QAbstractItemView::viewportEvent(QEvent *event)
case QEvent::HoverEnter: {
QHoverEvent *he = static_cast<QHoverEvent*>(event);
d->hover = indexAt(he->pos());
- d->viewport->update(visualRect(d->hover));
+ update(d->hover);
break; }
case QEvent::HoverLeave: {
- d->viewport->update(visualRect(d->hover)); // update old
+ update(d->hover); // update old
d->hover = QModelIndex();
break; }
case QEvent::HoverMove: {
@@ -1637,7 +1637,7 @@ void QAbstractItemView::mouseReleaseEvent(QMouseEvent *event)
if (d->isIndexValid(index)
&& d->isIndexEnabled(index)
&& d->sendDelegateEvent(index, event))
- d->viewport->update(visualRect(index));
+ update(index);
return;
}
@@ -2320,7 +2320,7 @@ bool QAbstractItemView::edit(const QModelIndex &index, EditTrigger trigger, QEve
}
if (d->sendDelegateEvent(index, event)) {
- d->viewport->update(visualRect(index));
+ update(index);
return true;
}
@@ -2921,7 +2921,7 @@ void QAbstractItemView::dataChanged(const QModelIndex &topLeft, const QModelInde
}
if (isVisible() && !d->delayedPendingLayout) {
// otherwise the items will be update later anyway
- d->viewport->update(visualRect(topLeft));
+ update(topLeft);
}
return;
}
@@ -3126,9 +3126,7 @@ void QAbstractItemView::selectionChanged(const QItemSelection &selected,
{
Q_D(QAbstractItemView);
if (isVisible() && updatesEnabled()) {
- d->setDirtyRegion(visualRegionForSelection(deselected));
- d->setDirtyRegion(visualRegionForSelection(selected));
- d->updateDirtyRegion();
+ d->viewport->update(visualRegionForSelection(deselected) | visualRegionForSelection(selected));
}
}
@@ -3156,15 +3154,13 @@ void QAbstractItemView::currentChanged(const QModelIndex &current, const QModelI
closeEditor(editor, QAbstractItemDelegate::NoHint);
}
if (isVisible()) {
- d->setDirtyRegion(visualRect(previous));
- d->updateDirtyRegion();
+ update(previous);
}
}
if (isVisible() && current.isValid() && !d->autoScrollTimer.isActive()) {
if (d->autoScroll)
scrollTo(current);
- d->setDirtyRegion(visualRect(current));
- d->updateDirtyRegion();
+ update(current);
edit(current, CurrentChanged, 0);
if (current.row() == (d->model->rowCount(d->root) - 1))
d->_q_fetchMore();