aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2018-01-17 12:13:44 +0100
committerLars Knoll <lars.knoll@qt.io>2018-01-17 13:13:36 +0000
commita161024a37da7eb6655c1ca42c581800214852b5 (patch)
treef901e93622bfaacb637e871d4f4a7f875926dde4
parent187af5c7d2aab87545788f59eb8f8549e130c211 (diff)
Fix quadratic behavior in QQuickRepeater::clear(), take 2
This amends 52874a0e6f739ce410c8401e19b0a9ef6d02cabf, to also fix the quadratic behavior when removing the repeaters item from their parent. Change-Id: I24ad7ca4f66a765a5e991846d65803ccf84c2cab Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/quick/items/qquickrepeater.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/quick/items/qquickrepeater.cpp b/src/quick/items/qquickrepeater.cpp
index 658a7de3d4..ba9460bf76 100644
--- a/src/quick/items/qquickrepeater.cpp
+++ b/src/quick/items/qquickrepeater.cpp
@@ -374,9 +374,12 @@ void QQuickRepeater::clear()
if (complete)
emit itemRemoved(i, item);
d->model->release(item);
- item->setParentItem(0);
}
}
+ for (QQuickItem *item : qAsConst(d->deletables)) {
+ if (item)
+ item->setParentItem(0);
+ }
}
d->deletables.clear();
d->itemCount = 0;