From b407a77380f189438acf08fefff58e7c5b8fd036 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 7 Aug 2019 12:59:42 +0200 Subject: Fix incorrect vertex data and rendering when shapes change scene When changing scene, the stroke vertices were left with uninitialized stroke colors when the item is re-attached to the scene. Marking the shape data as overall dirty and triggering a polish ensures that the data is kept in sync. Change-Id: I3f472734a97908e6e8f6e58230c0c53dcc041868 Done-with: Fabian Kosmale Fixes: QTBUG-77332 Reviewed-by: Fabian Kosmale Reviewed-by: Laszlo Agocs --- src/quickshapes/qquickshape.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/quickshapes') diff --git a/src/quickshapes/qquickshape.cpp b/src/quickshapes/qquickshape.cpp index e8779debde..04e8de5aa0 100644 --- a/src/quickshapes/qquickshape.cpp +++ b/src/quickshapes/qquickshape.cpp @@ -969,6 +969,11 @@ void QQuickShape::itemChange(ItemChange change, const ItemChangeData &data) // sync may have been deferred; do it now if the item became visible if (change == ItemVisibleHasChanged && data.boolValue) d->_q_shapePathChanged(); + else if (change == QQuickItem::ItemSceneChange) { + for (int i = 0; i < d->sp.count(); ++i) + QQuickShapePathPrivate::get(d->sp[i])->dirty = QQuickShapePathPrivate::DirtyAll; + d->_q_shapePathChanged(); + } QQuickItem::itemChange(change, data); } -- cgit v1.2.3