summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-10-20 13:59:40 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-10-20 13:59:40 (GMT)
commitcbca69bb0c7e3c42bf7d2d964057f38263de0553 (patch)
tree1973f85b1dab9825673a43301d0ab7bff726b10a /src/gui
parent77f055ab9474ec4d3311884c293af7ee4a2a7cb3 (diff)
downloadQt-cbca69bb0c7e3c42bf7d2d964057f38263de0553.zip
Qt-cbca69bb0c7e3c42bf7d2d964057f38263de0553.tar.gz
Qt-cbca69bb0c7e3c42bf7d2d964057f38263de0553.tar.bz2
fix for QTreeView to not animate if there are no visible children
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/itemviews/qtreeview.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index d597f5c..f37d8c7 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -2913,7 +2913,7 @@ void QTreeViewPrivate::expand(int item, bool emitSignal)
if (emitSignal) {
emit q->expanded(index);
#ifndef QT_NO_ANIMATION
- if (animationsEnabled && model->hasChildren(index))
+ if (animationsEnabled)
beginAnimatedOperation();
#endif //QT_NO_ANIMATION
}
@@ -3005,10 +3005,12 @@ void QTreeViewPrivate::beginAnimatedOperation()
animatedOperation.setEndValue(animatedOperation.top() + h);
}
- animatedOperation.after = renderTreeToPixmapForAnimation(rect);
+ if (!rect.isEmpty()) {
+ animatedOperation.after = renderTreeToPixmapForAnimation(rect);
- q->setState(QAbstractItemView::AnimatingState);
- animatedOperation.start(); //let's start the animation
+ q->setState(QAbstractItemView::AnimatingState);
+ animatedOperation.start(); //let's start the animation
+ }
}
void QTreeViewPrivate::drawAnimatedOperation(QPainter *painter) const