diff options
-rw-r--r-- | src/gui/itemviews/qtreeview.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index b7a39b1..0a7ffb7 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -2956,17 +2956,19 @@ void QTreeViewPrivate::expand(int item, bool emitSignal) void QTreeViewPrivate::insertViewItems(int pos, int count, const QTreeViewItem &viewItem) { viewItems.insert(pos, count, viewItem); + QTreeViewItem *items = viewItems.data(); for (int i = pos + count; i < viewItems.count(); i++) - if (viewItems[i].parentItem >= pos) - viewItems[i].parentItem += count; + if (items[i].parentItem >= pos) + items[i].parentItem += count; } void QTreeViewPrivate::removeViewItems(int pos, int count) { viewItems.remove(pos, count); + QTreeViewItem *items = viewItems.data(); for (int i = pos; i < viewItems.count(); i++) - if (viewItems[i].parentItem >= pos) - viewItems[i].parentItem -= count; + if (items[i].parentItem >= pos) + items[i].parentItem -= count; } #if 0 |