Qt Widgets 设计器

提供用于为Qt Widgets Designer 创建自定义 widget 插件的类,以及用于访问Qt Widgets Designer 组件的类。

此外,QFormBuilder 类提供了在运行时从用户界面文件构建用户界面的可能性。

注: 本文档涵盖Qt Widgets Designer 工具和与构建图形用户界面相关的类,用于Qt WidgetsQt Design StudioDesigner 是一个用户界面组合工具,涵盖了Qt Quick 用户界面的用户界面设计和实现的所有步骤。

使用模块

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

使用 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 的信息。

API 参考资料

这些是指向 API 参考资料的链接。

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