QEntity Class

(Qt3D::QEntity)

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

Header: #include <QEntity>
qmake: QT += 3dcore
Since: Qt 5.5
Inherits: QNode
Inherited By:

Public Functions

QEntity(QNode * parent = 0)
virtual ~QEntity()
void addComponent(QComponent * comp)
QComponentList components() const
QEntity * parentEntity() const
QNodeId parentEntityId() const
void removeAllComponents()
void removeComponent(QComponent * comp)
  • 6 public functions inherited from Qt3D::QNode
  • 31 public functions inherited from QObject

Reimplemented Protected Functions

virtual void copy(const QNode * ref)
  • 3 protected functions inherited from Qt3D::QNode
  • 9 protected functions inherited from QObject

Additional Inherited Members

Detailed Description

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

By itself a Qt3D::QEntity is an empty shell. The behavior of a Qt3D::QEntity object is defined by the Qt3D::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 Qt3D::QTransform component whilst another may focus on Qt3D::QMouseInput.

See also Qt3D::QComponent and Qt3D::QTransform.

Member Function Documentation

QEntity::QEntity(QNode * parent = 0)

Constructs a new Qt3D::QEntity instance with parent as parent.

[virtual] QEntity::~QEntity()

void QEntity::addComponent(QComponent * comp)

Adds a new reference to the component comp.

Note: If the Qt3D::QComponent has no parent, the Qt3D::QEntity will set itself as its parent thereby taking ownership of the component.

QComponentList QEntity::components() const

Returns the list of Qt3D::QComponent instances the entity is referencing.

[virtual protected] void QEntity::copy(const QNode * ref)

Reimplemented from QNode::copy().

Copies all the properties and components of the Qt3D::QEntity ref to the current instance.

QEntity * QEntity::parentEntity() const

Returns the parent Qt3D::QEntity instance of this entity. If the immediate parent isn't a Qt3D::QEntity, this function traverses up the scene hierarchy until a parent Qt3D::QEntity is found. If no Qt3D::QEntity parent can be found, returns null.

QNodeId QEntity::parentEntityId() const

Returns the Qt3D::QNodeId id of the parent Qt3D::QEntity instance of the current Qt3D::QEntity object. The QNodeId isNull method will return true if there is no Qt3D::QEntity parent of the current Qt3D::QEntity in the scene hierarchy.

void QEntity::removeAllComponents()

Remove all references to the components.

void QEntity::removeComponent(QComponent * comp)

Removes the reference to comp.

© 2016 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.