mixing PyQt(5) and Boost.Python
phil at riverbankcomputing.com
Wed Jul 21 07:57:23 BST 2021
On 20/07/2021 21:44, Stefan Seefeld wrote:
> I'm working on Python bindings for a set of C++ libraries /
> applications, some of which are using Qt.
> The application code is instantiating many Qt objects, some of which I
> now want to expose to Python. For in-house C++ APIs this is easy, as I
> merely need to reflect the C++ types to Python using Boost.Python, so
> I can have functions such as
> class A;
> std::shared_ptr<A> create_a();
> exposed to Python such that both, the type `A` as well as the function
> `create_a()` are known in Python.
> Now assume `A` is actually a type with an existing Python wrapper in
> PyQt5. How can I instantiate `A` in C++ and then pass it to the Python
> runtime such that the PyQt5 bindings are used ? (To make this
> concrete, I want to make the `QQMLApplicationEngine` instance of my
> C++ app accessible in Python, so that I can use Python to script and -
> more importantly - introspect and test my application's GUI.
> Any pointers ?
Start with this...
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2754 bytes
Desc: not available
More information about the PyQt