diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2013-01-31 12:38:09 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-10 12:51:43 +0100 |
commit | 5764f1032310065ee2620d5f06e3db75fcaaa2b1 (patch) | |
tree | 0d0777071155a15039bac3677c6d41aaa84be8d7 | |
parent | 316d8ececa3314ec16baf46ec4f1c5440cd951ef (diff) |
When expanding up the tree, there is no need to expand above root.
The index set by setRootIndex is the root of the visible part of the
model. Expanding more than that is not needed.
Change-Id: I0015e313ef046ff63c67338c4f00c37e1aa71ca7
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
-rw-r--r-- | src/widgets/itemviews/qtreeview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index 1f922dd6e3..6046ef50a5 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -1097,7 +1097,7 @@ void QTreeView::scrollTo(const QModelIndex &index, ScrollHint hint) // Expand all parents if the parent(s) of the node are not expanded. QModelIndex parent = index.parent(); - while (parent.isValid() && state() == NoState && d->itemsExpandable) { + while (parent != d->root && parent.isValid() && state() == NoState && d->itemsExpandable) { if (!isExpanded(parent)) expand(parent); parent = d->model->parent(parent); |