Active Qt
Qt 的 ActiveX 和 COM 支持使 Qt for Windows 开发人员能够
- 在 Qt 应用程序中访问和使用任何 ActiveX 服务器提供的 ActiveX 控件和 COM 对象。
- 将其 Qt 应用程序作为 COM 服务器使用,将任意数量的 Qt 对象和窗口小部件作为 COM 对象和 ActiveX 控件使用。
有关在 Qt中使用 ActiveX 的更多信息,请参阅在 Qt 中构建 ActiveX 服务器。
ActiveQt 框架由两个模块组成:
- QAxContainer模块是一个静态库,它实现了QObject 子类QAxObject 和QWidget 子类QAxWidget ,作为 COM 对象和 ActiveX 控件的容器。
- QAxServer模块是一个静态库,用于实现进程内和可执行 COM 服务器的功能。该模块提供了QAxAggregated 、QAxBindable 和QAxFactory 类。
为简化使用 ActiveX 的 Qt 项目的开发和构建提供了一套工具。
使用模块
使用 Qt 模块的 C++ API 需要直接或通过其他依赖关系与模块库链接。包括CMake和qmake 在内的多个构建工具都为此提供了专门支持。
使用 CMake 构建
使用find_package()
命令在Qt6
软件包中找到所需的模块组件:
find_package(Qt6 REQUIRED COMPONENTS AxContainer AxServer) target_link_libraries(mytarget PRIVATE Qt6::AxContainer Qt6::AxServer)
更多详情,请参阅使用 CMake 构建概述。
使用 qmake 构建
要配置使用 qmake 构建的模块,请在项目的 .pro 文件中添加模块作为QT
变量的值:
QT += axcontainer axserver
文章和指南
实例
参考示例
许可证和归属
QAxContainer 和QAxServer 模块可在Qt Company 的商业许可下使用。此外,它们还可根据BSD 3 条款 "新 "或 "修订 "许可证使用。
更多详情,请参阅Qt 许可。
© 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.