forked from M-Labs/artiq
scanwidget: changes as of 1f9ab9b (resize)
This commit is contained in:
parent
1dc72635a0
commit
2e73d6c89c
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue