Qt3DCore::QAbstractAspect Class
class Qt3DCore::QAbstractAspectQAbstractAspect 是为提供行为垂直切片的切面所定义的基类。更多内容...
| 标题: | #include <Qt3DCore/QAbstractAspect> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3DCore) target_link_libraries(mytarget PRIVATE Qt6::3DCore) |
| qmake: | QT += 3dcore |
| 继承自: | QObject |
| 继承自: | Qt3DAnimation::QAnimationAspect、Qt3DInput::QInputAspect 、Qt3DLogic::QLogicAspect 以及Qt3DRender::QRenderAspect |
| 状态: | 已弃用 |
该类已弃用。我们强烈建议不要在新代码中使用它。
公共函数
| QAbstractAspect(QObject *parent = nullptr) |
受保护函数
| void | registerBackendType(const Qt3DCore::QBackendNodeMapperPtr &functor) |
| void | registerBackendType(const QMetaObject &obj, const Qt3DCore::QBackendNodeMapperPtr &functor) |
| Qt3DCore::QNodeId | rootEntityId() const |
相关的非成员
宏
| QT3D_REGISTER_ASPECT(name, AspectType) |
成员函数文档
[explicit] QAbstractAspect::QAbstractAspect(QObject *parent = nullptr)
使用以下内容构建一个新的 QAbstractAspect:parent
[protected] template <typename Frontend> void QAbstractAspect::registerBackendType(const Qt3DCore::QBackendNodeMapperPtr &functor)
将后端注册到functor 。
[protected] void QAbstractAspect::registerBackendType(const QMetaObject &obj, const Qt3DCore::QBackendNodeMapperPtr &functor)
将后端注册到obj 和functor 。
[noexcept protected] Qt3DCore::QNodeId QAbstractAspect::rootEntityId() const
返回根实体节点的 ID。
宏文档
QT3D_REGISTER_ASPECT(name, AspectType)
一个便捷宏,用于注册AspectType ,以便由当前设置的Qt3DCore::QAspectFactory进行实例化。这使得可以通过稍后将name 传递给Qt3DCore::QAspectEngine::registerAspect(constQString &name),在切面线程中创建AspectType 的实例。
注意:也可以 不使用此宏,而是使用Qt3DCore::QAspectEngine::registerAspect(QAbstractAspect *aspect) 来注册新的方面,该函数会负责将先前创建的方面实例移动到方面线程上下文中。
KDAB在其博客上发布了几篇关于编写自定义 Qt3D 方面的文章。如果您希望进一步了解相关内容,这些文章将是一个绝佳的起点。
© 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.