How to Get Current App Version in Qt

Posted on Posted in Qt Tutorials, Tutorials

I have tried numerous methods to get an application’s own version number and believe me this is the best way to get it. First of all if we consider the fact that setting a Qt application version is done in PRO file (qmake) using the following simple command:


Then getting this same value should be the easiest possible method.

Just add the following line to your PRO file after defining version as seen above and you can use the same version string wherever you like in the code:


APP_VERSION will contain the string “” and can be used in the C++ code.

Leave a Reply

Your email address will not be published. Required fields are marked *