<div dir="ltr"><div>I was wondering exactly the same as Gabriel and Andrey's code solved my problem.<br><br></div>Thanks a lot, guys!!!<br><br></div><div class="gmail_extra"><br clear="all"><div>...Mariano Boragno...</div>

<br><br><div class="gmail_quote">On Wed, Nov 13, 2013 at 12:25 PM, Andrey Kozhevnikov <span dir="ltr"><<a href="mailto:coderusinbox@gmail.com" target="_blank">coderusinbox@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This is almost same what SailfishApp::main() does for you and it keeping booster working, just lets you to use application and view instances directly.<br>
<br>
Have fun with Sailfish ;)<div class="HOEnZb"><div class="h5"><br>
<br>
On 13.11.2013 21:23, Gabriel Boehme wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Wow, thanks to you and also Andrey!<br>
<br>
This is nearly the way I took back in the first Jolla Qt5 SDK, is it<br>
also the recommended way to do that?<br>
<br>
Will it have a (bad) influence on the start up times?<br>
<br>
Thanks so much! :)<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
Yes your setContextProperty() to rootContext is the right approach. Usually I do something like this:<br>
<br>
     QScopedPointer<<u></u>QGuiApplication> app(Sailfish::<u></u>createApplication(argc, argv));<br>
     QScopedPointer<QQuickView> view(Sailfish::createView());<br>
     MyClass data;<br>
     view->rootContext()-><u></u>setContextProperty("myObject", &data);<br>
     Sailfish::setView(view.data(), "qrc:/main.qml");<br>
<br>
______________________________<u></u>__________<br>
From: <a href="mailto:devel-bounces@lists.sailfishos.org" target="_blank">devel-bounces@lists.<u></u>sailfishos.org</a> [<a href="mailto:devel-bounces@lists.sailfishos.org" target="_blank">devel-bounces@lists.<u></u>sailfishos.org</a>] on behalf of Gabriel Boehme [<a href="mailto:m.gabrielboehme@googlemail.com" target="_blank">m.gabrielboehme@googlemail.<u></u>com</a>]<br>

Sent: Wednesday, November 13, 2013 4:58 PM<br>
To: Sailfish OS Developers<br>
Subject: [SailfishDevel] How to use setContext() or what is recommended?!<br>
<br>
Hi sailors,<br>
<br>
in the very first (Qt4 version) of the SDK I ported an easy application,<br>
that is using a list model. To connect the list model and also my main<br>
logic stuff I used the setContextProperty() method. In the first Qt5 SDK<br>
version I had to work a bit around that (created a view from<br>
Sailfish::createView() and used the views<br>
data().rootContext()-><u></u>setContextProperty() methods.<br>
<br>
But now in the latest version I'm not quite sure about, how to do that?<br>
<br>
Or better: What is the recommended way to connect QML UI with C++ logic<br>
and add a model for a view? I'm a bit confused, because coming from<br>
Python/PySide I always used it that way with QDeclarativeView and get a<br>
bit lost with Qt5 and QQuickView and QQuickApplication and all this<br>
stuff, that changed also between 5.0 and 5.1, doesn't it? :-/<br>
<br>
Would be great to get some advice!<br>
<br>
Thank you very much!<br>
<br>
______________________________<u></u>_________________<br>
SailfishOS.org Devel mailing list<br>
______________________________<u></u>_________________<br>
SailfishOS.org Devel mailing list<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
SailfishOS.org Devel mailing list<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
SailfishOS.org Devel mailing list<br>
</div></div></blockquote></div><br></div>