remove Qt4 mouse wheel handling
This commit is contained in:
parent
1a29cf7579
commit
b843214f66
@ -1,4 +1,4 @@
|
|||||||
from ..Qt import QtCore, QtGui, QtWidgets, QT_LIB
|
from ..Qt import QtCore, QtGui, QtWidgets
|
||||||
from OpenGL.GL import *
|
from OpenGL.GL import *
|
||||||
import OpenGL.GL.framebufferobjects as glfbo
|
import OpenGL.GL.framebufferobjects as glfbo
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@ -466,13 +466,9 @@ class GLViewWidget(QtWidgets.QOpenGLWidget):
|
|||||||
#self.swapBuffers()
|
#self.swapBuffers()
|
||||||
|
|
||||||
def wheelEvent(self, ev):
|
def wheelEvent(self, ev):
|
||||||
delta = 0
|
delta = ev.angleDelta().x()
|
||||||
if QT_LIB in ['PyQt4', 'PySide']:
|
if delta == 0:
|
||||||
delta = ev.delta()
|
delta = ev.angleDelta().y()
|
||||||
else:
|
|
||||||
delta = ev.angleDelta().x()
|
|
||||||
if delta == 0:
|
|
||||||
delta = ev.angleDelta().y()
|
|
||||||
if (ev.modifiers() & QtCore.Qt.KeyboardModifier.ControlModifier):
|
if (ev.modifiers() & QtCore.Qt.KeyboardModifier.ControlModifier):
|
||||||
self.opts['fov'] *= 0.999**delta
|
self.opts['fov'] *= 0.999**delta
|
||||||
else:
|
else:
|
||||||
|
@ -317,13 +317,9 @@ class GraphicsView(QtGui.QGraphicsView):
|
|||||||
super().wheelEvent(ev)
|
super().wheelEvent(ev)
|
||||||
if not self.mouseEnabled:
|
if not self.mouseEnabled:
|
||||||
return
|
return
|
||||||
delta = 0
|
delta = ev.angleDelta().x()
|
||||||
if QT_LIB in ['PyQt4', 'PySide']:
|
if delta == 0:
|
||||||
delta = ev.delta()
|
delta = ev.angleDelta().y()
|
||||||
else:
|
|
||||||
delta = ev.angleDelta().x()
|
|
||||||
if delta == 0:
|
|
||||||
delta = ev.angleDelta().y()
|
|
||||||
|
|
||||||
sc = 1.001 ** delta
|
sc = 1.001 ** delta
|
||||||
#self.scale *= sc
|
#self.scale *= sc
|
||||||
|
Loading…
Reference in New Issue
Block a user