QEntity#

QEntity is a QNode subclass that can aggregate several QComponent instances that will specify its behavior. More

Inheritance diagram of PySide6.Qt3DCore.Qt3DCore.QEntity

Inherited by: QCamera, QText2DEntity, QSkyboxEntity, QAbstractCameraController, QOrbitCameraController, QFirstPersonCameraController

Synopsis#

Functions#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

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:

parentPySide6.Qt3DCore.Qt3DCore.QNode

Constructs a new QEntity instance with parent as parent.

PySide6.Qt3DCore.Qt3DCore.QEntity.addComponent(comp)#
Parameters:

compPySide6.Qt3DCore.Qt3DCore.QComponent

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()#

Returns the list of QComponent instances the entity is referencing.

PySide6.Qt3DCore.Qt3DCore.QEntity.parentEntity()#
Return type:

PySide6.Qt3DCore.Qt3DCore.QEntity

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:

compPySide6.Qt3DCore.Qt3DCore.QComponent

Removes the reference to comp.