Fixed a possible race condition with linked views
This commit is contained in:
parent
a2053b13d0
commit
a697b5584a
@ -1098,23 +1098,26 @@ class AxisItem(GraphicsWidget):
|
|||||||
self._updateHeight()
|
self._updateHeight()
|
||||||
|
|
||||||
def wheelEvent(self, ev):
|
def wheelEvent(self, ev):
|
||||||
if self.linkedView() is None:
|
lv = self.linkedView()
|
||||||
|
if lv is None:
|
||||||
return
|
return
|
||||||
if self.orientation in ['left', 'right']:
|
if self.orientation in ['left', 'right']:
|
||||||
self.linkedView().wheelEvent(ev, axis=1)
|
lv.wheelEvent(ev, axis=1)
|
||||||
else:
|
else:
|
||||||
self.linkedView().wheelEvent(ev, axis=0)
|
lv.wheelEvent(ev, axis=0)
|
||||||
ev.accept()
|
ev.accept()
|
||||||
|
|
||||||
def mouseDragEvent(self, event):
|
def mouseDragEvent(self, event):
|
||||||
if self.linkedView() is None:
|
lv = self.linkedView()
|
||||||
|
if lv is None:
|
||||||
return
|
return
|
||||||
if self.orientation in ['left', 'right']:
|
if self.orientation in ['left', 'right']:
|
||||||
return self.linkedView().mouseDragEvent(event, axis=1)
|
return lv.mouseDragEvent(event, axis=1)
|
||||||
else:
|
else:
|
||||||
return self.linkedView().mouseDragEvent(event, axis=0)
|
return lv.mouseDragEvent(event, axis=0)
|
||||||
|
|
||||||
def mouseClickEvent(self, event):
|
def mouseClickEvent(self, event):
|
||||||
if self.linkedView() is None:
|
lv = self.linkedView()
|
||||||
|
if lv is None:
|
||||||
return
|
return
|
||||||
return self.linkedView().mouseClickEvent(event)
|
return lv.mouseClickEvent(event)
|
||||||
|
Loading…
Reference in New Issue
Block a user