Auf dieser Seite

InstanceRepeater QML Type

Erstellt Instanzen von Komponenten auf der Grundlage einer Instanztabelle. Mehr...

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

Repeater3D

Eigenschaften

Ausführliche Beschreibung

Der Typ „InstanceRepeater“ wird verwendet, um eine Reihe von Objekten auf der Grundlage einer „ Instancing “-Tabelle zu erstellen. Es handelt sich um einen Untertyp von „ Repeater3D “, der anstelle eines Datenmodells eine „Instancing“-Tabelle verwendet und automatisch „ position “, „ scale “ sowie „ rotation “ anwendet.

Ein Anwendungsfall ist die Implementierung von „ picking “, indem unsichtbare Dummy-Objekte erstellt werden, die mit den gerenderten Instanzen übereinstimmen. Um die Leistung zu verbessern, können die Dummy-Objekte mit einer einfacheren Geometrie als die instanzierten Modelle erstellt werden.

Beispiel:

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

Siehe auch „ InstanceModel “.

Eigenschaftsdokumentation

instancingTable : Instancing

Diese Eigenschaft legt die vom Repeater verwendete Instanztabelle fest.

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