From 2e73d6c89cbb00acf3b9606eb5b6a30a0758ab54 Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Mon, 14 Mar 2016 16:53:06 +0100 Subject: [PATCH] scanwidget: changes as of 1f9ab9b (resize) --- artiq/gui/scanwidget.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/artiq/gui/scanwidget.py b/artiq/gui/scanwidget.py index e7afa2753..b04a2008e 100644 --- a/artiq/gui/scanwidget.py +++ b/artiq/gui/scanwidget.py @@ -389,12 +389,7 @@ class ScanWidget(QtWidgets.QWidget): else: ev.ignore() - def eventFilter(self, obj, ev): - if ev.type() == QtCore.QEvent.Wheel: - self._wheelEvent(ev) - return True - if not (obj is self.axis and ev.type() == QtCore.QEvent.Resize): - return False + def resizeEvent(self, ev): if ev.oldSize().isValid(): oldLeft = self.pixelToReal(0) refWidth = ev.oldSize().width() - self.slider.handleWidth() @@ -407,4 +402,12 @@ class ScanWidget(QtWidgets.QWidget): self.setView(oldLeft, newScale) else: self.viewRange() + + def eventFilter(self, obj, ev): + if ev.type() == QtCore.QEvent.Wheel: + self._wheelEvent(ev) + return True + if ev.type() == QtCore.QEvent.Resize: + ev.ignore() + return True return False