このページでは

Qt3DCore::QAttribute Class

class Qt3DCore::QAttribute

属性と、QBuffer からデータをどのように読み取るかを定義します。詳細...

ヘッダー: #include <Qt3DCore/QAttribute>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3DCore)
target_link_libraries(mytarget PRIVATE Qt6::3DCore)
qmake: QT += 3dcore
QML内では: Attribute
継承元: Qt3DCore::QNode
ステータス: 非推奨

このクラスは非推奨です。新しいコードでの使用は強く推奨しません。

パブリック型

enum AttributeType { VertexAttribute, IndexAttribute, DrawIndirectAttribute }
enum VertexBaseType { Byte, UnsignedByte, Short, UnsignedShort, Int, …, Double }

プロパティ

パブリック関数

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

パブリックスロット

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)

シグナル

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)

静的パブリックメンバー

詳細な説明

属性には 3 種類あります。

  • VertexAttribute: 頂点ごとに読み取るデータを定義するために使用されます
  • IndexAttribute: インデックス付き描画コールを使用する場合に、頂点インデックスを定義するために使用されます
  • DrawIndirectAttribute: 間接ドローコールを使用する場合に、使用するDrawIndirectバッファを指定するために使用されます

注: 属性の型が `DrawIndirectAttribute`の場合 、関連するのは `count`、`stride`、および `offset` のみです。

独自の属性を指定する場合、QAttribute::defaultPositionAttributeName() などのヘルパーを使用して属性に名前を付けるとよいでしょう。そうすることで、ジオメトリがQt3DExtras モジュールで提供されるピッキングや各種マテリアルと互換性を持つようになります。

QBufferも参照してください 。

メンバータイプのドキュメント

enum QAttribute::AttributeType

属性の型。

定数値
Qt3DCore::QAttribute::VertexAttribute0
Qt3DCore::QAttribute::IndexAttribute1
Qt3DCore::QAttribute::DrawIndirectAttribute2

enum QAttribute::VertexBaseType

データの型。

定数値
Qt3DCore::QAttribute::Byte0
Qt3DCore::QAttribute::UnsignedByte1
Qt3DCore::QAttribute::Short2
Qt3DCore::QAttribute::UnsignedShort3
Qt3DCore::QAttribute::Int4
Qt3DCore::QAttribute::UnsignedInt5
Qt3DCore::QAttribute::HalfFloat6
Qt3DCore::QAttribute::Float7
Qt3DCore::QAttribute::Double8

プロパティのドキュメント

attributeType : AttributeType

属性タイプを保持します。

アクセス関数:

Qt3DCore::QAttribute::AttributeType attributeType() const
void setAttributeType(Qt3DCore::QAttribute::AttributeType attributeType)

通知シグナル:

void attributeTypeChanged(Qt3DCore::QAttribute::AttributeType attributeType)

buffer : Qt3DCore::QBuffer*

バッファを保持します。

アクセス関数:

Qt3DCore::QBuffer *buffer() const
void setBuffer(Qt3DCore::QBuffer *buffer)

通知シグナル:

void bufferChanged(Qt3DCore::QBuffer *buffer)

byteOffset : uint

バイトオフセットを保持します。

アクセス関数:

uint byteOffset() const
void setByteOffset(uint byteOffset)

通知シグナル:

void byteOffsetChanged(uint byteOffset)

byteStride : uint

バイトストライドを保持します。

アクセス関数:

uint byteStride() const
void setByteStride(uint byteStride)

通知シグナル:

void byteStrideChanged(uint byteStride)

count : uint

カウントを保持します。

アクセス機能:

uint count() const
void setCount(uint count)

通知信号:

void countChanged(uint count)

[read-only] defaultColorAttributeName : const QString

このプロパティには、デフォルトの色属性の名前が格納されます。

デフォルトの色属性の名前を返します:「vertexColor」。

アクセス関数:

QString defaultColorAttributeName()[see note below]

注:この関数は 、メタオブジェクトシステムを介して、およびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[read-only] defaultJointIndicesAttributeName : const QString

このプロパティには、デフォルトのジョイントインデックス属性の名前が格納されます。

デフォルトのジョイントインデックス属性の名前を返します:「vertexJointIndices」。

アクセス関数:

[read-only] defaultJointWeightsAttributeName : const QString

このプロパティには、デフォルトのジョイントウェイト属性の名前が格納されます。

デフォルトのジョイントウェイト属性の名前を返します:「vertexJointWeights」。

アクセス関数:

[read-only] defaultNormalAttributeName : const QString

このプロパティには、デフォルトの法線属性の名前が格納されています。

デフォルトの法線属性の名前を返します:「vertexNormal」。

アクセス関数:

QString defaultNormalAttributeName()[see note below]

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[read-only] defaultPositionAttributeName : const QString

このプロパティには、デフォルトの位置属性の名前が格納されます。

デフォルトの位置属性の名前「vertexPosition」を返します。

アクセス関数:

QString defaultPositionAttributeName()[see note below]

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[read-only] defaultTangentAttributeName : const QString

このプロパティには、デフォルトのタンジェント属性の名前が格納されています。

デフォルトの接線属性の名前を返します:「vertexTangent」。

アクセス関数:

QString defaultTangentAttributeName()[see note below]

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

[read-only] defaultTextureCoordinate1AttributeName : const QString

このプロパティには、テクスチャ座標の 2 番目のレイヤーのデフォルト属性の名前が格納されます。

テクスチャ座標の第2レイヤーのデフォルト属性名「vertexTexCoord1」を返します。

アクセス関数:

[read-only] defaultTextureCoordinate2AttributeName : const QString

このプロパティには、テクスチャ座標の 3 番目のレイヤーのデフォルト属性の名前が格納されます。

テクスチャ座標の3番目のレイヤーのデフォルト属性名「vertexTexCoord2」を返します。

アクセス関数:

[read-only] defaultTextureCoordinateAttributeName : const QString

このプロパティには、デフォルトのテクスチャ座標属性の名前が格納されます。

デフォルトのテクスチャ座標属性の名前「vertexTexCoord」を返します。

アクセス関数:

QString defaultTextureCoordinateAttributeName()[see note below]

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

divisor : uint

除数を格納します。

アクセス関数:

uint divisor() const
void setDivisor(uint divisor)

通知信号:

void divisorChanged(uint divisor)

name : QString

名前を格納します。

アクセス機能:

QString name() const
void setName(const QString &name)

通知信号:

void nameChanged(const QString &name)

vertexBaseType : VertexBaseType

データ型を保持します。

アクセス関数:

Qt3DCore::QAttribute::VertexBaseType vertexBaseType() const
void setVertexBaseType(Qt3DCore::QAttribute::VertexBaseType type)

通知信号:

void vertexBaseTypeChanged(Qt3DCore::QAttribute::VertexBaseType vertexBaseType)

vertexSize : uint

データサイズを保持します。値は、1~4単位(スカラーおよびベクトル)、9単位(3×3行列)、または16単位(4×4行列)のみ可能です。

アクセス関数:

uint vertexSize() const
void setVertexSize(uint size)

通知信号:

void vertexSizeChanged(uint vertexSize)

メンバ関数のドキュメント

[explicit] QAttribute::QAttribute(Qt3DCore::QNode *parent = nullptr)

parent を使用して、新しい QAttribute を生成します。

[explicit] QAttribute::QAttribute(Qt3DCore::QBuffer *buf, Qt3DCore::QAttribute::VertexBaseType type, uint dataSize, uint count, uint offset = 0, uint stride = 0, Qt3DCore::QNode *parent = nullptr)

type 、dataSize 、count 、offset 、およびstride のbuf から、parent を指定して、新しいQAttributeを構築します。

[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)

type 、dataSize 、count 、offset 、およびstride のbuf を、parent を使用して、name という名前の新しいQAttributeを構築します。

[signal] void QAttribute::dataSizeChanged(uint vertexSize)

dataSize が変更されると、vertexSize を使用してシグナルが送信されます。

[signal] void QAttribute::dataTypeChanged(Qt3DCore::QAttribute::VertexBaseType vertexBaseType)

dataType が変更されると、vertexBaseType とともにシグナルが送信されます。

[static invokable] QString QAttribute::defaultColorAttributeName()

QAttribute::defaultColorAttributeName デフォルトのカラー属性の名前を返します

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

注: プロパティ defaultColorAttributeNameのゲッター 関数です。

[static] QString QAttribute::defaultJointIndicesAttributeName()

QAttribute::defaultJointIndicesAttributeName デフォルトのジョイントインデックス属性の名前を返します

注: プロパティ defaultJointIndicesAttributeNameのゲッター 関数です。

[static] QString QAttribute::defaultJointWeightsAttributeName()

QAttribute::defaultJointIndicesAttributeName デフォルトのジョイント重み属性の名前を返します

注: プロパティ `defaultJointWeightsAttributeName`のゲッター 関数です 。

[static invokable] QString QAttribute::defaultNormalAttributeName()

QAttribute::defaultNormalAttributeName デフォルトの法線属性の名前を返します

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

注: プロパティ defaultNormalAttributeNameのゲッター 関数です。

[static invokable] QString QAttribute::defaultPositionAttributeName()

QAttribute::defaultPositionAttributeName デフォルトの位置属性の名前を返します

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

注: プロパティ defaultPositionAttributeNameのゲッター 関数です。

[static invokable] QString QAttribute::defaultTangentAttributeName()

QAttribute::defaultTangentAttributeName デフォルトの接線属性の名前を返します

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

注: プロパティ defaultTangentAttributeNameのゲッター 関数です。

[static] QString QAttribute::defaultTextureCoordinate1AttributeName()

QAttribute::defaultTextureCoordinate1AttributeName テクスチャ座標の 2 番目のレイヤーのデフォルト属性名を返します

注: プロパティ defaultTextureCoordinate1AttributeNameのゲッター 関数です。

[static] QString QAttribute::defaultTextureCoordinate2AttributeName()

QAttribute::defaultTextureCoordinate2AttributeName テクスチャ座標の 3 番目のレイヤーのデフォルト属性名を返します

注: プロパティ defaultTextureCoordinate2AttributeNameのゲッター 関数です。

[static invokable] QString QAttribute::defaultTextureCoordinateAttributeName()

QAttribute::defaultTextureCoordinateAttributeName デフォルトのテクスチャ座標属性の名前を返します

注:この関数は 、メタオブジェクトシステムおよびQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

注: プロパティ defaultTextureCoordinateAttributeNameのゲッター 関数です。

関連する非メンバ

QBufferPtr

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