Qt3DCore::QEntity is a Qt3DCore::QNode subclass that can aggregate several Qt3DCore::QComponent instances that will specify its behavior. More...
Header: | #include <QEntity> |
CMake: | find_package(Qt6 COMPONENTS 3dcore REQUIRED) target_link_libraries(mytarget PRIVATE Qt6::3dcore) |
qmake: | QT += 3dcore |
Since: | Qt 5.5 |
Instantiated By: | Entity |
Inherits: | Qt3DCore::QNode |
Inherited By: | Qt3DExtras::QAbstractCameraController, Qt3DExtras::QSkyboxEntity, Qt3DExtras::QText2DEntity, and Qt3DRender::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) |
QComponentVector |
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.
See also Qt3DCore::QComponent and Qt3DCore::QTransform.
Constructs a new Qt3DCore::QEntity instance with parent as parent.
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.
Returns the list of Qt3DCore::QComponent instances the entity is referencing.
Returns all the components added to this entity that can be cast to type T or an empty vector if there are no such components.
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.
Removes the reference to comp.
© The Qt Company Ltd
Licensed under the GNU Free Documentation License, Version 1.3.
https://doc.qt.io/qt-6.2/qt3dcore-qentity.html