How to always compile a file?

前端 未结 1 643
甜味超标
甜味超标 2021-01-21 10:45

I have a Qt project with QML files. Whenever I change these files, I have to manually right click the .qrc (resources) file and recompile it.

How do I tell visual studi

1条回答
  •  粉色の甜心
    2021-01-21 11:18

    I encountered the same problem while building qt apps using Qt Creator.(Especially while using QML files as resources.) I solved the problem using a little hack.

    • Created a batch file say touch.bat in my source directory.
    • This batch file contains a single line copy qml.qrc /B+ ,,/Y where qml.qrc is the resource file name.
    • Opened my project in QtCreator and went to Project->Build Steps->Add Build Step->Custom process step and entered touch.bat
    • Whenever the project build starts, the qml.qrc is touched. The build system thinks that qml.qrc is modified and builds it.

    You can modify this hack for Visual Studio also.(I have not tried). Try adding touch.bat as a build step in Visual studio. The idea is to fool the build system to think that your .qrc is modified.

    I guess this is a known bug which remains unresolved. Check this bug report. Thanks.

    0 讨论(0)
提交回复
热议问题