Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Caleb's suggestion is great, but didn't work "out of the box" in my case. I got some errors instead and it took some reading to fix them. The changes are very minor. I was using Qt 4.7 on Ubuntu Linux ... The first change, if you can believe it, was in the shell script to go from <code>let number += 1</code> to <code>let number++</code> ... I normally use/program Windoze, so I can't explain that, but when I run the script from a command line (shell prompt) in the original case I get errors reported, in the changed case all goes well and incrementing numbers are returned ...</p> <p>Since it's not completely reported by Caleb - I used <code>build_number.sh</code> as the name of the shell script and made another file with the name <code>build_number</code> (without <code>.sh</code>) and put just a zero inside, nothing else.</p> <p>The last and most obnoxious bug was fixed by replacing <code>BUILDNO = $$(command_to_get_the_build_number)</code> with <code>BUILDNO = $$system(./build_number.sh)</code> in the Qt project file. Note the <code>system</code> after <code>$$</code> and the required <code>./</code> in front of the file name. The later is elementary for a regular Linux user, but not as much so for a Windows user.</p> <p>Hope this makes it more straight forward for people new to all this, like myself. You can read more in the Qt Designer Help section if you seek for qmake, including the function reference, Advanced Use etc.</p> <p>Oh, one last word ... I also had to change <code>DEFINES += -DBUILD=$${BUILDNO}</code> to <code>DEFINES += BUILD=$${BUILDNO}</code>, so the <code>-D</code> is gone. Inside your C++ code you would use <code>BUILD</code> as if you had written <code>#define BUILD 1234</code> at the top of your file.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload