<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 2021-07-21 2:57 a.m., Phil Thompson
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:1fc516d9826909aa31b57e2d576f9ced@riverbankcomputing.com">On
20/07/2021 21:44, Stefan Seefeld wrote:
<br>
<blockquote type="cite">Hello,
<br>
<br>
I'm working on Python bindings for a set of C++ libraries /
<br>
applications, some of which are using Qt.
<br>
The application code is instantiating many Qt objects, some of
which I
<br>
now want to expose to Python. For in-house C++ APIs this is
easy, as I
<br>
merely need to reflect the C++ types to Python using
Boost.Python, so
<br>
I can have functions such as
<br>
<br>
```
<br>
class A;
<br>
std::shared_ptr<A> create_a();
<br>
```
<br>
exposed to Python such that both, the type `A` as well as the
function
<br>
`create_a()` are known in Python.
<br>
<br>
Now assume `A` is actually a type with an existing Python
wrapper in
<br>
PyQt5. How can I instantiate `A` in C++ and then pass it to the
Python
<br>
runtime such that the PyQt5 bindings are used ? (To make this
<br>
concrete, I want to make the `QQMLApplicationEngine` instance of
my
<br>
C++ app accessible in Python, so that I can use Python to script
and -
<br>
more importantly - introspect and test my application's GUI.
<br>
<br>
Any pointers ?
<br>
</blockquote>
<br>
Start with this...
<br>
<br>
<a class="moz-txt-link-freetext" href="https://www.riverbankcomputing.com/static/Docs/sip/abi_12.html#abi-v12-for-handwritten-code">https://www.riverbankcomputing.com/static/Docs/sip/abi_12.html#abi-v12-for-handwritten-code</a>
<br>
</blockquote>
<p>It looks like the functions I'm looking for are `<code
class="sig-name descname">sipConvertFromNewType</code><span
class="sig-paren">` and `</span><span class="sig-paren"><code
class="sig-name descname">sipConvertFromType</code><span
class="sig-paren">`, correct ?</span></span></p>
<p><span class="sig-paren"><span class="sig-paren">Thanks !<br>
</span></span></p>
<div class="moz-signature">
<div class="moz-signature">
<div class="moz-signature">
<pre><img moz-do-not-send="false" src="cid:part1.22C37844.7BA4DC20@seefeld.name" alt="Stefan" width="123" height="77">
--
...ich hab' noch einen Koffer in Berlin...
</pre>
</div>
</div>
</div>
</body>
</html>