How to set the QT Application icon in the windows.
2012-10-15 18:46
585 查看
在Qt助手(assistant.exe)搜索关键字"Setting the Application Icon"就可以看到在各种平台设置Qt程序图标的方法。
首先准备个ICO图标。例如:myappico.ico 用任何文本编辑器新建个文件
里面就写一行:
[cpp] view
plaincopy
IDI_ICON1 ICON DISCARDABLE "myappico.ico"
保存改名为 myapp.rc并把它和你的图标myappico.ico一起复制到你的QT工程项目的目录。
用记事本打开你的QT工程文件(如 "myapp.pro" ),在里面最后新添一行
[cpp] view
plaincopy
RC_FILE = myapp.rc
在程序中添加代码:
//app is the individual QAppcation Object
//app是程序中唯一的QApplication对象
[cpp] view
plaincopy
app.setWindowIcon(QIcon("myappico.ico"));
首先准备个ICO图标。例如:myappico.ico 用任何文本编辑器新建个文件
里面就写一行:
[cpp] view
plaincopy
IDI_ICON1 ICON DISCARDABLE "myappico.ico"
保存改名为 myapp.rc并把它和你的图标myappico.ico一起复制到你的QT工程项目的目录。
用记事本打开你的QT工程文件(如 "myapp.pro" ),在里面最后新添一行
[cpp] view
plaincopy
RC_FILE = myapp.rc
在程序中添加代码:
//app is the individual QAppcation Object
//app是程序中唯一的QApplication对象
[cpp] view
plaincopy
app.setWindowIcon(QIcon("myappico.ico"));
相关文章推荐
- How to Change the Icon for a File Type in Windows 7 and Vista(转)
- How to embed an icon in a Qt application
- How to Integrate Excel in a Windows Form Application using the WebBrowser
- How can I force Python's file.write() to use the same newline format in Windows as in Linux (“\r\n”
- How to set the sequence value while saving the record in OA Framework
- Here's an example that shows how to enumerate through the features of a selection set, returning the value of each field in the attribute table except for the geometry colum.
- How to get the running applications in windows task manager using powershell
- How to fix Rosetta stone error 2123 -- "This was an error in the application"
- How to change the language of oracle sqlplus from chinese to english in windows(如何将oracle sql plus中的中文变成英文版)
- How to set up OpenERP for various timezone kindly follow the following steps to select timezone in OpenERP
- This application failed to start because it could not find or load the Qt platform plugin "windows"
- How to fix Rosetta stone error 2123 -- "This was an error in the application"
- [转]How to set the control word of FPU in delphi
- How to install the third party modules under the pyCharm in the Windows
- How to Set Up SQL Server 2008 FileStream In the Cluster
- How to get and set the system socket buffer in AIX?
- This application failed to start because it could not find or load the Qt platform plugin "xcb" in "
- How to check if the silverlight application is in design mode?
- How To Customise the Tab Bar (UITabBar) in an iPhone Application (Part 1 of 2)
- This application failed to start because it could not find or load the Qt platform plugin "xcb" in "