summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-03-17 14:01:17 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-03-18 12:22:24 (GMT)
commit4c5dada4b12f5600c31da84b5823ec4cbf0c91e7 (patch)
tree097cc00455fe32eaff3ce8dfe4964631190a9912 /src/gui/itemviews
parent692f12d89e6d2cf33ca2965ccd155d30ce3d32e8 (diff)
downloadQt-4c5dada4b12f5600c31da84b5823ec4cbf0c91e7.zip
Qt-4c5dada4b12f5600c31da84b5823ec4cbf0c91e7.tar.gz
Qt-4c5dada4b12f5600c31da84b5823ec4cbf0c91e7.tar.bz2
Fixed problem in painting of QTreeView
It could beseen that not a full row was updated when moving the mouse from the decoration to its attached item. Reviewed-by: gabi
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r--src/gui/itemviews/qtreeview.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index 101dafe..61ad79d 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -1232,17 +1232,17 @@ bool QTreeView::viewportEvent(QEvent *event)
int oldBranch = d->hoverBranch;
d->hoverBranch = d->itemDecorationAt(he->pos());
if (oldBranch != d->hoverBranch) {
- QModelIndex oldIndex = d->modelIndex(oldBranch),
- newIndex = d->modelIndex(d->hoverBranch);
- if (oldIndex != newIndex) {
- QRect oldRect = visualRect(oldIndex);
- QRect newRect = visualRect(newIndex);
- oldRect.setLeft(oldRect.left() - d->indent);
- newRect.setLeft(newRect.left() - d->indent);
- //we need to paint the whole items (including the decoration) so that when the user
- //moves the mouse over those elements they are updated
- viewport()->update(oldRect);
- viewport()->update(newRect);
+ //we need to paint the whole items (including the decoration) so that when the user
+ //moves the mouse over those elements they are updated
+ if (oldBranch >= 0) {
+ int y = d->coordinateForItem(oldBranch);
+ int h = d->itemHeight(oldBranch);
+ viewport()->update(QRect(0, y, viewport()->width(), h));
+ }
+ if (d->hoverBranch >= 0) {
+ int y = d->coordinateForItem(d->hoverBranch);
+ int h = d->itemHeight(d->hoverBranch);
+ viewport()->update(QRect(0, y, viewport()->width(), h));
}
}
break; }