0

Fake Edit: Sorry about the weird title. Not sure yet how to phrase this question

Context: Working through this example: http://doc.qt.io/qt-5/qt3drenderer-multiviewport-example.html , this file: http://doc.qt.io/qt-5/qt3drenderer-multiviewport-main-qml.html

Here's a sparse version of the QML I'm looking at:

Entity {
    id: rootNode

    CameraLens {
        id: cameraLens
        ...
    }

    Entity {
            id: cameraViewport1
            property Transform transform : Transform {
                ...
            }
            components: [cameraLens, transform]
    }

    Entity {
            id: cameraViewport2
            property Transform transform : Transform {
                ...
            }
            components: [cameraLens, transform]
    }
}

So I've got these questions:

1- How is the ID search performed? Presumably, it checks the local context first (so the transform referenced in cameraViewport1 is found instead of the one in cameraViewport2), and the proceeds up the tree (which would be how it finds the cameraLens component), but I haven't been able to find documentation that confirms or explains this.

2- Is there only one cameraLens that is shared by both cameraViewport entities? As in, if I access and change the cameraLens through cameraViewport1, do those changes effect cameraViewport2? Basically, it is "passed" by value, or by reference?

I may have simply been unable to find the documentation; if so, links are good, links with explanations as to how to find them are better! (there's more I haven't been able to find docs on)

Narfanator
  • 5,595
  • 3
  • 39
  • 71
  • Yes and yes. These are both generic QML questions actually and not Qt3d-specific, did you check the existing QML documentation? – Frank Osterfeld Jan 27 '16 at 07:10
  • I'm coming at QT/QML fresh through Qt3D, so no, but I'll go look now. I have very little idea about "what's new" going from Qt to Qt3D, but in retrospect, that seems like it would definitely not be one of them. Thanks! – Narfanator Jan 27 '16 at 22:07

0 Answers0