Qt 5 Core Compatibility APIs
Qt 5 Core Compatibility 模块包含 Qt 6 中移除的 Qt 5 Core API。该模块有助于向 Qt 6 过渡。
使用模块
使用 Qt 模块的 C++ API 需要直接或通过其他依赖关系与模块库链接。有几种构建工具为此提供了专门支持,包括CMake和qmake。
使用 CMake 构建
使用find_package()
命令在Qt6
软件包中找到所需的模块组件:
find_package(Qt6 REQUIRED COMPONENTS Core5Compat) target_link_libraries(mytarget PRIVATE Qt6::Core5Compat)
更多详情,请参阅使用 CMake 构建概述。
使用 qmake 构建
要配置模块以便用 qmake 构建,可在项目的 .pro 文件中将模块添加为QT
变量的值:
QT += core5compat
参考资料
许可证和属性
Qt 5 Core Compat 由The Qt Company 根据商业许可提供。此外,它还受自由软件许可证的保护:GNU 宽通用公共许可证第 3 版或GNU 通用公共许可证第 2 版。更多详情,请参阅Qt 许可。
此外,Qt 6.9.0 中的 Qt 5 Core Compat 包含以下许可协议下的第三方模块:
BSD 2-条款 "简化 "许可证 | |
BSD 2-条款 "简化 "许可证 | |
BSD 2-条款 "简化 "许可 | |
BSD 2-条款 "简化 "许可 | |
BSD 2-条款 "简化 "许可 | |
BSD 2-条款 "简化" 许可 | |
BSD 2-条款 "简化" 许可 |
© 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.