Changing resources (like icons) doesn't recomp

2019-06-27 01:37发布

问题:

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

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.

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.

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

Thanks!

回答1:

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.

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



回答2:

I had similar problem. Apparently Windows saves most used files in cache. Search C:\ for your file name that is giving trouble. Bet you can find it on Windows drive. Just remove it and rebuild all.