[vtkusers] switching from PyQt4 to PySide question
david.gobbi at gmail.com
Sat Dec 10 22:48:34 EST 2016
There should be no need to recompile VTK in order to use PySide. The only
important file for using VTK with PySide (or with PyQt4 or PyQt5)
is QVTKRenderWindowInteractor.py. Also, it's best to import it from
vtk.qt, not from vtk.qt4 (which is obsolete).
My recommendation is to grab the latest version of this file from the VTK
On Sat, Dec 10, 2016 at 8:06 PM, hchen <hjchen.work at gmail.com> wrote:
> I'm trying to figure out how to switch from PyQt4 to PySide for my VTK
> program. From what I heard, it should be straight forward. But, when I
> the example:
> and replaced:
> from PyQt4 import QtCore, QtGui
> from PySide import QtCore, QtGui
> I got this error:
> self.vtkWidget = QVTKRenderWindowInteractor(self.frame)
> line 204, in __init__
> QWidget.__init__(self, parent, wflags|Qt.MSWindowsOwnDC)
> TypeError: QWidget(QWidget parent=None, Qt.WindowFlags flags=0):
> argument 1 has unexpected type 'PySide.QtGui.QFrame'
> Can anyone please points out why is the error and what's involved in making
> the switch? Do I need to remove PyQt and recompile VTK? And, I am on
> 16.04, with VTK 7.0, Python 3.5, QT4.8, PyQt 4.11.4, PySide 1.2.2, but in
> the error, there is Qt.MSWindowsOwnDC, looks like it's for Windows?
> Thanks a lot in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers