How to generate python bindings using shiboken from an existing C++/Qt shared library?
-
I have a shared library built using qmake and leveraging several Qt modules (core, networking, etc...).
What's the best path to pretty much convert that to something that can be used also from Python?
All the examples that I was able to find don't address that usecase.
https://doc.qt.io/qtforpython-5.12/shiboken2/samplebinding.html
https://blog.basyskom.com/2019/using-shiboken2-to-create-python-bindings-for-a-qt-library/I was hoping there was going to be something that from the original "qmake" project could generate a default CMakeLists.txt file for generating the bindings. Or maybe should there be only one CMakeLists.txt file that would automatically build separate libraries (and bindings), for C++ and for Python?
Thank you!
-
Hi,
There was a talk about that during the Qt Virtual TechCon 2020. I think the video should be published at some point. There might be something there for you.
-
Great !
Can you share them ?
-
Hi @SGaist,
These are the videos that I found, but I had to track down the authors for the actual code sample URLs.
- https://www.youtube.com/watch?v=mAfEVPgHRt8
examples:
https://github.com/sewoods/shiboken_simplegraph_example
https://github.com/qt-ps-americas/pysideqwt
and
Now, I realized that in order to get thing to work you need to have a good understanding of CMake works, plus the typesystem which can be tricky for complex datatypes where you need to write the mapping (to and from).
- https://www.youtube.com/watch?v=mAfEVPgHRt8
-
Thanks for the links !