嵌入在Executeable中的Qt图标 [英] Qt Icon embedded in Executeable

查看:103
本文介绍了嵌入在Executeable中的Qt图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Tabwidget上有一些按钮.这些按钮的顶部需要有一些图标.

I have some buttons on a tabwidget. These buttons need to have some icon on top of them.

我知道QPixmap可以将图像放在按钮顶部,但是我看到这些构造函数将文件路径作为参数.我想避免在构建后在文件中四处拖动图标.我想以某种方式将这些图标嵌入可执行文件中,以减少为了使其工作而需要拖拉的行李.

I am aware of QPixmap that will allow me to put an image on top of a button, but I see that these constructors take a filepath as a parameter. I want to avoid dragging icons around in a file after I build. I would like to embed these icons in the executeable somehow, so as to reduce the baggage that I need to lug around in order to make it work.

我该怎么做?

我有兴趣听到一些方法来实现我的目标,即不需要在可执行文件中拖动图标文件;如果您对我可能会使用的某些术语感到困惑,请关注这一方面,因为我仍在学习Qt.

I am interested in hearing ways to accomplish my goal of not needing to drag icon files around with the executable; please focus on this aspect if you are confused about some terminology I may have used, as I am still learning Qt.

推荐答案

您当然可以在应用程序中嵌入图标,图像和所有其他自定义资源. 请阅读 Qt 4的资源系统(或

Of course you can embed icons, images and all other custom resources into your application. Please read The Qt 4's Resource System (or click here for Qt 5)

这篇关于嵌入在Executeable中的Qt图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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