enthought/mayavi

QVTKRenderWindowInteractor.py _emit_wheel_event() will produce a NameError QWheelEvent undefined.

chrisgmorton opened this issue · 3 comments

The import of QWheelEvent from QtGui was accidentally dropped with 502c3f0.

The current logic in __init__ implies this is also only needed for Qt4 (if is_qt4:...). However, 539aba1 also seems to break scrollwheel zooming for PySide2 (I'm running a modified version of 5.15.10 to support Python 3.11 with VTK 9.3.0.rc1 on Ubuntu 20.04).
We need the QWheelEvent import for the PySide2 case too and updated logic:

if is_qt4 or PyQtImpl == 'PySide2': 
    ..

This addresses the zooming for PySide2 and I assume avoids the NameError with PySide and PyQt4.

chnce commented

I have the same /a related issue. Zooming with the scroll wheel does not work (no error).

Windows 11
python 3.11.6 h2628c8c_0_cpython conda-forge
mayavi 4.8.1 py311hd333e61_7 conda-forge
pyside2 5.15.8 py311h2411a93_2 conda-forge

Hi @larsoner, can you check this issue as I believe it is broken from 502c3f0. The fix is described above.

@chrisgmorton are you up for making a PR?