找回密码
 立即注册
收起左侧

怎么设置应用程序.exe的图标不是左上角的图标。

3
回复
7285
查看
[复制链接]
累计签到:5 天
连续签到:1 天
来源: 2015-6-16 12:34:25 显示全部楼层 |阅读模式
5Qter豆
如题,按照Qt助手的设置方法设置了一遍还是不行。求教,用的是Qt最新版

最佳答案

查看完整内容

Setting the Application Icon on Windows First, create an ICO format bitmap file that contains the icon image. This can be done with e.g. Microsoft Visual C++: Select File|New, then select the File tab in the dialog that appears, and choose Icon. (Note that you do not need to load your application into Visual C++; here we are only using the icon editor.) Store the ICO file in your application's s ...
回复

使用道具 举报

累计签到:595 天
连续签到:1 天
2015-6-16 12:34:26 显示全部楼层
Setting the Application Icon on Windows

First, create an ICO format bitmap file that contains the icon image. This can be done with e.g. Microsoft Visual C++: Select File|New, then select the File tab in the dialog that appears, and choose Icon. (Note that you do not need to load your application into Visual C++; here we are only using the icon editor.)

Store the ICO file in your application's source code directory, for example, with the name myappico.ico. Then, create a text file called, say, myapp.rc in which you put a single line of text:

IDI_ICON1               ICON    DISCARDABLE     "myappico.ico"
Finally, assuming you are using qmake to generate your makefiles, add this line to your myapp.pro file:

RC_FILE = myapp.rc
Regenerate your makefile and your application. The .exe file will now be represented with your icon in Explorer.

If you do not use qmake, the necessary steps are: first, run the rc program on the .rc file, then link your application with the resulting .res file.
回复

使用道具 举报

尚未签到

2015-6-16 14:27:03 显示全部楼层
我记得有个什么ico文件添加到pro的?    听说而已,我只用linux
回复

使用道具 举报

累计签到:87 天
连续签到:1 天
2015-6-17 15:50:28 显示全部楼层
如果是Qt5版本的直接把ico文件放到源码目录,然后pro文件加上这行代码就可以了RC_ICONS = my.ico
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

公告
可以关注我们的微信公众号yafeilinux_friends获取最新动态,或者加入QQ会员群进行交流:190741849、186601429(已满) 我知道了