Python QGLWidget interactor hangs on VTK9 RC3 wheels on Linux with PyQt < 5.14.1
Minimal example, fails for VTK9 RC3 wheels on (at least) PyQt5 5.12, 5.13.2, and 5.14.1 (EDIT: on linux):
import vtkmodules.qt
vtkmodules.qt.QVTKRWIBase = 'QGLWidget'
from vtk.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor
from vtkmodules.vtkRenderingUI import vtkGenericRenderWindowInteractor
from PyQt5.QtWidgets import QApplication, QMainWindow
app = app = QApplication([''])
window = QMainWindow()
interactor = QVTKRenderWindowInteractor(parent=window)
assert isinstance(interactor, QVTKRenderWindowInteractor)
interactor_gen = interactor.GetRenderWindow().GetInteractor()
assert isinstance(interactor_gen, vtkGenericRenderWindowInteractor)
interactor_gen.Initialize() # hangs on Linux + PyQt 5.13.2
It works:
- If I change the
QVTKRWIBase
toQWidget
- On PyQt 5.14.1 or above
- On macOS with 5.13.2
So it seems to be something about the combination of QGLWidget + Linux + PyQt5 < 5.14.2.
Edited by Eric Larson