scanwidget: changes as of 1f9ab9b (resize)

This commit is contained in:
Robert Jördens 2016-03-14 16:53:06 +01:00
parent 1dc72635a0
commit 2e73d6c89c
1 changed files with 9 additions and 6 deletions

View File

@ -389,12 +389,7 @@ class ScanWidget(QtWidgets.QWidget):
else: else:
ev.ignore() ev.ignore()
def eventFilter(self, obj, ev): def resizeEvent(self, 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
if ev.oldSize().isValid(): if ev.oldSize().isValid():
oldLeft = self.pixelToReal(0) oldLeft = self.pixelToReal(0)
refWidth = ev.oldSize().width() - self.slider.handleWidth() refWidth = ev.oldSize().width() - self.slider.handleWidth()
@ -407,4 +402,12 @@ class ScanWidget(QtWidgets.QWidget):
self.setView(oldLeft, newScale) self.setView(oldLeft, newScale)
else: else:
self.viewRange() 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 return False