QAspectEngine Class

(Qt3DCore::QAspectEngine)

Responsible for handling all the QAbstractAspect subclasses that have been registered with the scene. More...

Header: #include <QAspectEngine>
qmake: QT += 3dcore

Public Functions

QAspectEngine(QObject *parent = nullptr)
~QAspectEngine()
QVector<QAbstractAspect *> aspects() const
QVariant executeCommand(const QString &command)
void registerAspect(QAbstractAspect *aspect)
void registerAspect(const QString &name)
QEntityPtr rootEntity() const
void setRootEntity(QEntityPtr root)
void unregisterAspect(QAbstractAspect *aspect)
void unregisterAspect(const QString &name)
typedef QEntityPtr

Detailed Description

Responsible for handling all the QAbstractAspect subclasses that have been registered with the scene.

Member Function Documentation

QAspectEngine::QAspectEngine(QObject *parent = nullptr)

Constructs a new QAspectEngine with parent.

QAspectEngine::~QAspectEngine()

Destroys the engine.

QVector<QAbstractAspect *> QAspectEngine::aspects() const

Returns the aspects owned by the aspect engine.

QVariant QAspectEngine::executeCommand(const QString &command)

Executes the given command on aspect engine. Valid commands are:

  • "list aspects"

Returns the reply for the command.

void QAspectEngine::registerAspect(QAbstractAspect *aspect)

Registers a new aspect to the AspectManager. The QAspectEngine takes ownership of the aspect and will delete it when the aspect is unregistered.

void QAspectEngine::registerAspect(const QString &name)

Registers a new aspect to the AspectManager based on its name Uses the currently set aspect factory to create the actual aspect instance.

QEntityPtr QAspectEngine::rootEntity() const

Returns the root entity of the aspect engine.

See also setRootEntity().

void QAspectEngine::setRootEntity(QEntityPtr root)

Sets the root entity for the aspect engine.

See also rootEntity().

void QAspectEngine::unregisterAspect(QAbstractAspect *aspect)

Unregisters and deletes the given aspect.

void QAspectEngine::unregisterAspect(const QString &name)

Unregisters and deletes the aspect with the given name.

Related Non-Members

typedef Qt3DCore::QEntityPtr

A shared pointer for QEntity.