使用……编辑资源Qt Widgets Designer

Qt Widgets Designer 完全支持Qt 资源系统,允许在设计表单时同步指定资源。为了帮助设计师和开发人员管理应用程序的资源,Qt Widgets Designer 的资源编辑器支持按表单定义资源。换句话说,每个表单都可以拥有独立的资源文件。
定义资源文件
要指定资源文件,您必须通过打开“工具”菜单并启用“资源浏览器”选项来启用资源编辑器。
![]() | 资源文件 在资源浏览器中,您可以打开现有资源文件或创建新文件。单击“编辑资源”按钮 |
资源文件加载后,您可以使用“添加文件”
和“删除文件”
按钮在其中创建或删除条目,并使用“添加文件”按钮
指定资源(例如图片)。请注意,这些资源必须位于当前资源文件的目录或其子目录之一中。
![]() | 编辑资源文件 点击 您可以通过在资源编辑器中选中相应的条目,然后点击“ |
使用资源
定义资源后,您可以在设计表单时主动使用它们。例如,您可以使用资源文件中指定的图标来创建一个工具按钮。
![]() | 使用资源 当修改可能在资源文件中定义的属性值时,Qt Widgets Designer 的属性编辑器除了提供常规的源文件选择选项外,还允许您指定资源。 |
![]() | 选择资源 您可以在设计过程的任何时候点击“选择资源...”来打开资源选择器,从而添加资源。 |
© 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.

来编辑资源。要重新加载资源,请单击“重新加载”按钮
。

