- Qt 5.15
- Qt 3D
- C++ Classes
- QAbstractAspect
- Qt 5.15.11 Reference Documentation

# QAbstractAspect Class

class Qt3DCore::QAbstractAspect

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

Header: | #include <Qt3DCore/QAbstractAspect>
qmake: | QT += 3dcore
Inherited By: | Qt3DAnimation::QAnimationAspect, Qt3DInput::QInputAspect, Qt3DLogic::QLogicAspect, and Qt3DRender::QRenderAspect

- List of all members, including inherited members

## Public Functions

| QAbstractAspect(QObject *parent = nullptr)

## Protected Functions

void | registerBackendType(const QBackendNodeMapperPtr &functor)
void | registerBackendType(const QMetaObject &obj, const QBackendNodeMapperPtr &functor)
QNodeId | rootEntityId() const

## Related Non-Members

typedef | QAspectJobPtr
typedef | QBackendNodeMapperPtr

## Macros

| QT3D_REGISTER_ASPECT(name, AspectType)

## Detailed Description

## Member Function Documentation

### QAbstractAspect::QAbstractAspect(QObject *parent = nullptr)

Constructs a new QAbstractAspect with parent

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

Registers backend with functor.

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

Registers backend with obj and functor.

### `[protected]` QNodeId QAbstractAspect::rootEntityId() const

Returns root entity node id.

## Related Non-Members

### typedef QAspectJobPtr

A shared pointer for QAspectJob.

### typedef 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.