<p dir="ltr">this method working only at clean build and after updating pro/yaml/spec/main.cpp. If you wont update some of these files you'll get old version numbers in future builds.</p>
<div class="gmail_quote">20.07.2014 18:59 пользователь "Bob Jelica" <<a href="mailto:sailfish@jelica.se">sailfish@jelica.se</a>> написал:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">Hey,<div><br></div><div>If you have this in your .yaml:</div><div>
<pre style="margin-top:0px;margin-bottom:0px"><br></pre><pre style="margin-top:0px;margin-bottom:0px">Version:<span style="color:#c0c0c0"> </span>1.0.0</pre><div><br></div></div><div>
<pre style="margin-top:0px;margin-bottom:0px">QMakeOptions:</pre>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#808000">-</span><span style="color:#c0c0c0"> </span>VERSION=<span style="color:#008000">'%{version}-%{release}'</span></pre><div><br></div><div>Then you can do this in your .pro file:</div>
<div>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#800080">DEFINES</span><span style="color:#c0c0c0"> </span>+=<span style="color:#c0c0c0"> </span>APP_VERSION=\\\"$$VERSION\\\"</pre><div><br></div>
</div><div>That gives you the option to do this in your main.cpp:</div><div>
<pre style="margin-top:0px;margin-bottom:0px"><span style="color:#800080">QScopedPointer</span><<span style="color:#800080">QQuickView</span>><span style="color:#c0c0c0"> </span>view(<span style="color:#800080">SailfishApp</span>::createView());</pre>

<pre style="margin-top:0px;margin-bottom:0px">view->rootContext()->setContextProperty(<span style="color:#008000">"APP_VERSION"</span>,<span style="color:#c0c0c0"> </span><span style="color:#000080">APP_VERSION</span>);</pre>
<div><br></div></div><div><br></div><div>And BOOM! now you can use APP_VERSION wherever in your QML (AboutPage.qml for example)</div><div><br></div><div>:)</div><div><br></div><div>//b0bben</div><div><br></div><div><div>On 20 Jul 2014, at 13:26, Chris Walker <<a href="mailto:cdw_nokiaqt@the-walker-household.co.uk" target="_blank">cdw_nokiaqt@the-walker-household.co.uk</a>> wrote:</div>
<br><blockquote type="cite">Is there any way to have my 'About' page pick up the Version and<br>Release information from the yaml file?<br><br>At the moment, I'm hard coding the versioninfo in the About page but<br>
I'd like it to be updated automagically in the future.<br><br>I looked around but couldn't see this information anywhere so I'm<br>guessing that this question hasn't been asked/answered before but if it<br>
has, please feel free to point me in the right direction.<br>_______________________________________________<br><a href="http://SailfishOS.org" target="_blank">SailfishOS.org</a> Devel mailing list<br>To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank">devel-unsubscribe@lists.sailfishos.org</a><br>
</blockquote></div><br></div></div><br>_______________________________________________<br>
SailfishOS.org Devel mailing list<br>
To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a><br></blockquote></div>