From a20132c326f6d2c5fec848efb98dd86afb320e2a Mon Sep 17 00:00:00 2001 From: Wang Chuan Date: Sat, 30 Nov 2019 20:03:19 +0800 Subject: QQuickItemView: fix crash when changing model When visible items become invisible, ListView will try to cache them and redisplay these items if necessary. However, we can't cache items when changing to a new model, since the old one will be deleted later Fix by adding a flag to let ListView know we are clearing items and prevent cache unnecessary items Fixes: QTBUG-80203 Change-Id: I50dcd3f0586c93496b143bdad0e59751360501a8 Reviewed-by: Richard Moe Gustavsen --- src/quick/items/qquickitemview_p_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/quick/items/qquickitemview_p_p.h') diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h index b31f53b2c0..a448cf9a38 100644 --- a/src/quick/items/qquickitemview_p_p.h +++ b/src/quick/items/qquickitemview_p_p.h @@ -316,6 +316,7 @@ public: bool inRequest : 1; bool runDelayedRemoveTransition : 1; bool delegateValidated : 1; + bool isClearing : 1; protected: virtual Qt::Orientation layoutOrientation() const = 0; -- cgit v1.2.3