Qt Widgets Designer
提供了用于为Qt Widgets Designer 创建自定义控件插件的类,以及用于访问Qt Widgets Designer 组件的类。
此外,QFormBuilder 类还支持在运行时根据 UI 文件构建用户界面。
注意:本文档 涵盖了Qt Widgets Designer 工具以及与构建Qt Widgets 图形用户界面相关的类。 Qt Design Studio 是一款 UI 组合工具,涵盖了Qt Quick 用户界面的所有 UI 设计和实现步骤。
使用该模块
要使用 Qt 模块的 C++ API,需要与该模块库进行链接,既可以直接链接,也可以通过其他依赖项间接链接。包括CMake和qmake 在内的多种构建工具都对此提供了专门的支持。
使用 CMake 构建
使用find_package() 命令在Qt6 软件包中定位所需的模块组件:
find_package(Qt6 REQUIRED COMPONENTS Designer)
target_link_libraries(mytarget PRIVATE Qt6::Designer)更多详细信息,请参阅“使用 CMake 构建”概述。
使用 qmake 进行构建
要配置模块以便使用 qmake 进行构建,请在项目的 .pro 文件中将该模块作为QT 变量的值添加:
QT += designer文章与指南
以下文章包含有关Qt Widgets Designer 的信息。
- 为Qt Widgets Designer 创建和使用组件- 创建和使用自定义小部件插件
- Qt Widgets Designer 手册- 使用Qt Widgets Designer
API 参考
以下是 API 参考资料的链接。
© 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.