How do I set my application version for Windows in

2019-07-14 09:54发布

问题:

When my application crashes, the Windows Event Viewer always reports my application version as "0.0.0.0". I can't figure how to set the application version in a way that the Windows Event Viewer recognizes. Changing it with QApplication::setApplicationVersion() doesn't seem to do it.

Obviously there are better ways to debug a program than the Windows Crash Log, but in lieu of all of that, how would I go about setting this value so that Windows recognizes it? My IDE is Qt Creator.

回答1:

You can set the VERSION qmake variable in your pro file:

VERSION = 1.0.0.0

On Windows, triggers auto-generation of an .rc file if the RC_FILE and RES_FILE variables are not set. The generated .rc file will have the FILEVERSION and PRODUCTVERSION entries filled with major, minor, patch level, and build number.



标签: c++ qt qt4