QT学习:Qt中应用程序图标的修改

来源:互联网 发布:sniffer捕获别人的数据 编辑:程序博客网 时间:2024/05/20 05:54
以下是在Qt assistant中找到的修改应用程序图标的方法,留着以后用。

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++: SelectFile|New, then select theFiletab in the dialog that appears, and chooseIcon. (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 namemyappico.ico. Then, create a text file called, say,myapp.rcin 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 yourmyapp.profile:

RC_FILE = myapp.rc

Regenerate your makefile and your application. The .exefile will now be represented with your icon in Explorer.

If you do not use qmake, the necessary steps are: first, run thercprogram on the.rcfile, then link your application with the resulting.resfile. 

这里给一个icon图标下载的网址:

http://www.easyicon.net/