Disallow scroll wheel zooming when there is no data displayed.

pull/90/head
Rune B. Broberg 2019-11-11 23:55:05 +01:00
rodzic ba1a644e39
commit 87f18ca684
1 zmienionych plików z 3 dodań i 0 usunięć

Wyświetl plik

@ -530,6 +530,9 @@ class FrequencyChart(Chart):
return []
def wheelEvent(self, a0: QtGui.QWheelEvent) -> None:
if len(self.data) == 0 and len(self.reference) == 0:
a0.ignore()
return
if a0.angleDelta().y() > 0:
# Zoom in
a0.accept()