diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-06-30 14:49:05 +0200 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-09-17 14:01:31 +0000 |
commit | 43ed09fed59d55a8792fad87ef9a75382b5c60ff (patch) | |
tree | 3157cceda4735ec15c51f9b043a4238750b6217a /tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp | |
parent | 2b177314139b830ca7e2d5bc414131b0dc9fd5b9 (diff) |
QListView: Speedup handling of hidden items
Instead iterating through all rows to get the number of hidden items,
iterate over the hidden items which are fewer items.
Also don't create a temporary vector with visible flow positions by
remembering the count of hidden items before the working index and
adjusting them appropriately which gives a significant performance
boost when working with a large data set.
[ChangeLog][QtWidgets][QListWidget] Speedup handling of hidden items
when working with large data sets
Task-number: QTBUG-68977
Change-Id: I599b6e97945c245f02229145baad8363ec2bf2f5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp')
-rw-r--r-- | tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp index 5227db64ec..433b9e55e1 100644 --- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp +++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp @@ -873,6 +873,10 @@ void tst_QListView::setCurrentIndex() } } } + while (model.rowCount()) { + view.setCurrentIndex(model.index(model.rowCount() - 1, 0)); + model.removeRow(model.rowCount() - 1); + } } class PublicListView : public QListView |