[SailfishDevel] Versions
Bob Jelica
sailfish at jelica.se
Sun Jul 20 12:58:16 UTC 2014
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)
:)
//b0bben
On 20 Jul 2014, at 13:26, Chris Walker <cdw_nokiaqt at the-walker-household.co.uk> wrote:
> Is there any way to have my 'About' page pick up the Version and
> Release information from the yaml file?
>
> At the moment, I'm hard coding the versioninfo in the About page but
> I'd like it to be updated automagically in the future.
>
> I looked around but couldn't see this information anywhere so I'm
> guessing that this question hasn't been asked/answered before but if it
> has, please feel free to point me in the right direction.
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20140720/e3fe1f26/attachment.html>
More information about the Devel
mailing list