mirror of https://github.com/m-labs/artiq.git
scanwidget: wheel event handling cleanup (380634e)
This commit is contained in:
parent
2e73d6c89c
commit
fc60f3504c
|
@ -364,7 +364,7 @@ class ScanWidget(QtWidgets.QWidget):
|
||||||
return
|
return
|
||||||
self.setView(newLeft, newScale)
|
self.setView(newLeft, newScale)
|
||||||
|
|
||||||
def _wheelEvent(self, ev):
|
def wheelEvent(self, ev):
|
||||||
y = ev.angleDelta().y()
|
y = ev.angleDelta().y()
|
||||||
if ev.modifiers() & QtCore.Qt.ShiftModifier:
|
if ev.modifiers() & QtCore.Qt.ShiftModifier:
|
||||||
# If shift+scroll, modify number of points.
|
# If shift+scroll, modify number of points.
|
||||||
|
@ -405,7 +405,7 @@ class ScanWidget(QtWidgets.QWidget):
|
||||||
|
|
||||||
def eventFilter(self, obj, ev):
|
def eventFilter(self, obj, ev):
|
||||||
if ev.type() == QtCore.QEvent.Wheel:
|
if ev.type() == QtCore.QEvent.Wheel:
|
||||||
self._wheelEvent(ev)
|
ev.ignore()
|
||||||
return True
|
return True
|
||||||
if ev.type() == QtCore.QEvent.Resize:
|
if ev.type() == QtCore.QEvent.Resize:
|
||||||
ev.ignore()
|
ev.ignore()
|
||||||
|
|
Loading…
Reference in New Issue