diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-10-28 15:00:49 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-10-28 15:02:20 (GMT) |
commit | 6e228d57da9d5dd9b7365d5539f6ed88cafb5d97 (patch) | |
tree | 753c79c1de6534631e061c0a7a68d2914fe84dae /src/gui/itemviews | |
parent | b41086b8f68f280f1f683d0f107b26d1c6221883 (diff) | |
download | Qt-6e228d57da9d5dd9b7365d5539f6ed88cafb5d97.zip Qt-6e228d57da9d5dd9b7365d5539f6ed88cafb5d97.tar.gz Qt-6e228d57da9d5dd9b7365d5539f6ed88cafb5d97.tar.bz2 |
Fixed missing repaints on QTreeView when moving the mouse
..from the decoration to the item itself. QAbstractItemView can't
handle that because it doesn't know anything about decoration.
Reviewed-by: gabi
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r-- | src/gui/itemviews/qtreeview.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index 16b454d..bad9dfe 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -1226,8 +1226,12 @@ bool QTreeView::viewportEvent(QEvent *event) if (oldIndex != newIndex) { QRect oldRect = visualRect(oldIndex); QRect newRect = visualRect(newIndex); - viewport()->update(oldRect.left() - d->indent, oldRect.top(), d->indent, oldRect.height()); - viewport()->update(newRect.left() - d->indent, newRect.top(), d->indent, newRect.height()); + oldRect.rLeft() -= d->indent; + newRect.rLeft() -= 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); } } if (selectionBehavior() == QAbstractItemView::SelectRows) { |