fix click bug on removable ROIs; test (#1804)
This commit is contained in:
parent
7bc5f215c0
commit
1735effea7
@ -801,7 +801,7 @@ class ROI(GraphicsObject):
|
||||
if ev.button() == QtCore.Qt.RightButton and self.contextMenuEnabled():
|
||||
self.raiseContextMenu(ev)
|
||||
ev.accept()
|
||||
elif ev.button() in self.acceptedMouseButtons():
|
||||
elif ev.button() & self.acceptedMouseButtons() > 0:
|
||||
ev.accept()
|
||||
self.sigClicked.emit(self, ev)
|
||||
else:
|
||||
|
@ -153,6 +153,24 @@ def check_getArrayRegion(roi, name, testResize=True, transpose=False):
|
||||
|
||||
win.hide()
|
||||
|
||||
|
||||
def test_mouseClickEvent():
|
||||
plt = pg.GraphicsView()
|
||||
plt.show()
|
||||
resizeWindow(plt, 200, 200)
|
||||
vb = pg.ViewBox()
|
||||
plt.scene().addItem(vb)
|
||||
vb.resize(200, 200)
|
||||
QtTest.QTest.qWaitForWindowExposed(plt)
|
||||
QtTest.QTest.qWait(100)
|
||||
|
||||
roi = pg.RectROI((0, 0), (10, 20), removable=True)
|
||||
vb.addItem(roi)
|
||||
app.processEvents()
|
||||
|
||||
mouseClick(plt, roi.mapToScene(pg.Point(2, 2)), QtCore.Qt.LeftButton)
|
||||
|
||||
|
||||
def test_PolyLineROI():
|
||||
rois = [
|
||||
(pg.PolyLineROI([[0, 0], [10, 0], [0, 15]], closed=True, pen=0.3), 'closed'),
|
||||
|
Loading…
Reference in New Issue
Block a user