Qt3DCore::QAbstractAspect Class
class Qt3DCore::QAbstractAspectQAbstractAspect 是提供垂直行为片断的方面的基类。更多
头文件: | #include <Qt3DCore/QAbstractAspect> |
CMake.QAbstractAspect | 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 方面的文章。如果您想了解更多相关信息,这些文章是一个很好的起点。
© 2025 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.