How to get the VERSION from QML?
-
Im using the VERSION macro at .pro file. Exists any way to get it from QML or C++?
@VERSION = 1.0.0@
-
But if i am using it in shared library ?
QString(VERSION) undefined VERSION
-
See "this":http://qt-project.org/forums/viewthread/11840 thread.
If you want to pass the VERSION information from the .pro file to C++ you may use the preprocessor.
@
// .pro
DEFINES += APPLICATION_VERSION="\"$$VERSION\""// .cpp
QString applicationVersion(APPLICATION_VERSION);
@
If you want to pass this version information to QML use a context property. -
Thx, ))) worked