aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2023-11-15 14:31:22 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2023-11-24 18:34:03 +0100
commitd70b847f776f0d0382c3b2ee1c7549a8a1edc1c1 (patch)
treebb2e971a8f05f567644009423107d4d922b5434a /examples/quick
parentab52d288793417c26a3f2d1d85ac573a87ff3d8e (diff)
Fix corrupt rendering when toggling rendernode-based items
Meaning the toggling of visibility. Having a QSGRenderNode come and go in the scenegraph leads to visual problems, in case the adding and removal of the node toggles the m_forceNoUseDepthBuffer flag, which in turn makes useDepthBuffer() return a different value than before (so disables and then enables doing the opaque pass in the renderer). Changing this value needs a full rebuild of the render lists. When adding a node, this is done (regardless of toggling the flag). When removing, it was not done at all. Now we do it when resetting the no-Z flag back to false. Add a button to the customrendernode example to toggle visibility since this is useful for example's purposes anyways. However, this on its own is not sufficient to reproduce the issue. For that, the DepthAwareRendering flag needs to be removed from the QSGRenderNode subclass. Pick-to: 6.6 6.5 Fixes: QTBUG-119160 Change-Id: I232354d88f5a4fe5f9f2d6102d0d5439d92782fb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'examples/quick')
-rw-r--r--examples/quick/scenegraph/customrendernode/main.qml5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/quick/scenegraph/customrendernode/main.qml b/examples/quick/scenegraph/customrendernode/main.qml
index a0b62c4bf8..6a098e47f7 100644
--- a/examples/quick/scenegraph/customrendernode/main.qml
+++ b/examples/quick/scenegraph/customrendernode/main.qml
@@ -102,6 +102,11 @@ Item {
}
+ Button {
+ text: qsTr("Toggle custom item visibility")
+ onClicked: custom.visible = !custom.visible
+ }
+
CustomRender {
id: custom
width: Math.min(parent.width, parent.height)