O'Reilly logo

Qt 5 Projects by Marco Piccolino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Previewing the composition

Since the composition will take the place of the sceneRoot in Preview3D.qml, you can update Preview3D as follows:

// Preview3D.qmlimport QtQuick.Scene3D 2.0import QtQml 2.2Scene3D {    id: scene3d    aspects: ['input','logic']    Component {        id: elementC        Element {}    }    Composition {        id: composition    }    Component.onCompleted: {        elementC.createObject(composition.elements);    }}

As you can see, besides substituting the sceneRoot entity with the Composition entity, we also added a Component object, as well as a JavaScript call to the Component.onCompleted signal handler, that you should already know from the QML primer given in Chapter 1, Writing Acceptance Tests and Building a Visual Prototype. The Component type is exposed by the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required