Qt3DCore::QAttribute Class
class Qt3DCore::QAttributeDefine un atributo y cómo deben leerse los datos de un QBuffer. Más...
| Cabecera: | #include <Qt3DCore/QAttribute> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3DCore)target_link_libraries(mytarget PRIVATE Qt6::3DCore) |
| qmake: | QT += 3dcore |
| En QML: | Attribute |
| Hereda: | Qt3DCore::QNode |
| Status: | Obsoleto |
Tipos públicos
| enum | AttributeType { VertexAttribute, IndexAttribute, DrawIndirectAttribute } |
| enum | VertexBaseType { Byte, UnsignedByte, Short, UnsignedShort, Int, …, Double } |
Propiedades
|
|
Funciones públicas
| QAttribute(Qt3DCore::QNode *parent = nullptr) | |
| QAttribute(Qt3DCore::QBuffer *buf, Qt3DCore::QAttribute::VertexBaseType type, uint dataSize, uint count, uint offset = 0, uint stride = 0, Qt3DCore::QNode *parent = nullptr) | |
| QAttribute(Qt3DCore::QBuffer *buf, const QString &name, Qt3DCore::QAttribute::VertexBaseType type, uint dataSize, uint count, uint offset = 0, uint stride = 0, Qt3DCore::QNode *parent = nullptr) | |
| Qt3DCore::QAttribute::AttributeType | attributeType() const |
| Qt3DCore::QBuffer * | buffer() const |
| uint | byteOffset() const |
| uint | byteStride() const |
| uint | count() const |
| uint | divisor() const |
| QString | name() const |
| Qt3DCore::QAttribute::VertexBaseType | vertexBaseType() const |
| uint | vertexSize() const |
Ranuras públicas
| void | setAttributeType(Qt3DCore::QAttribute::AttributeType attributeType) |
| void | setBuffer(Qt3DCore::QBuffer *buffer) |
| void | setByteOffset(uint byteOffset) |
| void | setByteStride(uint byteStride) |
| void | setCount(uint count) |
| void | setDivisor(uint divisor) |
| void | setName(const QString &name) |
| void | setVertexBaseType(Qt3DCore::QAttribute::VertexBaseType type) |
| void | setVertexSize(uint size) |
Señales
| void | attributeTypeChanged(Qt3DCore::QAttribute::AttributeType attributeType) |
| void | bufferChanged(Qt3DCore::QBuffer *buffer) |
| void | byteOffsetChanged(uint byteOffset) |
| void | byteStrideChanged(uint byteStride) |
| void | countChanged(uint count) |
| void | dataSizeChanged(uint vertexSize) |
| void | dataTypeChanged(Qt3DCore::QAttribute::VertexBaseType vertexBaseType) |
| void | divisorChanged(uint divisor) |
| void | nameChanged(const QString &name) |
| void | vertexBaseTypeChanged(Qt3DCore::QAttribute::VertexBaseType vertexBaseType) |
| void | vertexSizeChanged(uint vertexSize) |
Miembros públicos estáticos
| QString | defaultColorAttributeName() |
| QString | defaultJointIndicesAttributeName() |
| QString | defaultJointWeightsAttributeName() |
| QString | defaultNormalAttributeName() |
| QString | defaultPositionAttributeName() |
| QString | defaultTangentAttributeName() |
| QString | defaultTextureCoordinate1AttributeName() |
| QString | defaultTextureCoordinate2AttributeName() |
| QString | defaultTextureCoordinateAttributeName() |
No miembros relacionados
Descripción detallada
Existen 3 tipos de atributos.
- VertexAttributeAtributos de vértice: utilizados para definir los datos que se leerán por vértice.
- IndexAttributeUtilizados para definir los índices de vértices cuando se utilizan llamadas de dibujo indexadas.
- DrawIndirectAttributeSe utiliza para especificar el búfer DrawIndirect que se utilizará cuando se utilicen llamadas de dibujo indirectas.
Nota: cuando un atributo es del tipo DrawIndirectAttribute, sólo son relevantes count, stride y offset.
Cuando proporciones tus propios atributos, puede tener sentido nombrar tu atributo usando helpers como QAttribute::defaultPositionAttributeName() ya que eso asegurará que tu geometría será compatible con el picking y los diversos materiales proporcionados en el módulo Qt3DExtras.
Véase también QBuffer.
Documentación de tipos de miembros
enum QAttribute::AttributeType
Tipo del atributo.
| Constante | Valor |
|---|---|
Qt3DCore::QAttribute::VertexAttribute | 0 |
Qt3DCore::QAttribute::IndexAttribute | 1 |
Qt3DCore::QAttribute::DrawIndirectAttribute | 2 |
enum QAttribute::VertexBaseType
Tipo de los datos.
| Constante | Valor |
|---|---|
Qt3DCore::QAttribute::Byte | 0 |
Qt3DCore::QAttribute::UnsignedByte | 1 |
Qt3DCore::QAttribute::Short | 2 |
Qt3DCore::QAttribute::UnsignedShort | 3 |
Qt3DCore::QAttribute::Int | 4 |
Qt3DCore::QAttribute::UnsignedInt | 5 |
Qt3DCore::QAttribute::HalfFloat | 6 |
Qt3DCore::QAttribute::Float | 7 |
Qt3DCore::QAttribute::Double | 8 |
Propiedad Documentación
attributeType : AttributeType
Contiene el tipo de atributo.
Funciones de acceso:
| Qt3DCore::QAttribute::AttributeType | attributeType() const |
| void | setAttributeType(Qt3DCore::QAttribute::AttributeType attributeType) |
Señal del notificador:
| void | attributeTypeChanged(Qt3DCore::QAttribute::AttributeType attributeType) |
buffer : Qt3DCore::QBuffer*
Contiene la memoria intermedia.
Funciones de acceso:
| Qt3DCore::QBuffer * | buffer() const |
| void | setBuffer(Qt3DCore::QBuffer *buffer) |
Señal notificadora:
| void | bufferChanged(Qt3DCore::QBuffer *buffer) |
byteOffset : uint
Contiene el desplazamiento del byte.
Funciones de acceso:
| uint | byteOffset() const |
| void | setByteOffset(uint byteOffset) |
Señal notificadora:
| void | byteOffsetChanged(uint byteOffset) |
byteStride : uint
Contiene la cadena de bytes.
Funciones de acceso:
| uint | byteStride() const |
| void | setByteStride(uint byteStride) |
Señal notificadora:
| void | byteStrideChanged(uint byteStride) |
count : uint
Mantiene el recuento.
Funciones de acceso:
| uint | count() const |
| void | setCount(uint count) |
Señal del notificador:
| void | countChanged(uint count) |
[read-only] defaultColorAttributeName : const QString
Esta propiedad contiene el nombre del atributo de color por defecto.
Devuelve el nombre del atributo de color por defecto: "vertexColor".
Funciones de acceso:
| QString | defaultColorAttributeName() | [see note below] |
Nota: Esta función puede invocarse a través del sistema de metaobjetos y desde QML. Véase Q_INVOKABLE.
[read-only] defaultJointIndicesAttributeName : const QString
Esta propiedad contiene el nombre del atributo de índices de articulación por defecto.
Devuelve el nombre del atributo de índices de juntas por defecto: "vertexJointIndices".
Funciones de acceso:
| QString | defaultJointIndicesAttributeName() |
[read-only] defaultJointWeightsAttributeName : const QString
Esta propiedad contiene el nombre del atributo de pesos conjuntos por defecto.
Devuelve el nombre del atributo por defecto "joint weights": "vertexJointWeights".
Funciones de acceso:
| QString | defaultJointWeightsAttributeName() |
[read-only] defaultNormalAttributeName : const QString
Esta propiedad contiene el nombre del atributo normal por defecto.
Devuelve el nombre del atributo normal por defecto: "vertexNormal".
Funciones de acceso:
| QString | defaultNormalAttributeName() | [see note below] |
Nota: Esta función puede invocarse a través del sistema de metaobjetos y desde QML. Véase Q_INVOKABLE.
[read-only] defaultPositionAttributeName : const QString
Esta propiedad contiene el nombre del atributo de posición por defecto.
Devuelve el nombre del atributo de posición por defecto: "vertexPosition".
Funciones de acceso:
| QString | defaultPositionAttributeName() | [see note below] |
Nota: Esta función puede invocarse a través del sistema de metaobjetos y desde QML. Véase Q_INVOKABLE.
[read-only] defaultTangentAttributeName : const QString
Esta propiedad contiene el nombre del atributo tangente por defecto.
Devuelve el nombre del atributo tangente por defecto: "vérticeTangente".
Funciones de acceso:
| QString | defaultTangentAttributeName() | [see note below] |
Nota: Esta función puede invocarse a través del sistema de metaobjetos y desde QML. Véase Q_INVOKABLE.
[read-only] defaultTextureCoordinate1AttributeName : const QString
Esta propiedad contiene el nombre del atributo por defecto para la segunda capa de coordenadas de textura.
Devuelve el nombre del atributo por defecto para la segunda capa de coordenadas de textura: "vertexTexCoord1".
Funciones de acceso:
| QString | defaultTextureCoordinate1AttributeName() |
[read-only] defaultTextureCoordinate2AttributeName : const QString
Esta propiedad contiene el nombre del atributo por defecto para la tercera capa de coordenadas de textura.
Devuelve el nombre del atributo por defecto para la tercera capa de coordenadas de textura: "vertexTexCoord2".
Funciones de acceso:
| QString | defaultTextureCoordinate2AttributeName() |
[read-only] defaultTextureCoordinateAttributeName : const QString
Esta propiedad contiene el nombre del atributo de coordenadas de textura por defecto.
Devuelve el nombre del atributo de coordenadas de textura por defecto: "vertexTexCoord".
Funciones de acceso:
| QString | defaultTextureCoordinateAttributeName() | [see note below] |
Nota: Esta función puede invocarse a través del sistema de metaobjetos y desde QML. Véase Q_INVOKABLE.
divisor : uint
Contiene el divisor.
Funciones de acceso:
| uint | divisor() const |
| void | setDivisor(uint divisor) |
Señal notificadora:
| void | divisorChanged(uint divisor) |
name : QString
Contiene el nombre.
Funciones de acceso:
| QString | name() const |
| void | setName(const QString &name) |
Señal del notificador:
| void | nameChanged(const QString &name) |
vertexBaseType : VertexBaseType
Contiene el tipo de datos.
Funciones de acceso:
| Qt3DCore::QAttribute::VertexBaseType | vertexBaseType() const |
| void | setVertexBaseType(Qt3DCore::QAttribute::VertexBaseType type) |
Señal del notificador:
| void | vertexBaseTypeChanged(Qt3DCore::QAttribute::VertexBaseType vertexBaseType) |
vertexSize : uint
Contiene el tamaño de los datos, sólo puede ser de 1 a 4 unidades (escalares y vectores), 9 unidades (matrices 3x3) o 16 unidades (matrices 4x4).
Funciones de acceso:
| uint | vertexSize() const |
| void | setVertexSize(uint size) |
Señal notificadora:
| void | vertexSizeChanged(uint vertexSize) |
Documentación de funciones miembro
[explicit] QAttribute::QAttribute(Qt3DCore::QNode *parent = nullptr)
Construye un nuevo QAttribute con parent.
[explicit] QAttribute::QAttribute(Qt3DCore::QBuffer *buf, Qt3DCore::QAttribute::VertexBaseType type, uint dataSize, uint count, uint offset = 0, uint stride = 0, Qt3DCore::QNode *parent = nullptr)
Construye un nuevo QAttribute a partir de buf de type, dataSize, count, offset, y stride con parent.
[explicit] QAttribute::QAttribute(Qt3DCore::QBuffer *buf, const QString &name, Qt3DCore::QAttribute::VertexBaseType type, uint dataSize, uint count, uint offset = 0, uint stride = 0, Qt3DCore::QNode *parent = nullptr)
Construye un nuevo QAttribute llamado name a partir de buf de type, dataSize, count, offset, y stride con parent.
[signal] void QAttribute::dataSizeChanged(uint vertexSize)
La señal se emite con vertexSize cuando cambia el dataSize.
[signal] void QAttribute::dataTypeChanged(Qt3DCore::QAttribute::VertexBaseType vertexBaseType)
La señal se emite con vertexBaseType cuando cambia el dataType.
[static invokable] QString QAttribute::defaultColorAttributeName()
QAttribute::defaultColorAttributeName Devuelve el nombre del atributo de color por defecto.
Nota: Esta función puede ser invocada a través del sistema de meta-objetos y desde QML. Véase Q_INVOKABLE.
Nota: Función Getter para la propiedad defaultColorAttributeName.
[static] QString QAttribute::defaultJointIndicesAttributeName()
QAttribute::defaultJointIndicesAttributeName Devuelve el nombre del atributo de índices de articulación por defecto.
Nota: Función Getter para la propiedad defaultJointIndicesAttributeName.
[static] QString QAttribute::defaultJointWeightsAttributeName()
QAttribute::defaultJointIndicesAttributeName Devuelve el nombre del atributo de pesos conjuntos por defecto
Nota: Función Getter para la propiedad defaultJointWeightsAttributeName.
[static invokable] QString QAttribute::defaultNormalAttributeName()
QAttribute::defaultNormalAttributeName Devuelve el nombre del atributo normal por defecto
Nota: Esta función puede ser invocada a través del sistema de meta-objetos y desde QML. Véase Q_INVOKABLE.
Nota: Función Getter para la propiedad defaultNormalAttributeName.
[static invokable] QString QAttribute::defaultPositionAttributeName()
QAttribute::defaultPositionAttributeName Devuelve el nombre del atributo de posición por defecto.
Nota: Esta función puede ser invocada a través del sistema de meta-objetos y desde QML. Véase Q_INVOKABLE.
Nota: Función Getter para la propiedad defaultPositionAttributeName.
[static invokable] QString QAttribute::defaultTangentAttributeName()
QAttribute::defaultTangentAttributeName Devuelve el nombre del atributo tangente por defecto.
Nota: Esta función puede invocarse a través del sistema de meta-objetos y desde QML. Véase Q_INVOKABLE.
Nota: Función Getter para la propiedad defaultTangentAttributeName.
[static] QString QAttribute::defaultTextureCoordinate1AttributeName()
QAttribute::defaultTextureCoordinate1AttributeName Devuelve el nombre del atributo por defecto para la segunda capa de coordenadas de textura.
Nota: Función Getter para la propiedad defaultTextureCoordinate1AttributeName.
[static] QString QAttribute::defaultTextureCoordinate2AttributeName()
QAttribute::defaultTextureCoordinate2AttributeName Devuelve el nombre del atributo por defecto para la tercera capa de coordenadas de textura.
Nota: Función Getter para la propiedad defaultTextureCoordinate2AttributeName.
[static invokable] QString QAttribute::defaultTextureCoordinateAttributeName()
QAttribute::defaultTextureCoordinateAttributeName Devuelve el nombre del atributo de coordenadas de textura por defecto.
Nota: Esta función puede ser invocada a través del sistema de meta-objetos y desde QML. Véase Q_INVOKABLE.
Nota: Función Getter para la propiedad defaultTextureCoordinateAttributeName.
© 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.