[Development] Python Bindings
Cristian.Maureira-Fredes at qt.io
Fri Nov 23 15:52:28 CET 2018
On 11/23/18 9:22 AM, Luca Beldi wrote:
> Hi Everyone,
> I wanted to ask if I have to do anything to expose a new class added to
> Qt to “Qt for Python”.
> Do you have a manual or an example commit of what needs to be done to
> make it work?
> Thanks in advance.
> Luca Beldi
Regarding the process itself,
I recommend you to follow the implementation of another class
because we don't have any tutorial.
Overall the process should consist on:
- Add the new class into the module's typesystem
- Add a couple of test cases:
(don't forget to include the name of the scripts to the cmake file
on the same directory)
If you are lucky, the new class will require no extra steps,
but probably it will, so for this I recommend you to look
at a similar class so you can get an idea of how to solve the
issues you find. These issues could include:
- Ownership transfer
- Casting argument to different types
- Explicitly declare enums
- Adapt method signatures
- Include new signatures for a certain method
Join us on #qt-pyside if you have any further question.
Dr. Cristian Maureira-Fredes
The Qt Company GmbH
Rudower Chaussee 13
Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin,
Charlottenburg, HRB 144331 B
More information about the Development