QEntity Class
(Qt3DCore::QEntity)Qt3DCore::QEntity is a Qt3DCore::QNode subclass that can aggregate several Qt3DCore::QComponent instances that will specify its behavior. 更多...
头文件: | #include <QEntity> |
qmake: | QT += 3dcore |
开始支持版本: | Qt 5.5 |
Instantiated By: | Entity |
基类: | Qt3DCore::QNode |
派生类: | Qt3DExtras::QFirstPersonCameraController, Qt3DExtras::QOrbitCameraController, Qt3DExtras::QSkyboxEntity, and Qt3DRender::QCamera |
公有函数
QEntity(QNode *parent = nullptr) | |
virtual | ~QEntity() |
void | addComponent(QComponent *comp) |
QComponentVector | components() const |
QEntity * | parentEntity() const |
void | removeComponent(QComponent *comp) |
- 11 个公有函数继承自 Qt3DCore::QNode
- 32 个公有函数继承自 QObject
相关非成员
typedef | QComponentVector |
其他继承的成员
- 3 个属性继承自 Qt3DCore::QNode
- 1 个属性继承自 QObject
- 3 个公有槽函数继承自 Qt3DCore::QNode
- 1 个公有槽函数继承自 QObject
- 4 个信号继承自 Qt3DCore::QNode
- 2 个信号继承自 QObject
- 1 个公有变量继承自 QObject
- 10 个静态公有成员继承自 QObject
- 2 个受保护的函数继承自 Qt3DCore::QNode
- 9 个受保护的函数继承自 QObject
- 2 个受保护的变量继承自 QObject
详细描述
Qt3DCore::QEntity is a Qt3DCore::QNode subclass that can aggregate several Qt3DCore::QComponent instances that will specify its behavior.
By itself a Qt3DCore::QEntity is an empty shell. The behavior of a Qt3DCore::QEntity object is defined by the Qt3DCore::QComponent objects it references. Each Qt3D backend aspect will be able to interpret and process an Entity by recognizing which components it is made up of. One aspect may decide to only process entities composed of a single Qt3DCore::QTransform component whilst another may focus on Qt3DInput::QMouseHandler.
参见 Qt3DCore::QComponent and Qt3DCore::QTransform.
成员函数
QEntity::QEntity(QNode *parent = nullptr)
Constructs a new Qt3DCore::QEntity instance with parent as parent.
[virtual]
QEntity::~QEntity()
Destroys the instance of QEntity. The destructor is virtual.
void QEntity::addComponent(QComponent *comp)
Adds a new reference to the component comp.
Note: If the Qt3DCore::QComponent has no parent, the Qt3DCore::QEntity will set itself as its parent thereby taking ownership of the component.
QComponentVector QEntity::components() const
Returns the list of Qt3DCore::QComponent instances the entity is referencing.
QEntity *QEntity::parentEntity() const
Returns the parent Qt3DCore::QEntity instance of this entity. If the immediate parent isn't a Qt3DCore::QEntity, this function traverses up the scene hierarchy until a parent Qt3DCore::QEntity is found. If no Qt3DCore::QEntity parent can be found, returns null.
void QEntity::removeComponent(QComponent *comp)
Removes the reference to comp.