View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000877||FreeCAD||Feature||public||2012-11-15 08:24||2014-05-03 14:19|
|Priority||normal||Severity||minor||Reproducibility||have not tried|
|Target Version||0.14||Fixed in Version||0.14|
|Summary||0000877: Move from PyQt to PySide|
|Description||Due to the GPL license we have to move to PySide which is under LGPL. Therefore we also have to find out how to access the internal C++ classes.|
|Tags||No tags attached.|
I'll take care of doing that in Arch and Draft modules, and add Shoogen and Sanguinariojoe to this bug too so they can do the same for OpenSCAD, Plot and Ship.
As far as I already tested, in python code it is as easy as replacing all the "from PyQt4 import..." with "from PySide import ..." but of course it needs a bit of testing to make sure all works correctly.
||Hm I change what I said, it won't be that simple... But I'll explore further too.|
|Noticed! I'm working on it!|
||Note, this issue is scheduled for *after* version 0.13 is out! Porting to PySide doesn't only mean to touch Python code but we also have to touch some C++ code and this is actually the hardest part.|
I'm doing it in "special" branches with the suffix pyside:
What about resources?
resources files imports QtCore form PyQt4, but since resources files are generated on external tools (src/whatever.py), must we (specific modules developers) take any care on this?
||Resource files needs to be recreated of course. But I don't know how to do that because until now I never worked with PySide. I don't think it's too complicated.|
As far as I tested, inside python modules, the only thing you need to do is change PyQt4 by PySide and all works OK. Resources must be rebuilt using Pyside's rcc instead of pyqt4's rcc. On debian there is a "pyside-tools" package that contains pysided versions of rcc, uic and pylupdate. You use it the same way: pyside-rcc -o Draft_rc.py Resources/Draft.qrc
Appearently the problem resides entirely in the Task system... Indeed pyqt4-created objects are passed to the C++ part via some kind of swig object, and it seems that pyside doesn't work that way...
But yeah Werner is right, better do this after 0.13.
When I have some time I'll also try to have CMake build those python resources automatically...
PyQt4 uses sip not swig. From all these python wrappers I like most sip because you do not need to build any headers and include them at compile time.
Instead, the sip python module offers a function to convert a PyQt object into a void pointer and then you can use some standard C python functions to cast the pointer. Unfortunately, sip is also under GPL and thus no option for us...
For swig the conversion is really awful because the generated header file must match with the swig version a certain library was wrapped with. We all remember the pivy hell ;-)
PySide uses its own generator framework. There you need to include a header and link against a library file. The header is very long and it is full of template code.
git show 1dc122d
Note, the PySide support is currently disabled until the move from PyQt to PySide is done. The relevant code is in WidgetFactory.cpp
|2012-11-15 08:24||wmayer||New Issue|
|2012-11-15 08:24||wmayer||Status||new => assigned|
|2012-11-15 08:24||wmayer||Assigned To||=> wmayer|
|2012-11-17 20:34||yorik||Note Added: 0002546|
|2012-11-17 20:48||yorik||Note Added: 0002547|
||Note Added: 0002549|
|2012-11-18 09:31||wmayer||Note Added: 0002550|
||Note Added: 0002551|
||Note Added: 0002552|
|2012-11-18 10:00||wmayer||Note Added: 0002553|
|2012-11-19 12:29||yorik||Note Added: 0002560|
|2012-11-19 17:50||wmayer||Note Added: 0002561|
|2013-06-21 21:59||wmayer||Note Added: 0003235|
|2014-02-27 15:55||wmayer||Note Added: 0004323|
|2014-05-03 14:19||wmayer||Status||assigned => closed|
|2014-05-03 14:19||wmayer||Resolution||open => fixed|
|2014-05-03 14:19||wmayer||Fixed in Version||=> 0.14|