更改资源(如图标)不会重新编译 .qrc 文件 [英] Changing resources (like icons) doesn't recompile the .qrc file

查看:54
本文介绍了更改资源(如图标)不会重新编译 .qrc 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是带有 QT Visual Studio 集成的 Visual Studio 2005 IDE.QT 版本为 4.7.3.

I am using Visual Studio 2005 IDE with QT Visual Studio Integration. QT version is 4.7.3.

我有一个项目,其中一些资源定义在 QT 资源集合文件 (.qrc) 中.问题是每当我更改 .qrc 引用的某些文件的内容(如编辑图像和保存)时,这些更改都不会反映在应用程序中.原因是 .qrc 不会被 IDE 自动重新编译.每次更改资源时,我都必须手动重新编译它.

I have a project with some resources defined in a QT Resource Collection Files (.qrc). The problem is whenever I change the content of some file referenced by the .qrc (like editing an image and saving), the changes are not reflected in the application. The reason being the .qrc is not automatically recompiled by the IDE. I have to manually recompile it everytime I change a resource.

有人遇到过这个问题吗?任何已知的解决方法?
注意:该文件具有正确的自定义构建工具设置以使其编译.但是对 .qrc 文件依赖项的更改不会被标记为重新编译.

Any one faced this problem before? Any known workarounds?
NOTE: The file has the right Custom Build Tool settings to make it compile. But the changes to .qrc file dependencies are not flagged for recompilation.

这里提到了一个类似的 QT Creator 错误:
QT Creator 错误:.qrc 不重新编译

There is a similar bug mentioned for QT Creator here:
QT Creator Bug: .qrc doesn't recompile

谢谢!

推荐答案

我遇到了同样的问题:使其工作的唯一方法是将文件路径添加到 .qrc 的附加依赖项".这真的很烦人,我认为您不能在其中使用通配符,例如 *.ico.你必须把这样的东西:.\myicon.ico;.\anothericon.ico;.\somefile.xml

I'm having the same issue: the only way to make it work is to add the filepaths to the "Additional Dependencies" of the .qrc. It's really annoying, and I don't think you can use wildcards in there like *.ico. You have to put something like: .\myicon.ico;.\anothericon.ico;.\somefile.xml

并且确保为所有配置和平台设置它.

And make sure you set it for all configurations and platform.

QtVSAddin 确实应该这样做,但似乎没有.

The QtVSAddin should really do that, but it doesn't seem to.

这篇关于更改资源(如图标)不会重新编译 .qrc 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆