Does generator really handle multiple inheritance?
Dynamic Python binding for Qt Applications
Brought to you by:
florianlink,
marcusbarann
Hi,
I spend some time with the generator and I never succeed to wrap a class with more than one base class. Is this example suppose to work?
Here is my xml config file:
When I test it can instantiate from python an object from testA,testB and testAB but testAB doesn't expose inherited methods from testA and testB.
Does any one know how to do that?
best regards,
Alexis.
A small update, I found that if testA is declared as interface in the XML config file like this:
It works, is it the expected behavior?
On Qt-Jambi it is more or less explained like this but it wasn't obvious to me that one of the base class had necessary to be declared as interface in the XML conf file.
Best regards,
Alexis.
Hi,
An other observation, I hope it will help somebody, the include path is really important, for example if your class inherit from QObject you should include like this:
The QtCore is mandatory unless you want to add all Qt sub-folders as look-up path while you call pythonqt_generator.
I don't know if I'm flogging a dead horse but it also wasn't obvious for me.
Best regards,
Alexis.
Yes, this is a relict of the QtJambi generator, the generator is a fork of the original QtJambi generator.
Not many people have tried wrapping their own C++ classes with the generator, so it is a good idea to share your experience/problems on this forum.
Hi,
I plan to do some kind of wiki with some simple examples, as soon as possible.
I did also some modifications on PythonQt build scripts, I really prefer to install PythonQt as Qt module than something you embed in each app. Here is a source tree with my modifications(last source with Qt5 support taken on the forum):
https://hephaistos.lpp.polytechnique.fr/rhodecode/HG_REPOSITORIES/LPP/INSTRUMENTATION/USERS/JEANDET/PythonQt
So when you want to use PythonQt in your Qt application, you just have to add CONFIG+=pythonqt in your .pro/.pri file.
Best regards,
Alexis.