PySide migration
Re: PySide migration
For the wiki, I'm not sure what todo... There is quite a lot, but most of the occurences are links to the PyQt page. Not sure what happens if we rename that page to PySide, but it might be the best solution...
Re: PySide migration
I have both libpyside-dev and libshiboken-dev installed. I'm getting the same error with the latest source code. I get that window each time I switch to the Arch or Draft workbench.ulrich1a wrote:libshiboken-dev was missing.wmayer wrote:Have you installed the dev packages for shiboken and pyside?
I called then "make clean" But even after install this, I got the same error.
What versions of pyside and shiboken are needed?
I have:
libshiboken-dev_1.1.1-1_i386.deb
libpyside-dev_1.1.1-3
Ulrich
BTW the Daily Builds PPA package has the same problem. I am not sure we can correct this on Ubuntu. For example, python-matplotlib depends on python-qt4. Isn't the Ship module built on matplotlib? And the Shaft Wizard? python-pivy, which is required by Draft and Arch, depends on python-qt4-gl, which itself requires of course python-qt4.
So it looks to me like we cannot expunge pyqt completely from FreeCAD's dependencies on Ubuntu. Please tell me if I'm wrong.

Re: PySide migration
Yeah, in both versions (compiled from source and Daily Build) Draft is completely broken. 

Re: PySide migration
I solved the problem for me with Debian in the meantime. I had to completly delete all the contents in the Build folder and than starting from scratch with "cmake-gui .." in this folder. This went smoother than I thought. In the past I had to do several manual corrections to the cmakecache.txt file.normandc wrote:BTW the Daily Builds PPA package has the same problem. I am not sure we can correct this on Ubuntu.
Only calling "cmake ." gave me all the time problems. But with the restart from scratch, I could call the Draft workbench.
I have Problems on Windows 7 32 bit with the same approach. The executable file is now named FreeCADD.exe. The Draft-Workbench gives me: local variable 'translate' referenced before assignment
This is not the case at Debian.
OS: Windows 7
Platform: 32-bit
Version: 0.14.2982 (Git)
Branch: master
Hash: 4c6bd17dc2c53e05ec7f3c1d612722c5af36d2c0
Python version: 2.6.2
Qt version: 4.5.2
Coin version: 3.1.0
SoQt version: 1.4.1
Ulrich
Re: PySide migration
- Plot and Ship must be switched (see with sanguinario joe)
- src/WindowsInstaller/LibPack.wxs contains references to PyQt4, don't know what to do there
- PartDesign scripts
- Update the wiki (do that with care)
- Material resource file
- src/WindowsInstaller/LibPack.wxs contains references to PyQt4, don't know what to do there
- PartDesign scripts
- Update the wiki (do that with care)
- Material resource file
Re: PySide migration
We won't be able to remove this dependency but this isn't a big problem. We only have to make sure not to use PyQt stuff inside FreeCAD. And what 3rd party Python libraries do doesn't affect FreeCAD as long as we don't try to extract the internal C++ classes because this is technically the big difference between PySide and PyQt.So it looks to me like we cannot expunge pyqt completely from FreeCAD's dependencies on Ubuntu. Please tell me if I'm wrong.
Re: PySide migration
Aren't we going to now be left with the situation that everyone using 0.13 "stable" will still be using PyQT? If so the wiki needs to talk about both for the time being until we "officially dump" 0.13. Also any script/Python code using these will have to have two version written now, if one wants it to work on both the "stable" and "dev" versions of FreeCAD. There is now a similar problem for "BOLTS".yorik wrote:For the wiki, I'm not sure what todo... There is quite a lot, but most of the occurences are links to the PyQt page. Not sure what happens if we rename that page to PySide, but it might be the best solution...
I am starting to wonder if this might be a good enough reason to "release" a new "stable" version of FreeCAD that uses PySide, and includes all work to date from master, and possibly (or possibly not) some or all of the Assembly stuff?
I would think this would make life easier for BOLTS because then they could be reasonably justified in just dropping support for FreeCADs older than 0.14.
I am always keen to release "new official" versions as often as possible.

Jim
Re: PySide migration
Furthermore, Plot depends on matplotlib, which has a PyQt binding to generate plot canvas. So I left PyQt and PySide in the LibPack 8.2. I also added NumPy and Matplotlib (release only) to the LibPack. Also added the CalculiX FEM solver (ccx.exe) to the LibPack.
Stop whining - start coding!
-
- Posts: 329
- Joined: Mon Sep 09, 2013 6:08 pm
Re: PySide migration
I started to make BOLTS usable with both PySide and PyQt, but now I hit a problem that I do not understand. I get the following error:
It is triggered when I try to add the part selector widget to the main window. The code that does this is a refined version of a snippet from here ( and the relevant parts looks like this:
and
While I tried to find out what is happening, I realised that either there is a lot of magic going on in the background or I am completely lost:
results in mw having type <PySide.QtGui.QWidget object at 0x2ab09e0>, which does not provide addDockWidget, but from the stacktrace it seems that the call succeeded but a exception was raised in addDockWidget.
On the other hand
results in a mw with type <PyQt4.QtGui.QMainWindow object at 0x2ab2290>.
I appreciate any hints about what is going on and how to reliably add a widget.
OS: Ubuntu 13.04
Platform: 64-bit
Version: 0.14.2982 (Git)
Branch: master
Hash: 4c6bd17dc2c53e05ec7f3c1d612722c5af36d2c0
Python version: 2.7.4
Qt version: 4.8.4
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0
Code: Select all
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "./BOLTS/__init__.py", line 42, in <module>
mw.addDockWidget(QtCore.Qt.RightDockWidgetArea, widget)
TypeError: 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'
>>>
Code: Select all
mw = getMainWindow()
mw.addDockWidget(QtCore.Qt.RightDockWidgetArea, widget)
Code: Select all
def getMainWindow():
"returns the main window"
# using QtGui.qApp.activeWindow() isn't very reliable because if another
# widget than the mainwindow is active (e.g. a dialog) the wrong widget is
# returned
toplevel = QtGui.qApp.topLevelWidgets()
for i in toplevel:
if i.metaObject().className() == "Gui::MainWindow":
return i
raise Exception("No main window found")
Code: Select all
import PySide
toplevel = PySide.QtGui.qApp.topLevelWidgets()
for i in toplevel:
if i.metaObject().className() == "Gui::MainWindow":
mw = i
On the other hand
Code: Select all
import PyQt4
toplevel = PyQt4.QtGui.qApp.topLevelWidgets()
for i in toplevel:
if i.metaObject().className() == "Gui::MainWindow":
mw = i
I appreciate any hints about what is going on and how to reliably add a widget.
OS: Ubuntu 13.04
Platform: 64-bit
Version: 0.14.2982 (Git)
Branch: master
Hash: 4c6bd17dc2c53e05ec7f3c1d612722c5af36d2c0
Python version: 2.7.4
Qt version: 4.8.4
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0
Re: PySide migration
That's because PySide doesn't know that in C++ "MainWindow" inherits from QMainWindow and thus only handles it as QWidget. Instead of writing "def getMainWindow(): ..." you can use:I started to make BOLTS usable with both PySide and PyQt, but now I hit a problem that I do not understand. I get the following error:
Code: Select all
mw = FreeCADGui.getMainWindow()