Infiniteline emits clicked signal event (#1522)

This commit is contained in:
Ogi Moore 2021-01-28 22:02:51 -08:00 committed by GitHub
parent 5bb3800adc
commit 961cdac51c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,12 +25,14 @@ class InfiniteLine(GraphicsObject):
sigDragged(self)
sigPositionChangeFinished(self)
sigPositionChanged(self)
sigclicked(self, ev)
=============================== ===================================================
"""
sigDragged = QtCore.Signal(object)
sigPositionChangeFinished = QtCore.Signal(object)
sigPositionChanged = QtCore.Signal(object)
sigClicked = QtCore.Signal(object, object)
def __init__(self, pos=None, angle=90, pen=None, movable=False, bounds=None,
hoverPen=None, label=None, labelOpts=None, span=(0, 1), markers=None,
@ -400,6 +402,7 @@ class InfiniteLine(GraphicsObject):
self.sigPositionChangeFinished.emit(self)
def mouseClickEvent(self, ev):
self.sigClicked.emit(self, ev)
if self.moving and ev.button() == QtCore.Qt.RightButton:
ev.accept()
self.setPos(self.startPosition)