|
发表于 2015-4-22 20:53:23
|
显示全部楼层
还没翻译完,你看看怎么样?
The application icon, typically displayed in the top-left corner of an application's top-level windows, is set by calling the QWindow::setWindowIcon() method.
应用图标,通常显示在应用顶层窗口的左上角,被QWindow的setWindowIcon()方法设置。
In order to change the icon of the executable application file itself, as it is presented on the desktop (i.e., prior to application execution), it is necessary to employ another, platform-dependent technique.
一个应用为了在显示在桌面上时(运行前)改变自身的图标,有必要用到一个与平台有关的技术。
Setting the Application Icon on Windows
在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.)
首先,创建一个包含图标图像的ico格式的位图(你可以用Microsoft Visual C++的图标编辑器来完成,当然还有其它方法)
Store the ICO file in your application's source code directory, for example, with the name myappico.ico.
将ico文件存储在你的应用的资源库里,以下用myapp.ico举例。
Then, assuming you are using qmake to generate your makefiles, you only need to add a single line to your .pro project file:
然后,假设你正在使用qmake生成你的makefile文件,你只需要添加一行代码到你的.pro项目:
RC_ICONS = myappico.ico
Finally, regenerate your makefile and your application. The .exe file will now be represented by your icon in Explorer.
最后,生成makefile和你的应用程序。生成的.exe文件将在资源管理器显示你的图标。 |
|