本页内容

Attribute QML Type

定义了一个属性,以及应如何从缓冲区中读取数据。更多...

Import Statement: import Qt3D.Core 2.12
In C++: QAttribute
Status: Deprecated

此类型已弃用。我们强烈建议不要在新代码中使用它。

详细描述

属性有 3 种类型。

  • VertexAttribute:用于定义按顶点读取的数据
  • IndexAttribute:用于在需要使用索引绘制调用时定义顶点索引
  • DrawIndirectAttribute:用于指定在使用间接绘制调用时要使用的 DrawIndirect 缓冲区

注意:当 属性类型为 DrawIndirectAttribute时 ,仅 count、stride 和 offset 相关。

在提供自定义属性时,建议使用 QAttribute::defaultPositionAttributeName() 等辅助函数为属性命名,这样可以确保您的几何体与Qt3DExtras 模块中提供的拾取功能和各种材质兼容。

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