QAbstractAspect Class

class Qt3DCore::QAbstractAspect

QAbstractAspect is the base class for aspects that provide a vertical slice of behavior. More...

Header: #include <Qt3DCore/QAbstractAspect>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dcore)
target_link_libraries(mytarget PRIVATE Qt6::3dcore)
qmake: QT += 3dcore
Since: Qt 5.7
Inherits: QObject
Inherited By:

Qt3DAnimation::QAnimationAspect, Qt3DInput::QInputAspect, Qt3DLogic::QLogicAspect, and Qt3DRender::QRenderAspect

Public Functions

QAbstractAspect(QObject *parent = nullptr)
virtual QStringList dependencies() const
void scheduleSingleShotJob(const Qt3DCore::QAspectJobPtr &job)

Protected Functions

void registerBackendType(const Qt3DCore::QBackendNodeMapperPtr &functor)
void registerBackendType(const QMetaObject &obj, const Qt3DCore::QBackendNodeMapperPtr &functor)
Qt3DCore::QNodeId rootEntityId() const
void unregisterBackendType()
void unregisterBackendType(const QMetaObject &)

Macros

QT3D_REGISTER_ASPECT(name, AspectType)

Detailed Description

Member Function Documentation

QAbstractAspect::QAbstractAspect(QObject *parent = nullptr)

Constructs a new QAbstractAspect with parent

[virtual] QStringList QAbstractAspect::dependencies() const

[protected] template <typename Frontend> void QAbstractAspect::registerBackendType(const Qt3DCore::QBackendNodeMapperPtr &functor)

Registers backend with functor.

[protected] void QAbstractAspect::registerBackendType(const QMetaObject &obj, const Qt3DCore::QBackendNodeMapperPtr &functor)

Registers backend with obj and functor.

[protected] Qt3DCore::QNodeId QAbstractAspect::rootEntityId() const

Returns root entity node id.

void QAbstractAspect::scheduleSingleShotJob(const Qt3DCore::QAspectJobPtr &job)

[protected] template <typename Frontend> void QAbstractAspect::unregisterBackendType()

[protected] void QAbstractAspect::unregisterBackendType(const QMetaObject &)

Related Non-Members

QAspectJobPtr

A shared pointer for QAspectJob.

QBackendNodeMapperPtr

A shared pointer for QBackendNodeMapper.

Macro Documentation

QT3D_REGISTER_ASPECT(name, AspectType)

Convenience macro for registering AspectType for instantiation by the currently set Qt3DCore::QAspectFactory. This makes it possible to create an instance of AspectType in the aspect thread by later passing name to Qt3DCore::QAspectEngine::registerAspect(const QString &name).

Note: It is also possible to register a new aspect without using this macro by instead using Qt3DCore::QAspectEngine::registerAspect(QAbstractAspect *aspect) which will handle moving a previously created aspect instance to the aspect thread context.

KDAB has published a few articles about writing custom Qt3D aspects on their blog. These provide an excellent starting point if you wish to learn more about it.

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