View Issue Details

IDProjectCategoryView StatusLast Update
0000877FreeCADFeaturepublic2014-05-03 14:19
Reporterwmayer Assigned Towmayer  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version 
Target Version0.14Fixed in Version0.14 
Summary0000877: Move from PyQt to PySide
DescriptionDue 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.
TagsNo tags attached.
FreeCAD Information

Activities

yorik

2012-11-17 20:34

administrator   ~0002546

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.

yorik

2012-11-17 20:48

administrator   ~0002547

Hm I change what I said, it won't be that simple... But I'll explore further too.

user701

2012-11-18 09:03

  ~0002549

Noticed! I'm working on it!

wmayer

2012-11-18 09:31

administrator   ~0002550

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.

user701

2012-11-18 09:51

  ~0002551

I'm doing it in "special" branches with the suffix pyside:

sanguinariojoe-plot-pyside
sanguinariojoe-ship-pyside

user701

2012-11-18 09:55

  ~0002552

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?

Thanks!!!

wmayer

2012-11-18 10:00

administrator   ~0002553

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.

yorik

2012-11-19 12:29

administrator   ~0002560

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...

wmayer

2012-11-19 17:50

administrator   ~0002561

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.

wmayer

2013-06-21 21:59

administrator   ~0003235

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

wmayer

2014-02-27 15:55

administrator   ~0004323

http://forum.freecadweb.org/viewtopic.php?f=10&t=5303&p=47469#p47469

Issue History

Date Modified Username Field Change
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
2012-11-18 09:03 user701 Note Added: 0002549
2012-11-18 09:31 wmayer Note Added: 0002550
2012-11-18 09:51 user701 Note Added: 0002551
2012-11-18 09:55 user701 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