[vtk-developers] Adding PySide compatibility to python binding

David Gobbi david.gobbi at gmail.com
Wed May 11 23:06:03 EDT 2011


Hi Hadrien,

The way the try/except is written, it will always complain about not
finding PySide even if the user expected it to be looking for PyQt.
Can you modify the patch so that it will report the error as
"ImportError: Cannot load either PyQt or PySide"?  This can be
done by adding another try-except around the second import and
then re-throwing the exception (there's probably a tidier way to do it,
but the main thing is to make the error less confusing).

 - David


On Wed, May 11, 2011 at 7:26 PM, HadiM <marelo64 at gmail.com> wrote:
> Hi all,
>
> I would like to notice you than VTK python binding works very well
> with PySide (http://www.pyside.org/). Unfortunately, VTK binding try
> only to import PyQt in
> ./Wrapping/Python/vtk/qt4/QVTKRenderWindowInteractor.py.
>
> So I made a little patch, which when PyQt module import failed, it's
> try to import PySide module. It's probably not very clean to do it
> that way but it works... If you dont want to integrate this patch in
> next release, do you know when the PySide compatibility is planned ?
>
> Thanks,
>
> --
> Hadrien Mary



More information about the vtk-developers mailing list