diff options
author | Pierre Rossi <pierre.rossi@nokia.com> | 2010-01-07 19:15:14 (GMT) |
---|---|---|
committer | Pierre Rossi <pierre.rossi@nokia.com> | 2010-01-07 20:21:30 (GMT) |
commit | 785767e1f965a904765bab5dbfff1a21240dcc88 (patch) | |
tree | 1860870331cd0388ffcb5319616fd37976f067b4 /src/gui/itemviews/qtreeview.cpp | |
parent | f8e08419c78e94d32273c8b039dd48dc9d5e3433 (diff) | |
download | Qt-785767e1f965a904765bab5dbfff1a21240dcc88.zip Qt-785767e1f965a904765bab5dbfff1a21240dcc88.tar.gz Qt-785767e1f965a904765bab5dbfff1a21240dcc88.tar.bz2 |
Fix a painter warning
when using a treewidget with animations in a splitter and the tree is
collapsed, and then select an item in the tree that requires expanding,
it might end up trying to paint to an invalid pixmap
Reviewed-by: Gabi
Diffstat (limited to 'src/gui/itemviews/qtreeview.cpp')
-rw-r--r-- | src/gui/itemviews/qtreeview.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index bcf9cfb..bf88a75 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -3064,6 +3064,8 @@ QPixmap QTreeViewPrivate::renderTreeToPixmapForAnimation(const QRect &rect) cons { Q_Q(const QTreeView); QPixmap pixmap(rect.size()); + if (rect.size().isEmpty()) + return pixmap; pixmap.fill(Qt::transparent); //the base might not be opaque, and we don't want uninitialized pixels. QPainter painter(&pixmap); painter.fillRect(QRect(QPoint(0,0), rect.size()), q->palette().base()); |