Qt Application Icon doesn't work

2019-06-01 17:41发布

I created a small .ico for my program. Now I want Qt to set it as the applications icon.

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.

  1. Create an myapp.rc file and write IDI_ICON102 ICON DISCARDABLE "Movie-World.ico" into it. -> Did that.
  2. Write RC_FILE += myapp.rc into your .pro file.
    -> Did that.

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.

I even added win32: before RC_FILE += myapp.rc but it did not work...

I don't understand why. My files are all in the same directory.

Now I get this error message :

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'

标签: c++ icons qt5
2条回答
The star\"
2楼-- · 2019-06-01 18:18

You should

  • go to project on the left side of Qt Creator
  • press right mouse button and
  • “Run Qmake”
查看更多
老娘就宠你
3楼-- · 2019-06-01 18:21

In my case, the folder containing my project has a space in the name. When I removed the space, it worked.

查看更多
登录 后发表回答