Auf dieser Seite

Qt3DCore::QAbstractAspect Class

class Qt3DCore::QAbstractAspect

QAbstractAspect ist die Basisklasse für Aspekte, die einen vertikalen Ausschnitt des Verhaltens darstellen. Mehr...

Header: #include <Qt3DCore/QAbstractAspect>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3DCore)
target_link_libraries(mytarget PRIVATE Qt6::3DCore)
qmake: QT += 3dcore
Erbt von: QObject
Vererbt an:

Qt3DAnimation::QAnimationAspect, „ Qt3DInput::QInputAspect “, „ Qt3DLogic::QLogicAspect “ und Qt3DRender::QRenderAspect

Status: Veraltet

Diese Klasse ist veraltet. Wir raten dringend davon ab, sie in neuem Code zu verwenden.

Öffentliche Funktionen

QAbstractAspect(QObject *parent = nullptr)

Geschützte Funktionen

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

Makros

QT3D_REGISTER_ASPECT(name, AspectType)

Ausführliche Beschreibung

Dokumentation zu Mitgliedsfunktionen

[explicit] QAbstractAspect::QAbstractAspect(QObject *parent = nullptr)

Erstellt ein neues `QAbstractAspect` mit parent

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

Registriert das Backend unter functor.

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

Registriert das Backend bei obj und functor.

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

Gibt die ID des Stammknotens zurück.

Verwandte Nicht-Mitglieder

QAspectJobPtr

Ein Shared Pointer für QAspectJob.

QBackendNodeMapperPtr

Ein Shared Pointer für QBackendNodeMapper.

Makro-Dokumentation

QT3D_REGISTER_ASPECT(name, AspectType)

Praktisches Makro zur Registrierung von „ AspectType “ für die Instanziierung durch die aktuell festgelegte „Qt3DCore::QAspectFactory“. Dies ermöglicht es, eine Instanz von „ AspectType “ im Aspekt-Thread zu erstellen, indem später „ name “ an „ Qt3DCore::QAspectEngine::registerAspect(const QString &name)“ übergeben wird.

Hinweis: Es ist auch möglich, einen neuen Aspekt ohne Verwendung dieses Makros zu registrieren, indem stattdessen Qt3DCore::QAspectEngine::registerAspect(QAbstractAspect *aspect) verwendet wird, wodurch eine zuvor erstellte Aspektinstanz in den Kontext des Aspekt-Threads verschoben wird.

KDAB hat in seinem Blog einige Artikel zum Schreiben benutzerdefinierter Qt3D-Aspekte veröffentlicht. Diese bieten einen hervorragenden Einstieg, wenn Sie mehr darüber erfahren möchten.

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