aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-09-25 12:29:27 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-09-27 06:44:53 +0000
commit1f758eb7d14a69fa39d6e9463b5176db5ab504c0 (patch)
treecd5b8123c15bb4233d23261f46c5e1b53599d986 /src
parent3716de0253a6520106145d783cec4c8993915bae (diff)
QQuickTableView: only preload items when rebuilding the table from scratch
We preload delegate items when the table is built from scratch to ensure that we have enough items in circulation before the user starts to flick. But when we only rebuild a section of the table after e.g adding or removing rows, we already have enough items in circulation. So only preload when building for RebuildOption::All. Change-Id: I96aa9518e8032ecaba25f92fe6a0fbf17ea34c7d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquicktableview.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp
index ea9cb49e1a..e9d0ab8f3a 100644
--- a/src/quick/items/qquicktableview.cpp
+++ b/src/quick/items/qquicktableview.cpp
@@ -1216,7 +1216,8 @@ void QQuickTableViewPrivate::processRebuildTable()
return;
}
- const bool preload = (reusableFlag == QQmlTableInstanceModel::Reusable);
+ const bool preload = (rebuildOptions & RebuildOption::All
+ && reusableFlag == QQmlTableInstanceModel::Reusable);
if (rebuildState == RebuildState::PreloadColumns) {
if (preload && loadedTable.right() < tableSize.width() - 1)