[Ctk-developers] Simplification of CTK PythonQt wrapping

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Mon Apr 14 18:23:02 UTC 2014


Hi Folks,

Overview
------------
As some of you knows, CTK provides some CMake function and Qt classes to
facilitate the scripting of Qt application using "PythonQt" [1][2]


I propose to remove the unmaintained support for PythonQt full wrapping and
optimize the existing light wrapping.


If you never build CTK with wrapping enabled, you can archive this email.
The proposed changes won't impact your existing projects.


Details
--------

Currently, there is a build option named "CTK_ENABLE_Python_Wrapping"
allowing to enable the automatic wrapping of CTK classes and also expose
the tool to "wrap" classes within your application.


The wrapping exists in two flavors:

 * Light wrapping (the default)
 * Full wrapping


Light wrapping: This basically check that Qt classes derives from QObject
and then create "PythonQtDecorator" allowing to instantiate/delete your
classes.

Full wrapping: Attempt to make automatic use of the PythonQtGenerator (used
to also wrap Qt for PythonQt).



Proposed changes:
------------------------

 - Removal of option related to "Full" wrapping. This never really worked.
It would require us to maintain our set of "xml" files describing CTK
classes. See [3] for an examples. Later one, we could also look at
PySide[4] and see how it could be supported.

 - Simplification and optimization of the existing "Light" wrapping. In
project like Slicer where there is a lot of library to "light wrap" .. the
CMake configuration time is considerably impacted.

 - Associated issue: https://github.com/commontk/CTK/issues/449

 - To learn more about the differences between PySide/PyQt/PythonQt. See
"Comparison with PyQt/PySide" on [5]



Let me know what you think,

Thanks
Jc


[1] http://pythonqt.sourceforge.net/

[2] https://github.com/commontk/PythonQt#pythonqt

[3]
https://github.com/commontk/PythonQt/blob/patched-3/generator/typesystem_core.xml

[4] https://qt-project.org/wiki/About-PySide

[5] http://pythonqt.sourceforge.net/Features.html

-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/ctk-developers/attachments/20140414/78ba0d43/attachment.htm>


More information about the Ctk-developers mailing list