aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Senyk <thomas.senyk@qt.io>2022-12-20 10:36:53 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-02-01 16:53:24 +0000
commitc971455eb6db85ab92e0e15f603b052268cf5caf (patch)
treee9aee80baf0e6df8968f711226d5b7a253614782
parenta22ea16192495ee7d6cca31b52529c69367f7918 (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. Change-Id: If1e79d135d3d1f5253cb41a3be1630cfed3865dd Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 185b0d5f215df0254b38ac8a7dfb72c20ce9bc1e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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()