使用 QT Designer 在 GUI 中插入图像 [英] Inserting an image in GUI using QT Designer

查看:141
本文介绍了使用 QT Designer 在 GUI 中插入图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 QtDesigner 的新手.我想知道如何使用 QT Designer 在 GUI 中插入图像.我正在尝试添加徽标.将不胜感激.

I am new to QtDesigner. I wanted to know how to insert an image in the GUI using QT Designer. I am trying to add a logo. Help would be appreciated.

推荐答案

您可以开始插入标签.接下来,您右键单击它,然后单击更改富文本...".将弹出一个新窗口.点击图形图标插入图形".

You can start inserting a label. Next, you right click on it an then click "change rich text...". A new window will pop-up. Click on the figure Icon "Insert figure".

现在,您必须创建一个资源文件.单击铅笔按钮.接下来,点击新建资源文件"按钮.

Now, you have to create a resource file. Click on the Pencil button. Next, click on the "New resource file" button.

选择一个名称和一个文件夹(您的工作目录将是一个不错的选择)来保存它.

Choose a name and a folder (your working directory would be a good choice) to save it.

现在,点击添加前缀"按钮.

Now, click on the "Add prefix" button.

为它选择一个名称.

然后,点击添加文件"按钮.

Then, click on the "Add file" button.

然后你去!单击确定",您认为应该在那里.请注意,在使用之前,您应该将图形调整为合适的大小.

And there you go! Click "OK" and you figure should be there. Just be aware that you should resize your figure to a proper size before using it.

希望有帮助!

这篇关于使用 QT Designer 在 GUI 中插入图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆