In questa pagina

InstanceRepeater QML Type

Crea istanze dei componenti in base a una tabella delle istanze. Altro...

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

Repeater3D

Proprietà

Descrizione dettagliata

Il tipo InstanceRepeater viene utilizzato per creare un numero di oggetti basato su una tabella di istanze ( Instancing ). Si tratta di un sottotipo di Repeater3D che accetta una tabella di istanze al posto di un modello di dati e applica automaticamente position, scale e rotation.

Un caso d'uso consiste nell'implementare l'picking creando oggetti fittizi invisibili che corrispondono alle istanze renderizzate. Per migliorare le prestazioni, gli oggetti fittizi possono essere creati con una geometria più semplice rispetto ai modelli istanziati.

Ad esempio:

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

Vedi anche InstanceModel.

Documentazione sulle proprietà

instancingTable : Instancing

Questa proprietà specifica la tabella delle istanze utilizzata dal ripetitore.

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