SubPresentationSettings QML Type | Runtime 2.1

Qt 3D Studio | Runtime | QML Types | SubPresentationSettings QML Type

Qt 3D Studio Runtime 2.1 Manual

# SubPresentationSettings QML Type

Settings for sub-presentations. More...

Import Statement: | import .

- List of all members, including inherited members

## Properties

- qmlStreams : list<QmlStream>

## Detailed Description

This type enables specifying a QML sub-presentation directly in the QML.

A QML sub-presentation is a Qt Quick scene that is rendered to a texture and then used either as the contents of Qt 3D Studio layer or as a texture map. The contents of such a sub-presentation can be provided in two ways: by a separate `.qml` file, or directly under the Studio3D element. SubPresentationSettings is the enabler for the latter.

### Usage

      Studio3D {
          id: studio3D
          Presentation {
              source: "file:///presentation.uia"
              SubPresentationSettings {
                  qmlStreams: [
                      QmlStream {
                          presentationId: "sub-presentation-id"
                          Item {
                              width: 1024
                              height: 1024
                              // ... other Qt Quick items
                          }
                      }
                  ]
              }
          }
      }

### Linking to the Presentation via presentationId

In Qt 3D Studio presentations QML sub-presentations are specified in the assets element of the presentation's `.uia` file. This is important also when using SubPresentationSettings and QmlStream.

      <assets ...>
          <presentation-qml id="presentation-id" args="preview-presentation.qml" />
      </assets>

Note: the Qt 3D Studio application takes care of generating the `.uia` file based on what the designers have set in the Sub-presentations dialog.

The `presentation-id` attribute must contain a unique ID for the sub-presentation. The corresponding QmlStream must provide the same value in its presentationId property. The `args` attribute may contain an optional preview version of the item, which is only used in the Viewer application.

## Property Documentation

qmlStreams : list<QmlStream>

Holds the list of QmlStream children.