QComponent Class

(Qt3DCore::QComponent)

The base class of scene nodes that can be aggregated by Qt3DCore::QEntity instances as a component. More...

Properties

Public Functions

QComponent(QNode *parent = nullptr)
~QComponent()
QVector<QEntity *> entities() const
bool isShareable() const

Public Slots

void setShareable(bool isShareable)

Signals

void addedToEntity(QEntity *entity)
void removedFromEntity(QEntity *entity)
void shareableChanged(bool isShareable)

Additional Inherited Members

  • 11 static public members inherited from QObject
  • 2 protected functions inherited from Qt3DCore::QNode
  • 9 protected functions inherited from QObject

Detailed Description

The base class of scene nodes that can be aggregated by Qt3DCore::QEntity instances as a component.

A Qt3DCore::QComponent provides a vertical slice of behavior that can be assigned to and sometimes shared across Qt3DCore::QEntity instances.

Qt3DCore::QComponent subclasses are often aggregated in groups that impart useful behavior to the aggregating entity. For example, to have an Entity that gets drawn by the Qt3D renderer aspect, an entity would most likely aggregate Qt3DCore::QTransform, Qt3DRender::QMesh, and Qt3DRender::QMaterial components.

See also Qt3DCore::QEntity.

Property Documentation

isShareable : bool

Holds the shareable flag of the QComponent. The QComponent can be shared across several entities if true.

Access functions:

bool isShareable() const
void setShareable(bool isShareable)

Notifier signal:

void shareableChanged(bool isShareable)

Member Function Documentation

QComponent::QComponent(QNode *parent = nullptr)

Constructs a new QComponent instance with parent as the parent.

Note: a QComponent should never be instanced directly, instance one of the subclasses instead.

QComponent::~QComponent()

Destroys the instance of QComponent.

[signal] void QComponent::addedToEntity(QEntity *entity)

QVector<QEntity *> QComponent::entities() const

Returns a QVector containing all the entities that reference this component.

[signal] void QComponent::removedFromEntity(QEntity *entity)

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