InstanceRepeater QML Type

Instantiates components based on an instance table. More...

Import Statement: import QtQuick3D.Helpers
Since: Qt 6.4



Detailed Description

The InstanceRepeater type is used to create a number of objects based on an Instancing table. The primary use case is to implement picking.

Instances do not exist as individual objects in the scene graph, so they cannot be discovered by picking, and they are not individual objects, so there is nothing that can be returned from a picking API. The solution is to create invisible dummy objects that match the rendered instances.

InstanceRepeater is a Repeater3D subtype that takes an Instancing table instead of a data model, and automatically applies position, scale, and rotation.

For example:

InstanceRepeater {
    instancingTable: myInstanceTable
    Model {
        source: "#Cube"
        pickable: true
        property int instanceIndex: index // expose the index, so we can identify the instance
        opacity: 0

See also InstanceModel.

Property Documentation

instancingTable : Instancing

This property specifies the instance table used by the repeater.

© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.