From 13ea1d89f2bc35b878dde10a89dc186d8d0cd8e7 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Mon, 6 Aug 2018 11:22:57 +0200 Subject: 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 --- src/qml/types/qqmltableinstancemodel_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/qml/types') 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; -- cgit v1.2.3