diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-10-20 13:52:38 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-10-20 13:52:38 (GMT) |
commit | 77f055ab9474ec4d3311884c293af7ee4a2a7cb3 (patch) | |
tree | 9b2b239608c01da1715f6a9e85668eda83c519f7 /src/gui/itemviews | |
parent | e64b5fa1312f42fa6377e28c11f8aa3a3413280f (diff) | |
download | Qt-77f055ab9474ec4d3311884c293af7ee4a2a7cb3.zip Qt-77f055ab9474ec4d3311884c293af7ee4a2a7cb3.tar.gz Qt-77f055ab9474ec4d3311884c293af7ee4a2a7cb3.tar.bz2 |
Fixed QTreeView trying to animate when parent item has no child
We now check that the item has children before animating.
Reviewed-by: Alexis
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r-- | src/gui/itemviews/qtreeview.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index 210534e..d597f5c 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -2908,15 +2908,15 @@ void QTreeViewPrivate::expand(int item, bool emitSignal) layout(item); q->setState(oldState); + if (model->canFetchMore(index)) + model->fetchMore(index); if (emitSignal) { emit q->expanded(index); #ifndef QT_NO_ANIMATION - if (animationsEnabled) + if (animationsEnabled && model->hasChildren(index)) beginAnimatedOperation(); #endif //QT_NO_ANIMATION } - if (model->canFetchMore(index)) - model->fetchMore(index); } void QTreeViewPrivate::collapse(int item, bool emitSignal) |