No mouse middle button in QVTKRenderWindowInteractor with PySide6
When interacting with a QVTKRenderWindowInteractor with the mouse middle button, the following error is raised:
Traceback (most recent call last):
File "C:\Users\Carlos\AppData\Local\Programs\Python\lib\site-packages\vtkmodules\qt\QVTKRenderWindowInteractor.py", line 523, in mousePressEvent
elif self._ActiveButton == Qt.MidButton:
AttributeError
:
type object 'PySide6.QtCore.Qt' has no attribute 'MidButton'
Traceback (most recent call last):
File "C:\Users\Carlos\AppData\Local\Programs\Python\lib\site-packages\vtkmodules\qt\QVTKRenderWindowInteractor.py", line 535, in mouseReleaseEvent
elif self._ActiveButton == Qt.MidButton:
AttributeError
:
type object 'PySide6.QtCore.Qt' has no attribute 'MidButton'
Looking at the dir(PySide6.QtCore.Qt)
, there is no 'MidButton' attribute, but there is a 'MiddleButton'.
A quick fix is to define the attribute: PySide6.QtCore.Qt.MidButton = PySide6.QtCore.Qt.MiddleButton
.
Edited by Carlos Souto