简体   繁体   English

Qt应用程序图标不起作用

[英]Qt Application Icon doesn't work

I created a small .ico for my program. 我为程序创建了一个小的.ico。 Now I want Qt to set it as the applications icon. 现在,我希望Qt将其设置为应用程序图标。

I found this documentation but it doesn't seem to work : http://qt-project.org/doc/qt-4.8/appicon.html 我找到了此文档,但似乎不起作用: 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. 创建一个myapp.rc文件,并将IDI_ICON102 ICON DISCARDABLE "Movie-World.ico"写入其中。 -> Did that. ->做到了。
  2. Write RC_FILE += myapp.rc into your .pro file. RC_FILE += myapp.rc写入您的.pro文件。
    -> Did that. ->做到了。

When I compile and run, it doesn't work. 当我编译并运行时,它不起作用。 I deleted the realese folder but still no changes. 我删除了realese文件夹,但仍然没有任何更改。 I restarted Qt but still no changes. 我重新启动了Qt,但仍然没有任何更改。

I even added win32: before RC_FILE += myapp.rc but it did not work... 我什至在RC_FILE += myapp.rc之前添加了win32:但它没有用...

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'. mingw32-make [1]: *'release / myapp_res.o'不需要创建目标'.. \\ Qt'的规则。 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' makefile:34:目标“发布”的配方失败mingw32-make:* [发布]错误2 18:11:33:进程“ C:\\ Qt \\ Tools \\ mingw48_32 \\ bin \\ mingw32-make.exe”已退出,并带有代码2.生成/部署项目Project1时出错(工具包:Desktop Qt 5.1.1 MinGW 32bit)执行步骤“ Make”时

You should 你应该

  • go to project on the left side of Qt Creator 去Qt Creator左侧的项目
  • press right mouse button and 按下鼠标右键,然后
  • “Run Qmake” “运行Qmake”

In my case, the folder containing my project has a space in the name. 就我而言,包含我的项目的文件夹的名称中有一个空格。 When I removed the space, it worked. 当我删除空间时,它起作用了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM