aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktableview.cpp
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2019-12-04 09:50:46 +0100
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2019-12-19 12:55:35 +0100
commit46501d1625eb085d064183cc3e5c5df579cc2884 (patch)
treebc7ba81b7daaac3af41742a857f1384c06391926 /src/quick/items/qquicktableview.cpp
parent5fb8f1a3283f34482521250d4e44e6bd8dd9323e (diff)
QQuickTableView: reuse items also when using QQmlInstanceModel
Now that QQmlInstanceModel has an API that supports delegate recycling, remove the special case from TableView. What this means in practice is that a TableView can now also reuse items when the model assigned is a DelegateModel. The recycling API in QQuickInstanceModel is already tested by the QQuickListView test. Change-Id: I08c9fe2ce230c2b41b40fe97efdfca78eb5dd296 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/quick/items/qquicktableview.cpp')
-rw-r--r--src/quick/items/qquicktableview.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp
index 4018ce33a5..28a0cddb8f 100644
--- a/src/quick/items/qquicktableview.cpp
+++ b/src/quick/items/qquicktableview.cpp
@@ -1074,11 +1074,7 @@ void QQuickTableViewPrivate::releaseItem(FxTableItem *fxTableItem, QQmlTableInst
Q_TABLEVIEW_ASSERT(item, fxTableItem->index);
delete item;
} else if (item) {
- // Only QQmlTableInstanceModel supports reusing items
- auto releaseFlag = tableModel ?
- tableModel->release(item, reusableFlag) :
- model->release(item);
-
+ auto releaseFlag = model->release(item, reusableFlag);
if (releaseFlag == QQmlInstanceModel::Pooled) {
fxTableItem->setVisible(false);