Qt应用程序图标不工作 [英] Qt Application Icon doesn't work
问题描述
我为我的程序创建了一个小的.ico。现在我想要Qt将其设置为应用程序图标。
I created a small .ico for my program. Now I want Qt to set it as the applications icon.
我找到这个文件,但似乎不工作: http://qt-project.org/doc/qt-4.8/appicon.html
I found this documentation but it doesn't seem to work : http://qt-project.org/doc/qt-4.8/appicon.html
我做了他们想要我做什么。
I did exactly what they want me to do.
- 创建myapp.rc文件并写入
IDI_ICON102 ICON DISCARDABLEMovie-World.ico
。 - > - 将
RC_FILE + = myapp.rc
写入.pro文件。
- >
- Create an myapp.rc file and write
IDI_ICON102 ICON DISCARDABLE "Movie-World.ico"
into it. -> Did that. - Write
RC_FILE += myapp.rc
into your .pro file.
-> Did that.
当我编译和运行时,它不工作。我删除了realese文件夹,但仍然没有更改。我重新启动了Qt但仍然没有任何变化。
When I compile and run, it doesn't work. I deleted the realese folder but still no changes. I restarted Qt but still no changes.
我在之前添加了
但它不工作... win32:
= myapp.rc
I even added win32:
before RC_FILE += myapp.rc
but it did not work...
我不明白为什么。
现在我收到此错误消息:
Now I get this error message :
mingw32-make [1]: *没有规则使目标'.. \Qt',需要
'release / myapp_res.o'。停止。 makefile:34:目标'release'的配方
失败mingw32-make:* 错误2 18:11:33:进程
C:\Qt\Tools \mingw48_32\bin\mingw32-make.exe退出代码2.
构建/部署项目时出错Project1(kit:Desktop Qt 5.1.1
MinGW 32bit)执行步骤'Make
mingw32-make[1]: * No rule to make target '..\Qt', needed by 'release/myapp_res.o'. Stop. makefile:34: recipe for target 'release' failed mingw32-make: * [release] Error 2 18:11:33: The process "C:\Qt\Tools\mingw48_32\bin\mingw32-make.exe" exited with code 2. Error while building/deploying project Project1 (kit: Desktop Qt 5.1.1 MinGW 32bit) When executing step 'Make'
推荐答案
您应该
- 转到Qt Creator左侧的项目
- 按鼠标右键和
- 运行Qmake
这篇关于Qt应用程序图标不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!