QEntity Class

class Qt3DCore::QEntity

Qt3DCore::QEntity は、 のサブクラスです。このサブクラスは、 のインスタンスを集約することができます。Qt3DCore::QNode Qt3DCore::QComponent さらに...

ヘッダー #include <QEntity>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3DCore)
target_link_libraries(mytarget PRIVATE Qt6::3DCore)
qmake QT += 3dcore
QML で Entity
を継承: Qt3DCore::QNode
によって継承されます:

Qt3DExtras::QAbstractCameraController,Qt3DExtras::QSkyboxEntity,Qt3DExtras::QText2DEntity, andQt3DRender::QCamera

ステータス非推奨

パブリック関数

QEntity(Qt3DCore::QNode *parent = nullptr)
void addComponent(Qt3DCore::QComponent *comp)
Qt3DCore::QComponentVector components() const
QList<T *> componentsOfType() const
Qt3DCore::QEntity *parentEntity() const
void removeComponent(Qt3DCore::QComponent *comp)

詳細説明

Qt3DCore::QEntity 、それ自体は空のシェルである。Qt3DCore::QEntity オブジェクトの動作は、それが参照するQt3DCore::QComponent オブジェクトによって定義されます。各Qt3Dバックエンドのアスペクトは、Entityがどのコンポーネントで構成されているかを認識することで、Entityを解釈し、処理することができます。あるアスペクトは、単一のQt3DCore::QTransform コンポーネントから構成されるエンティティのみを処理することにするかもしれませんし、別のアスペクトはQt3DInput::QMouseHandler に焦点を当てるかもしれません。

Qt3DCore::QComponent およびQt3DCore::QTransformも参照のこと

メンバ関数ドキュメント

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

parent を親として新しいQt3DCore::QEntity インスタンスを構築する。

void QEntity::addComponent(Qt3DCore::QComponent *comp)

コンポーネントcomp に新しい参照を追加する。

注意: Qt3DCore::QComponent に親がない場合、Qt3DCore::QEntity は自身を親として設定し、コンポーネントの所有権を取得する。

Qt3DCore::QComponentVector QEntity::components() const

エンティティが参照しているQt3DCore::QComponent インスタンスのリストを返します。

template <typename T> QList<T *> QEntity::componentsOfType() const

このエンティティに追加されたコンポーネントのうち、T型にキャストできるすべてのコンポーネント、またはそのようなコンポーネントがない場合は空のベクトルを返します。

Qt3DCore::QEntity *QEntity::parentEntity() const

このエンティティの親Qt3DCore::QEntity インスタンスを返す。直接の親がQt3DCore::QEntity でない場合、この関数は親Qt3DCore::QEntity が見つかるまでシーン階層を走査する。Qt3DCore::QEntity 親が見つからない場合は、null を返します。

void QEntity::removeComponent(Qt3DCore::QComponent *comp)

comp への参照を削除。

関連する非会員

[alias] QComponentVector

QComponent ポインタのリスト。

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