diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-07-20 14:05:09 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-08-02 09:50:35 +0000 |
commit | 382812cd2917180a160917d24b11825a7eeb2cf1 (patch) | |
tree | dac6fbf8260e90e0347e23b5f863128d9689607c /src/qml/types/qqmldelegatemodel_p_p.h | |
parent | ca1f69757421845f563ebe90a5880509839efb31 (diff) |
QQuickTableView: implement support for reusing delegate items
This patch will make use of the recent changes in QQmlTableInstanceModel
to support reusing delegate items.
The API in TableView to enable this will mainly be a new property
"reuseItems". This property is true by default. By setting it to
false, reusing items will never happen.
When an item is reused, the signal "TableView.reused" is
emitted after the fact, in case the delegate item needs to
execute some extra code during the process. Likewise, a signal
"TableView.pooled" is emitted when the item is pooled.
From an implementation point of view, TableView only need to
do two things to enable reusing of items. First, whenever it releases
items, it provides a second argument to release(), informing
QQmlTableInstanceModel if the item can be reused. Second, it
needs to call drainReusePool() at appropriate times to ensure
that no item will be kept alive in the pool for too long.
Change-Id: I830e2eace776302ac58946733566208aa8954159
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/qml/types/qqmldelegatemodel_p_p.h')
0 files changed, 0 insertions, 0 deletions