On Sun, 20 Jul 2014 14:58:16 +0200
Bob Jelica <sailf...@jelica.se> wrote:

> Hey,
> 
> If you have this in your .yaml:
> 
> Version: 1.0.0
> 
> QMakeOptions:
> - VERSION='%{version}-%{release}'
> 
> Then you can do this in your .pro file:
> DEFINES += APP_VERSION=\\\"$$VERSION\\\"
> 
> That gives you the option to do this in your main.cpp:
> QScopedPointer<QQuickView> view(SailfishApp::createView());
> view->rootContext()->setContextProperty("APP_VERSION", APP_VERSION);
> 
> 
> And BOOM! now you can use APP_VERSION wherever in your QML
> (AboutPage.qml for example)
> 
> :)

Ah. I used to do something similar in my N900 version of the app except
that I used to specify the version in the .pro file. I've never tried
to incorporate it into the Sailfish version. I'll give your version
another go now.

Thanks for that and thanks too to Andrey Kozhevnikov for his ideas.
_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to