Qt Graphs 小工具

Widget 支持包含在自己的模块中,以避免在仅构建 QML 应用程序时对 QtWidgets 的硬性依赖。

使用模块

使用 Qt 模块的 C++ API 需要直接或通过其他依赖关系链接模块库。有几种构建工具为此提供了专门支持,包括CMakeqmake

使用 CMake 构建

使用find_package() 命令在Qt6 软件包中找到所需的模块组件:

find_package(Qt6 REQUIRED COMPONENTS GraphsWidgets)
target_link_libraries(mytarget PRIVATE Qt6::GraphsWidgets)

更多详情,请参阅使用 CMake 构建概述。

使用 qmake 构建

要配置模块以便用 qmake 构建,请在项目的 .pro 文件中添加模块作为QT 变量的值:

QT += graphswidgets

API 参考

许可与归属

Qt Graphs Widgets 可在Qt Company 的商业许可下使用。此外,它还受GNU 通用公共许可证第 3 版的保护。详情请参阅Qt Licensing

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