<html><head></head><body><div id="fenix-user-content">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'">Hi Jukka,</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;font-family:'NokiaPureTextLight'"><br></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'">there are some possible ways. You could write just another function, you are calling from QML like getMyInformation() which is returning your data as QVariant, that you can use in QML.</span></p>

<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;font-family:'NokiaPureTextLight'"><br></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'">You can also catch C++ signals with QMLs Connections element. So that your C++ logic emit a signal with the data and it's catched and used in QML.</span></p>

<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;font-family:'NokiaPureTextLight'"><br></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'">Or you can use QProperies, so that some attributes of your class can be accessed from QML - good point here is, it's updating the QML side when the values changed in C++ automatically. </span></p>

<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;font-family:'NokiaPureTextLight'"><br></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'">All variants could be used if you make your object accessable via setContextProperty().</span></p>

<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px;font-family:'NokiaPureTextLight'"><br></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'">Hope that helps a bit. ;)</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'"> </span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'">Gabriel</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'">--</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'"> </span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'">Von meinem Nokia N9 gesendet</span></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><span style="font-family:'NokiaPureTextLight'"> </span></p></div><br><div id="fenix-reply-header"><p>Jukka Heikkilä schrieb am 21.12.13 11:05:<br>
</p></div><div id="fenix-quoted-body">Hi,<br>
<br>
I have successfully learned how to call C++ method from QML. I would<br>
like to see a practical example how to call QML function from C++<br>
method. All examples and instructions which I have found from web have<br>
been such kind of codes where all is done from main loop.<br>
<br>
I'm not sure is my approach right, but in my program I would first<br>
like to call C++ method from QML and C++ function will retrive data.<br>
After the data retrive is ready the C++ method will call other C++<br>
method which will update the screen (e.g. multiple labels).<br>
<br>
I would be very happy to get help with this problem and I think that<br>
the begginners will also fighting with this kind of problems.<br>
<br>
Happy Holidays!<br>
<br>
Kind Regards,<br>
Jukka Heikkilä<br>
@Juukks<br>
_______________________________________________<br>
SailfishOS.org Devel mailing list<br>
</div><br></body></html>