aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Senyk <thomas.senyk@qt.io>2022-12-20 10:36:53 +0100
committerThomas Senyk <thomas.senyk@qt.io>2023-02-01 09:06:16 +0100
commit185b0d5f215df0254b38ac8a7dfb72c20ce9bc1e (patch)
treed24f393aed0d1bc16ba927b8ec84624416c370b7 /src
parentd7f47127dadc10adb2c98f1803f5a8d2966491ba (diff)
Fix QQuickCanvasItem in case of invalidateSceneGraph()
Adding requestPaint() at the end of invalidateSceneGraph() will make sure that painting is trigger properly again, including the (re-)creation of the painting context. As that request of painting will also recreate the painting context, it will also allow the creation of a new QSGNode Without this patch a nullptr will be returned as QSGNode until a "proper" dirty or update() happens due to property changes or explicit update calls. Pick-to: 6.5 6.4 6.2 Change-Id: If1e79d135d3d1f5253cb41a3be1630cfed3865dd Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/context2d/qquickcanvasitem.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp
index a6d58fec2c..0eb4fe40d3 100644
--- a/src/quick/items/context2d/qquickcanvasitem.cpp
+++ b/src/quick/items/context2d/qquickcanvasitem.cpp
@@ -616,6 +616,10 @@ void QQuickCanvasItem::invalidateSceneGraph()
d->textureProvider = nullptr;
delete d->nodeTexture;
d->nodeTexture = nullptr;
+
+ // As we can expect(/hope) that the SG will be "good again", we can requestPaint ( which does 'markDirty(canvasWindow);' )
+ // Otherwise this Canvas will be "blank" when SG comes back
+ requestPaint();
}
void QQuickCanvasItem::schedulePolish()