Basically what I need in my project is a number of some sort that iterates itself every time I build my project, and that I can output by my program.

So for example, when generating audio, I need to add metadata that states that this audio file was generated by build #1551. After I build again, that number should go to #1552.

What is the proper way to do this in Qt?

有帮助吗?

解决方案

Proper way is:

  • Have (any possible) Version Control in your project (and forever for all projects)
  • Instead of rather useless autoincremented counter use any id, provided by VCS of choice
  • Get this id and output it (Mercurial sample, another SCMs just use another commands in $$system call)as any other variable
许可以下: CC-BY-SA归因
scroll top