Automating exposing large number of C++ QT classes to Python
-
I have gone through the examples of exposing QT C++ classes to Python via Shiboken2 and PySide2 ( KDAB has a great tutorial).
However , I have an existing QT C++ application with 100+ classes with many methods ( it's a scientific application). Writing the Shiboken2 XML file will be bit of a tedious nightmare.
In the past I used swig, you just ran swig on your headers and it would handle nearly everything. You cleaned up the exceptions as needed. Am I missing something with using Shiboken2/PySide2? -
-
Hey @AndrewCQT ,, I have went threw this tutrial and many other resources but couldn't bind a single
QObject
... can you share how you did it? I have a repo that I made for me and others to learn how to do that (currently isn't working), if you are willing to contribute your knowledge there it would be awesome!.As for your question, have you looked into Kdab's KDDockWidget and PySideQwt?
-
@SGaist I completely misunderstood how shiboken2 worked. By default it exposes all the methods in the classes, so it's a simple matter to just list the classes in the bindings.xml file. In the end it was quite simple to bind to all my classes.