InstanceList QML Type
QML でインスタンスを手動で指定できるようにします。詳細...
Import Statement: | import QtQuick3D |
Inherits: |
プロパティ
- instanceCount : int
(since 6.3)
- instances : List<QtQuick3D::InstanceListEntry>
詳細説明
InstanceList型を使用すると、QMLでインスタンステーブルを手動で定義することができます。
以下の例では、2つの項目を持つインスタンステーブルを作成しています:
InstanceList { id: manualInstancing instances: [ InstanceListEntry { position: Qt.vector3d(0, 0, -60) eulerRotation: Qt.vector3d(-10, 0, 30) color: "red" }, InstanceListEntry { position: Qt.vector3d(50, 10, 100) eulerRotation: Qt.vector3d(0, 180, 0) color: "green" } ] }
InstanceListに子プロパティを追加するだけで、インスタンスプロパティを生成することも可能です。次の例は前の例と同じです:
InstanceList { id: manualInstancing InstanceListEntry { position: Qt.vector3d(0, 0, -60) eulerRotation: Qt.vector3d(-10, 0, 30) color: "red" } InstanceListEntry { position: Qt.vector3d(50, 10, 100) eulerRotation: Qt.vector3d(0, 180, 0) color: "green" } }
各InstanceListEntry は、プロパティ・バインディングとアニメーションを持つことができるオブジェクトです。これは非常に柔軟性がありますが、メモリのオーバーヘッドを引き起こします。したがって、何千(または何百万)ものインスタンスを含む手続き的に生成されたテーブルにInstanceListを使用することは推奨されません。また、エントリのプロパティを変更すると、インスタンステーブル全体が再 計算され、GPU にアップロードされます。
RandomInstancing およびQQuick3DInstancingも参照してください 。
プロパティ・ドキュメンテーション
instanceCount : int |
この読み取り専用プロパティには、リスト内のインスタンス数が含まれます。
このプロパティは Qt 6.3 で導入されました。
instances : List<QtQuick3D::InstanceListEntry> |
このプロパティには、インスタンス定義のリストが含まれます。このリストやその要素を変更すると、インスタンステーブルが更新されます。
© 2025 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.