PySide migration
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
PySide migration
The PySide migration has begun!
DONE:
- Arch, Draft & Start modules are switched, so far all seems to work well.
TO DO:
- Material module's MaterialEditor needs the uic module which was in PyQt4 and not in PySide. Must find the equivalent...
- Plot and Ship must be switched (see with sanguinario joe)
- OpenSCAD module must be switched (see with shoogen)
- 3rdParty/Pivy-0.5 relies on PyQt4
- 3rdParty/Pivy relies on PyQt4
- src/WindowsInstaller/LibPack.wxs contains references to PyQt4, don't know what to do there
- TemplatePyMod must be switched (I'll do it)
- PartDesign scrips and PartDesign WizardShaft must be switched (seems simple enough)
- Spreadsheet module must be switched, but this might be a good opportunity to merge the C++ one...
- README files still contain references to PyQt4 (I'll do it)
- Update the wiki (do that with care)
2 things to do basically when switching:
- change "from PyQt4 import...." to "from PySide import..."
- remove all .toUtf8() methods
DONE:
- Arch, Draft & Start modules are switched, so far all seems to work well.
TO DO:
- Material module's MaterialEditor needs the uic module which was in PyQt4 and not in PySide. Must find the equivalent...
- Plot and Ship must be switched (see with sanguinario joe)
- OpenSCAD module must be switched (see with shoogen)
- 3rdParty/Pivy-0.5 relies on PyQt4
- 3rdParty/Pivy relies on PyQt4
- src/WindowsInstaller/LibPack.wxs contains references to PyQt4, don't know what to do there
- TemplatePyMod must be switched (I'll do it)
- PartDesign scrips and PartDesign WizardShaft must be switched (seems simple enough)
- Spreadsheet module must be switched, but this might be a good opportunity to merge the C++ one...
- README files still contain references to PyQt4 (I'll do it)
- Update the wiki (do that with care)
2 things to do basically when switching:
- change "from PyQt4 import...." to "from PySide import..."
- remove all .toUtf8() methods
Re: PySide migration
On PyQt? How this?- 3rdParty/Pivy-0.5 relies on PyQt4
- 3rdParty/Pivy relies on PyQt4
-
- Posts: 554
- Joined: Sat Apr 07, 2012 2:42 am
Re: PySide migration
I just did:wmayer wrote:On PyQt? How this?
Code: Select all
grep -r "PyQt4" *
Code: Select all
src/3rdParty/Pivy-0.5/sogui.py: __import__('PyQt4')
src/3rdParty/Pivy-0.5/sogui.py: import PyQt4
src/3rdParty/Pivy-0.5/sogui.py: SoGui_Quarter_Wrapper.qApp = PyQt4.QtGui.QApplication(sys.argv)
src/3rdParty/Pivy-0.5/soqt_wrap.cpp: PYQT_MODULE_IMPORT_NAME = "PyQt4.Qt";
src/3rdParty/Pivy/soqt_wrap.cpp: PYQT_MODULE_IMPORT_NAME = "PyQt4.Qt";
@jrheinlaender thansk! Just added your last commit.jrheinlaender wrote:For PartDesign WizardShaft, see here:
Off-topic: I like much how my Git tree lokks like, these days... A FreeCAD decentralized task-force!
yorik@bilbo:~/Sources/FreeCAD$ git remote update
Code: Select all
Fetching origin
Fetching github
Fetching shoogen
Fetching wandererfan
Fetching crashfridh
Fetching peterl94
Fetching jmaustpc
Fetching helo9
Fetching jrheinlaender
Re: PySide migration
Material module is done too.
Re: PySide migration
How will that impact compiling on Debian/Ubuntu-based distros? The python-pivy package from the distro repo is used by the PPA packages as well as when you compile FreeCAD. python-pivy has a dependency to python-qt4-gl which itself depends on python-qt4.yorik wrote:- 3rdParty/Pivy-0.5 relies on PyQt4
- 3rdParty/Pivy relies on PyQt4
http://packages.debian.org/wheezy/python-pivy
http://packages.ubuntu.com/trusty/python-pivy
From what I can understand, on Ubuntu and Debian, PySide is packaged as libpyside1.x.
Re: PySide migration
Will these changes stop this compile error that I always get?
[ 1%] Building CXX object src/3rdParty/Pivy-0.5/CMakeFiles/coin.dir/coin_wrap.cpp.o
/home/user/Downloads/cad/freecad/src/3rdParty/Pivy-0.5/soqt_wrap.cpp: In function ‘PyObject* _wrap_delete_QWidget(PyObject*, PyObject*)’:
/home/user/Downloads/cad/freecad/src/3rdParty/Pivy-0.5/soqt_wrap.cpp:17377:10: warning: possible problem detected in invocation of delete operator: [enabled by default]
/home/user/Downloads/cad/freecad/src/3rdParty/Pivy-0.5/soqt_wrap.cpp:17336:12: warning: ‘arg1’ has incomplete type [enabled by default]
/usr/include/qt4/QtGui/qwindowdefs.h:56:7: warning: forward declaration of ‘struct QWidget’ [enabled by default]
/home/user/Downloads/cad/freecad/src/3rdParty/Pivy-0.5/soqt_wrap.cpp:17377:10: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined
Jim
[ 1%] Building CXX object src/3rdParty/Pivy-0.5/CMakeFiles/coin.dir/coin_wrap.cpp.o
/home/user/Downloads/cad/freecad/src/3rdParty/Pivy-0.5/soqt_wrap.cpp: In function ‘PyObject* _wrap_delete_QWidget(PyObject*, PyObject*)’:
/home/user/Downloads/cad/freecad/src/3rdParty/Pivy-0.5/soqt_wrap.cpp:17377:10: warning: possible problem detected in invocation of delete operator: [enabled by default]
/home/user/Downloads/cad/freecad/src/3rdParty/Pivy-0.5/soqt_wrap.cpp:17336:12: warning: ‘arg1’ has incomplete type [enabled by default]
/usr/include/qt4/QtGui/qwindowdefs.h:56:7: warning: forward declaration of ‘struct QWidget’ [enabled by default]
/home/user/Downloads/cad/freecad/src/3rdParty/Pivy-0.5/soqt_wrap.cpp:17377:10: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined
Jim
Re: PySide migration
I think the pivy version bundled with freecad is broken for other reasons than pyqt... This shouldn't change anything I'm afraid. As for the debian/ubuntu package, I use that package now, and everything is still working fine with pyside.
Normally those 2 packages are not related in any way, that's why Werner found it strange...
Normally those 2 packages are not related in any way, that's why Werner found it strange...
Re: PySide migration
Yorik I posted some messages about this problem here viewtopic.php?f=4&t=5302 which I now think was the wrong place.
I am still getting it with a clean build this morning So I thought I would post here as it is probably a more logical place to do so.
On starting Draft I get the following error message
local variable 'translate' referenced before assignment
and on starting Arch I get
arguments did not match any overloaded call:
QMainWindow.addDockWidget(Qt.DockWidgetArea, QDockWidget): argument 1 has unexpected type 'PySide.QtCore.Qt.DockWidgetArea'
QMainWindow.addDockWidget(Qt.DockWidgetArea, QDockWidget, Qt.Orientation): argument 1 has unexpected type 'PySide.QtCore.Qt.DockWidgetArea'
and no Draft or Arch work benches
The first time I noticed this problem was Version: 0.14.2961 (Git) 0.14.2959 I am pretty sure was my last build without this problem.
The problem is still there in a complete build in a new directory
OS: Ubuntu 12.04.3 LTS
Platform: 64-bit
Version: 0.14.2964 (Git)
Branch: master
Hash: 0f2c93a25e51bbd41656982ad061307f2c33b32a
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0
Jim
I am still getting it with a clean build this morning So I thought I would post here as it is probably a more logical place to do so.
On starting Draft I get the following error message
local variable 'translate' referenced before assignment
and on starting Arch I get
arguments did not match any overloaded call:
QMainWindow.addDockWidget(Qt.DockWidgetArea, QDockWidget): argument 1 has unexpected type 'PySide.QtCore.Qt.DockWidgetArea'
QMainWindow.addDockWidget(Qt.DockWidgetArea, QDockWidget, Qt.Orientation): argument 1 has unexpected type 'PySide.QtCore.Qt.DockWidgetArea'
and no Draft or Arch work benches
The first time I noticed this problem was Version: 0.14.2961 (Git) 0.14.2959 I am pretty sure was my last build without this problem.
The problem is still there in a complete build in a new directory
OS: Ubuntu 12.04.3 LTS
Platform: 64-bit
Version: 0.14.2964 (Git)
Branch: master
Hash: 0f2c93a25e51bbd41656982ad061307f2c33b32a
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0
Jim
Re: PySide migration
I have Python 2.7 and all the pyside packages I can find in my package manager. There don't seem to be any DEV packages. The only Pyside packages I have not installed are the ones that say they are for Python3.
python-pyside meta package says pyside is version 1.1.0-1
is there anything I should have installed?
Jim
python-pyside meta package says pyside is version 1.1.0-1
is there anything I should have installed?
Jim