aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-08-07 12:59:42 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-08-07 13:25:06 +0200
commitb407a77380f189438acf08fefff58e7c5b8fd036 (patch)
tree1ec820756e75b2e02639fb2b75848af5e630fca4
parent88cc9d692fc7e2a1bcb647d96bcd820714a29a01 (diff)
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 <fabian.kosmale@qt.io> Fixes: QTBUG-77332 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/quickshapes/qquickshape.cpp5
1 files changed, 5 insertions, 0 deletions
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);
}