Qt3DCore::QAbstractFunctor Class

class Qt3DCore::QAbstractFunctor

QAbstractFunctor 是所有函数的抽象基类。更多

头文件: #include <QAbstractFunctor>
CMake.QAbstractFunctor find_package(Qt6 REQUIRED COMPONENTS 3DCore)
target_link_libraries(mytarget PRIVATE Qt6::3DCore)
qmake: QT += 3dcore
继承于

Qt3DRender::QTextureGeneratorQt3DRender::QTextureImageDataGenerator

状态:已废弃

公共函数

virtual ~QAbstractFunctor()
const T *functor_cast(const Qt3DCore::QAbstractFunctor *other) const
virtual qintptr id() const = 0

QT3D_FUNCTOR(Class)

详细说明

QAbstractFunctor 用作 Qt3DCore 模块中所有函数和数据生成器的基类。

当用户定义一个新的函数器或数据生成器时,他们需要实现QAbstractFunctor::id() 方法,该方法应使用类定义中的QT3D_FUNCTOR 宏来实现。

成员函数文档

[virtual noexcept] QAbstractFunctor::~QAbstractFunctor()

毁灭者

template <typename T> const T *QAbstractFunctor::functor_cast(const Qt3DCore::QAbstractFunctor *other) const

如果另一个函数是 T 类型(或子类),本方法用于将函数other 转换为 T 类型;否则返回 0。本方法的工作原理与qobject_cast() 相似,但对从QAbstractFunctor 派生的函数除外。

警告: 如果 T 不是用QT3D_FUNCTOR 宏声明的,那么结果是未定义的。

[pure virtual] qintptr QAbstractFunctor::id() const

返回指向函数器 id 的指针。

宏文档

QT3D_FUNCTOR(Class)

该宏将 functor id 赋值给ClassQAbstractFunctor::functor_cast 使用该 id 来判断是否可以进行转置。

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