Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt3D crash when using ids in the component list

Qt3D crash when using ids in the component list

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 288 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    ccolin
    wrote on last edited by ccolin
    #1

    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 RenderSettings declaration in the components array 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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved