diff options
author | João Abecasis <joao@trolltech.com> | 2010-02-18 15:36:44 (GMT) |
---|---|---|
committer | João Abecasis <joao@trolltech.com> | 2010-02-18 18:22:12 (GMT) |
commit | 7f01b5aa56e61048a9785040e9807fd871a4b59a (patch) | |
tree | 6b7e0fe56d323ccdc4c9d78f929159d7cbf72fed /src/gui/itemviews/qtreeview.cpp | |
parent | 4c08defe1ac8342b9f8c6aeceebec12b839bae2a (diff) | |
download | Qt-7f01b5aa56e61048a9785040e9807fd871a4b59a.zip Qt-7f01b5aa56e61048a9785040e9807fd871a4b59a.tar.gz Qt-7f01b5aa56e61048a9785040e9807fd871a4b59a.tar.bz2 |
QTreeView: Fix premature pessimization
Reviewed-by: Olivier Goffart
Diffstat (limited to 'src/gui/itemviews/qtreeview.cpp')
-rw-r--r-- | src/gui/itemviews/qtreeview.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index d0fa22d..706d2a8 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -2474,10 +2474,11 @@ void QTreeView::rowsInserted(const QModelIndex &parent, int start, int end) QVector<QTreeViewItem> insertedItems(delta); for (int i = 0; i < delta; ++i) { - insertedItems[i].index = d->model->index(i + start, 0, parent); - insertedItems[i].level = childLevel; - insertedItems[i].hasChildren = d->hasVisibleChildren(insertedItems[i].index); - insertedItems[i].hasMoreSiblings = !((i == delta - 1) && (parentRowCount == end +1)); + QTreeViewItem &item = insertedItems[i]; + item.index = d->model->index(i + start, 0, parent); + item.level = childLevel; + item.hasChildren = d->hasVisibleChildren(item.index); + item.hasMoreSiblings = !((i == delta - 1) && (parentRowCount == end +1)); } if (d->viewItems.isEmpty()) d->defaultItemHeight = indexRowSizeHint(insertedItems[0].index); |