<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 2021-09-22 8:59 a.m., Stefan de
Konink wrote:<br>
</div>
<blockquote type="cite"
cite="mid:28b97c6d-27e9-44cc-bd97-dfa2abe06d56@konink.de">
<blockquote type="cite">What is the right way to access and call a
QML function from Python ? </blockquote>
<br>
I don't know if it it the 'right' way, but the documented way is
no introduce a Bridge object, which can exchange events from/to
Qt.
<br>
<br>
<a class="moz-txt-link-rfc2396E" href="https://doc.qt.io/qtforpython/tutorials/qmlintegration/qmlintegration.html"><https://doc.qt.io/qtforpython/tutorials/qmlintegration/qmlintegration.html></a>
<br>
<a class="moz-txt-link-rfc2396E" href="https://evileg.com/en/post/242/"><https://evileg.com/en/post/242/></a>
<br>
</blockquote>
<p><br>
</p>
<p>My goal is really to programmatically call a QML function /
method, not bind it to a custom event. Let me provide a bit of
context to clarify my goal:</p>
<p>I'm working with a C++ application (using Qt / QML), to which I
have attached a Python interpreter, mainly for testing purposes.
From that Python interpreter, I can access and interact with the
application state. I would like to be able to include in these
interactions the manipulation of the GUI, and I thought a good way
to achieve this would be to call custom QML functions (or even
existing slots such as `onClicked` slots of buttons).<br>
</p>
<p>I found some mention of similar techniques, such as in the thread
started with
<a class="moz-txt-link-freetext" href="https://www.riverbankcomputing.com/pipermail/pyqt/2014-February/033815.html">https://www.riverbankcomputing.com/pipermail/pyqt/2014-February/033815.html</a>,
but couldn't get this working myself yet.<br>
</p>
<p>Thanks, <br>
</p>
<div class="moz-signature">
<div class="moz-signature">
<div class="moz-signature">
<pre><img moz-do-not-send="false" src="cid:part1.7168C9E7.C8AF66BF@seefeld.name" alt="Stefan" width="123" height="77">
--
...ich hab' noch einen Koffer in Berlin...
</pre>
</div>
</div>
</div>
</body>
</html>