diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-08-06 11:22:57 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-08-07 21:17:17 +0000 |
commit | 13ea1d89f2bc35b878dde10a89dc186d8d0cd8e7 (patch) | |
tree | 43fdaeadb043001f23d890341a90e2f7b4432f68 /src/qml/types | |
parent | 1b493d992c1876f280e2cade5ea4a92bd4acbf38 (diff) |
QQuickTableView: improve draining of reuse pool
It turns out that using a maxTime of 2 when draining
the pool was a bit naive. If e.g the width of the
table is greater than the height, it starts releasing
pooled items to quickly. So change the logic to be more
dynamic, and to calculate what the maxTime should be
based on the geometry of the table.
Change-Id: Ifeed62789575f98cff063f550f45eb54ef312fdb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/qml/types')
-rw-r--r-- | src/qml/types/qqmltableinstancemodel_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/types/qqmltableinstancemodel_p.h b/src/qml/types/qqmltableinstancemodel_p.h index 71689ce6da..93ef4a697f 100644 --- a/src/qml/types/qqmltableinstancemodel_p.h +++ b/src/qml/types/qqmltableinstancemodel_p.h @@ -114,6 +114,7 @@ public: void insertIntoReusableItemsPool(QQmlDelegateModelItem *modelItem); QQmlDelegateModelItem *takeFromReusableItemsPool(const QQmlComponent *delegate); void drainReusableItemsPool(int maxPoolTime); + int poolSize() { return m_reusableItemsPool.size(); } void reuseItem(QQmlDelegateModelItem *item, int newModelIndex); QQmlIncubator::Status incubationStatus(int index) override; |