<div dir="auto">FYI, you can use QtPy to support PyQt4/PyQt5/Pyside<div dir="auto"><a href="https://github.com/spyder-ide/qtpy">https://github.com/spyder-ide/qtpy</a><br></div><div dir="auto"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Dec 10, 2016 10:49 PM, "David Gobbi" <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Chen,<div><br></div><div>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.<wbr>py.  Also, it's best to import it from vtk.qt, not from vtk.qt4 (which is obsolete).</div><div><br></div><div>My recommendation is to grab the latest version of this file from the VTK master branch:</div><div><a href="https://gitlab.kitware.com/vtk/vtk/raw/master/Wrapping/Python/vtk/qt/QVTKRenderWindowInteractor.py" target="_blank">https://gitlab.kitware.com/<wbr>vtk/vtk/raw/master/Wrapping/<wbr>Python/vtk/qt/<wbr>QVTKRenderWindowInteractor.py</a><br></div><div><br></div><div> - David</div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 10, 2016 at 8:06 PM, hchen <span dir="ltr"><<a href="mailto:hjchen.work@gmail.com" target="_blank">hjchen.work@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I'm trying to figure out how to switch from PyQt4 to PySide for my VTK<br>
program.  From what I heard, it should be straight forward. But, when I took<br>
the example:<br>
    <a href="http://www.vtk.org/Wiki/VTK/Examples/Python/Widgets/EmbedPyQt" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK/Ex<wbr>amples/Python/Widgets/EmbedPyQ<wbr>t</a><br>
and replaced:<br>
    from PyQt4 import QtCore, QtGui<br>
by:<br>
    from PySide import QtCore, QtGui<br>
I got this error:<br>
    self.vtkWidget = QVTKRenderWindowInteractor(sel<wbr>f.frame)<br>
    File<br>
"/usr/local/lib/python3.5/site<wbr>-packages/vtk/qt/QVTKRenderWin<wbr>dowInteractor.py",<br>
line 204, in __init__<br>
    QWidget.__init__(self, parent, wflags|Qt.MSWindowsOwnDC)<br>
    TypeError: QWidget(QWidget parent=None, Qt.WindowFlags flags=0):<br>
argument 1 has unexpected type 'PySide.QtGui.QFrame'<br>
<br>
Can anyone please points out why is the error and what's involved in making<br>
the switch? Do I need to remove PyQt and recompile VTK?  And, I am on Ubuntu<br>
16.04, with VTK 7.0, Python 3.5, QT4.8, PyQt 4.11.4, PySide 1.2.2,  but in<br>
the error, there is Qt.MSWindowsOwnDC, looks like it's for Windows?<br>
<br>
Thanks a lot in advance!<br>
<br>
Chen<br></blockquote></div></div></div></div></div></div>
<br>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
<br></blockquote></div></div>