• 9394阅读
  • 13回复

怎么编程改变.exe的图标! [复制链接]

上一主题 下一主题
离线wangbenqq
 

只看楼主 倒序阅读 楼主  发表于: 2008-03-28
— 本帖被 XChinux 执行加亮操作(2008-03-29) —
我用QT写的软件,但是我的软件生成的exe文件的图表是白的!我想把图标设置成自己希望的图标!我不知道用QT怎么来设置!
哪位高手会啊??
请赐教!!!!!!!!!!
谢谢!

还有就是程序窗口左上角的那个图表怎么也是白的,怎么改变啊?
离线captain08
只看该作者 1楼 发表于: 2008-03-28
程序窗口左上角的那个图标,可以在mainwindow的windowIcon属性中添加。
离线wangbenqq

只看该作者 2楼 发表于: 2008-03-28
哈哈,会了!在QT的文档里找到的!谢谢!呵呵
还是QT的原版文档权威啊!
还是建议大家看QT自带的文档,其他什么书就都不用看了!
离线penguinx
只看该作者 3楼 发表于: 2008-03-29
请问LZ那个.exe的图标怎么改的?窗口左上方的好办!
Do it!Not just say!
离线levine
只看该作者 4楼 发表于: 2008-03-29
1. 用自己的icon文件替换工程中原来的文件
2. 重新build工程
离线XChinux

只看该作者 5楼 发表于: 2008-03-29
在Assistant中查"Setting the Application Icon"节
二笔 openSUSE Vim N9 BB10 XChinux@163.com 网易博客 腾讯微博
承接C++/Qt、Qt UI界面、PHP及预算报销系统开发业务
离线captain08
只看该作者 6楼 发表于: 2008-03-29
这么简单呀!
应该多看看QT自带的文档。
离线penguinx
只看该作者 7楼 发表于: 2008-03-30
文档是个好东西!顶!!!!!!
Do it!Not just say!
离线wangbenqq

只看该作者 8楼 发表于: 2008-03-31
对啊,文档很管用的,但是就是搜索的时候不是太方便,呵呵,有时候不知道该怎么搜索!
哈哈!
离线firefly_liu

只看该作者 9楼 发表于: 2009-03-27
我也搞定了,不过你们也太墨迹了,弄出来就把方法写出来嘛,真是的,我会把方法写道我的博客里的
离线zhshzhjhust
只看该作者 10楼 发表于: 2009-03-27
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.
离线jinyu
只看该作者 11楼 发表于: 2009-05-08
具体在文档中的什么地方呢,在文档中怎么找到呢
离线jinyu
只看该作者 12楼 发表于: 2009-05-08
按照zhshzhjhust 发的资料的确成功了,可是为什么RC_FILE = myapp.rc 就会让exe 换了图标呢。程序中也没用到 IDI_ICON1   啊,谁给解释下吧。还用在帮助文档中怎么找到得呢?
离线hxcan

只看该作者 13楼 发表于: 2009-05-08
我还以为是说“怎么改变其它程序的图标”呢,嘿嘿。
本座已达到法定娶亲年龄,欲购从速,价格面谈。
杀人容易爱人难。
作为一个太极美术工程师,我深刻地感受到:世风日下、人心不古。
http://StupidBeauty.com/Blog
快速回复
限100 字节
 
上一个 下一个