QEntity¶
QEntity
is aQNode
subclass that can aggregate severalQComponent
instances that will specify its behavior. More…
Inherited by: QAbstractCameraController, QFirstPersonCameraController, QOrbitCameraController, QSkyboxEntity, QText2DEntity, QCamera
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 aQEntity
object is defined by theQComponent
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 singleQTransform
component whilst another may focus onQMouseHandler
.See also
QComponent
QTransform
- class PySide2.Qt3DCore.Qt3DCore.QEntity([parent=None])¶
- param parent:
Constructs a new
QEntity
instance withparent
as parent.
- PySide2.Qt3DCore.Qt3DCore.QEntity.addComponent(comp)¶
- Parameters:
Adds a new reference to the component
comp
.Note
If the
QComponent
has no parent, theQEntity
will set itself as its parent thereby taking ownership of the component.
- PySide2.Qt3DCore.Qt3DCore.QEntity.components()¶
- Return type:
Returns the list of
QComponent
instances the entity is referencing.
- PySide2.Qt3DCore.Qt3DCore.QEntity.parentEntity()¶
- Return type:
Returns the parent
QEntity
instance of this entity. If the immediate parent isn’t aQEntity
, this function traverses up the scene hierarchy until a parentQEntity
is found. If noQEntity
parent can be found, returns null.
- PySide2.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.