On Sun, Jun 24, 2012 at 8:26 PM, Eric Mesa <span dir="ltr"><<a href="mailto:ericsbinaryworld@gmail.com" target="_blank">ericsbinaryworld@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>Just curious about one thing:<br>1) With this framework I can get information from the python program to affect the QML (and change the button to a blue colour). How do I get information to the python program? In other words, if I have a python function that's function(int) -> how do I provide the int argument for the python FROM the QML? <br>
</blockquote><div><br></div><div>you simply declare the signal as: updateRequired(int number); and connect it to the slot that</div><div>accepts an integer.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It's a little hard for me to figure out because this stuff is all indirect - in the QML the signal is referred to as if it were a function. And the function gets the data from the signal, but it doesn't seem to make sense how that happens because there's no real link to it. I kinda understand what I'm doing, but not enough to figure out how to get the into to python.<br>
</blockquote><div><br></div><div>the view.rootObject() is your qml's root item. when you declare a signal in qml, it gets created</div><div>as a normal Qt signal, which you can then connect to any c++ (or in this case, python) slot.</div>
<div>yes, the signal is a function (that optionally takes arguments), which calls all the slots that we</div><div>connect to the signal (and the arguments are passed to them, if any).</div><div></div></div><br><div>Viranch</div>