Qt5.7设置应用程序图标-基于Windows
2017-02-08 09:56
253 查看
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, assuming you are using qmake to generate your makefiles, you only need to add a single line to your .pro project file:
RC_ICONS = myappico.ico
Finally, regenerate your makefile and your application. The .exe file will now be represented by your icon in Explorer.
However, if you already have an .rc file, for example, with the name myapp.rc, which you want to reuse, the following two steps will be required. First, put a single line of text to the myapp.rc file:
IDI_ICON1 ICON DISCARDABLE "myappico.ico"
Then, add this line to your myapp.pro file:
RC_FILE = myapp.rc
If you do not use qmake, the necessary steps are: first, create an .rc file and run the rc or windres program on the .rc file, then link your application with the resulting .res file.
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, assuming you are using qmake to generate your makefiles, you only need to add a single line to your .pro project file:
RC_ICONS = myappico.ico
Finally, regenerate your makefile and your application. The .exe file will now be represented by your icon in Explorer.
However, if you already have an .rc file, for example, with the name myapp.rc, which you want to reuse, the following two steps will be required. First, put a single line of text to the myapp.rc file:
IDI_ICON1 ICON DISCARDABLE "myappico.ico"
Then, add this line to your myapp.pro file:
RC_FILE = myapp.rc
If you do not use qmake, the necessary steps are: first, create an .rc file and run the rc or windres program on the .rc file, then link your application with the resulting .res file.
相关文章推荐
- Creating Dialogbased Windows Application (3) / 创建基于对话框的Windows应用程序(三)Checkbox的应用、窗体置顶、设置图标 / VC++, Windows
- Qt 设置应用程序图标(windows)
- 设置Windows应用程序图标方法笔记
- Qt4怎样设置应用程序的图标-windows平台
- 基于Debug模式windows应用程序app.config设置
- Qt4怎样设置应用程序的图标-windows平台
- 在Windows平台为qt应用程序设置图标
- Qt4怎样设置应用程序的图标-windows平台
- 浅谈用Visual C#开发基于OpenCV的Windows应用程序
- 基于.NET Framework 的Windows应用程序如何回收内存
- Windows窗体编程基础学习:使用 NotifyIcon 组件向任务栏添加应用程序图标
- windows应用程序(C#)生成的EXE文件图标修改
- qt4: 为应用程序设置一个图标 (窗口左上角 程序图标)
- 使用 Microsoft.NET Frameworks 创建基于 Windows 的应用程序
- 设置vs2005应用程序做完后的exe图标
- vs.net应用程序图标以及制作安装程序快捷方式图标设置
- 设置Qt应用程序图标
- 设置应用程序(exe)图标 Qt4
- 地磅称量系统之(24~26)创建一个名称为WinApp的Windows应用程序作为启动项目并且设置主界面上控件的属性
- 使用 Microsoft.NET Frameworks 创建基于 Windows 的应用程序