QEntity¶
QEntity
is a QNode
subclass that can aggregate several QComponent
instances that will specify its behavior. More…
Inherited by: QCamera, QText2DEntity, QSkyboxEntity, QAbstractCameraController, QOrbitCameraController, QFirstPersonCameraController
Synopsis¶
Functions¶
def
addComponent
(comp)def
components
()def
parentEntity
()def
removeComponent
(comp)
Detailed Description¶
By itself a QEntity
is an empty shell. The behavior of a QEntity
object is defined by the 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 QTransform
component whilst another may focus on QMouseHandler
.
See also
QComponent
QTransform
- class PySide6.Qt3DCore.Qt3DCore.QEntity([parent=None])¶
- Parameters
parent –
PySide6.Qt3DCore.Qt3DCore.QNode
Constructs a new QEntity
instance with parent
as parent.
- PySide6.Qt3DCore.Qt3DCore.QEntity.addComponent(comp)¶
- Parameters
Adds a new reference to the component comp
.
Note
If the QComponent
has no parent, the QEntity
will set itself as its parent thereby taking ownership of the component.
- PySide6.Qt3DCore.Qt3DCore.QEntity.components()¶
- Return type
Returns the list of QComponent
instances the entity is referencing.
- PySide6.Qt3DCore.Qt3DCore.QEntity.parentEntity()¶
- Return type
Returns the parent QEntity
instance of this entity. If the immediate parent isn’t a QEntity
, this function traverses up the scene hierarchy until a parent QEntity
is found. If no QEntity
parent can be found, returns null.
- PySide6.Qt3DCore.Qt3DCore.QEntity.removeComponent(comp)¶
- Parameters
Removes the reference to comp
.
© 2022 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.