I am using Qt 4.5 in Windows XP. My pro file has the variable VERSION = 1.0
. Now i need to read this variable and get its value (1.0
) from the source c
I'll elaborate on this a bit.
In the YourApp.pro
:
VERSION = 0.0.0.1
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
In the main.cpp
:
#include
QCoreApplication::setApplicationVersion(QString(APP_VERSION));
Wherever else in your sources, e.g. in the imaginary controller.cpp
:
#include
QString yourAppVersion = QCoreApplication::applicationVersion();