Qt3D crash when using ids in the component list
-
The following QML document, when loaded by a simple C++ program using
QQmlApplicationEngine, crashes.import QtQuick import QtQuick.Scene3D import Qt3D.Core import Qt3D.Render import Qt3D.Extras Window { width: 640 height: 480 title: "hello, world!" visible: true Scene3D { anchors.fill: parent Entity { RenderSettings { id: renderSettings Viewport { normalizedRect: Qt.rect(0, 0, 1, 1) RenderSurfaceSelector { ClearBuffers { buffers: ClearBuffers.ColorDepthBuffer clearColor: Qt.rgba(1, 0, 1, 1) CameraSelector { camera: Camera {} } } } } } components: [renderSettings] } } }The crash does not occur when running in a debugger. Running with an address sanitizer shows an access violation triggered by a call to
QJSValuePrivate::encode(struct QV4::Value const &).If I place the
RenderSettingsdeclaration in thecomponentsarray directly instead of using an id it works fine. Is this a Qt bug, or is there something I’m misunderstanding?On a slightly related note, why is it not possible to use a mix of both ids and inline declarations in the array (trying the
components: [ Component {}, componentId ]syntax gives an error)?Edit: this is using Qt 6.4 on Windows, with either GCC MinGW or MSVC