Sur cette page

InstanceRepeater QML Type

Instancie les composants sur la base d'une table d'instance. Plus d'informations...

Import Statement: import QtQuick3D.Helpers
Since: Qt 6.4
Inherits:

Repeater3D

Propriétés

Description détaillée

Le type InstanceRepeater est utilisé pour créer un certain nombre d'objets basés sur une table Instancing. Il s'agit d'un sous-type de Repeater3D qui prend une table Instancing au lieu d'un modèle de données et applique automatiquement position, scale et rotation.

Un cas d'utilisation consiste à mettre en œuvre picking en créant des objets factices invisibles qui correspondent aux instances rendues. Pour améliorer les performances, les objets factices peuvent être créés avec une géométrie plus simple que les modèles instanciés.

Par exemple, il est possible de créer des objets factices invisibles qui correspondent aux instances rendues :

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

Voir également InstanceModel.

Documentation sur les propriétés

instancingTable : Instancing

Cette propriété spécifie la table d'instance utilisée par le répéteur.

© 2026 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.