PDA

View Full Version : version number setting



BalaQT
12th March 2010, 05:24
hi, im using QT4.5 in debian
i want to know , how to set version number for qt applications ?

Thnks
Bala

tsp
12th March 2010, 05:44
QCoreApplication class contains methods setApplicationName and setApplicationVersion but I think it is up to you to decide how to use those. I have used them every now and then for example to set dialog title to same as the application name and for that I have used applicationName-method.

toutarrive
12th March 2010, 08:50
Maybe you could choose from one of the following:

Define the version information within the application source code (string constant or preprocessor macro).
Use QCoreApplication : applicationVersion() and setApplicationVersion(const QString&version).
Define the version information in the .pro file using qmake macro VERSION.

Royceybaby
8th June 2010, 22:02
Define the version information in the .pro file using qmake macro VERSION.

If one uses the above method is there anyway of passing this to the application code at compilation stage? So for instance it is compiled as a variable into the code and can be used to display to the user the version number of the program.

Thanks,
Royce

sirius
9th June 2010, 00:35
Check out this link on the subject http://www.openguru.com/2009/11/qt-best-way-to-set-application-version.html

Royceybaby
9th June 2010, 09:59
Brilliant link.

Thanks,
Royce

Demandred
10th June 2010, 10:15
Indeed a briliant link. But I want to read the version number from a non-running executable on Linux.
Any ideas on how to fix this?
I'm a complete linux noob, so there might be something very simple I'm missing here.

squidge
10th June 2010, 11:16
One way to do that would be to use a string that can be searched for in the executable. For example "$VERSION_TAG$1.04$". So then you can just open the executable file as binary data, search for the tag and read the text afterwards.