How to get the VERSION from QML?
-
wrote on 7 Mar 2012, 11:20 last edited by
Im using the VERSION macro at .pro file. Exists any way to get it from QML or C++?
@VERSION = 1.0.0@
-
wrote on 8 Mar 2012, 15:52 last edited by
Tried to use QApplication.applicationVersion()?
-
wrote on 20 Mar 2012, 10:31 last edited by
But if i am using it in shared library ?
QString(VERSION) undefined VERSION
-
wrote on 20 Mar 2012, 10:54 last edited by
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. -
wrote on 20 Mar 2012, 11:35 last edited by
Thx, ))) worked