QAbstractExtensionFactory Class
QAbstractExtensionFactory 类为Qt Widgets Designer 中的扩展工厂提供了一个接口。更多内容...
| 头文件: | #include <QAbstractExtensionFactory> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Designer) target_link_libraries(mytarget PRIVATE Qt6::Designer) |
| qmake: | QT += designer |
| 由以下接口继承: |
公共函数
| virtual | ~QAbstractExtensionFactory() |
| virtual QObject * | extension(QObject *object, const QString &iid) const = 0 |
详细说明
QAbstractExtensionFactory 不应被直接实例化;请改用QExtensionFactory 。
在Qt Widgets Designer 中,扩展工厂用于在需要时查找并创建命名扩展。因此,在实现自定义扩展时,您还必须创建一个QExtensionFactory (即能够实例化您的扩展的类),并使用Qt Widgets Designer 的extension manager 对其进行注册。
当需要某个扩展时,Qt Widgets Designer 的extension manager 会遍历所有已注册的工厂,对每个工厂调用QExtensionFactory::createExtension(),直到找到第一个能够为所选对象创建所需扩展的工厂。该工厂随后将创建该扩展的实例。
另请参阅 QExtensionFactory 和QExtensionManager 。
© 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.