move CurveArrow by mouse

28 views
Skip to first unread message

sta...@gmx.de

unread,
Jul 4, 2015, 7:25:19 AM7/4/15
to pyqt...@googlegroups.com
Hello,

I try to figure out how to move the CurveArrow Item by mouse. I have already tried to subclass it by:

class CurveMarker(pg.CurveArrow):


def __init__(self, curve, index=0, pos=None, **opts):

pg.CurveArrow.__init__(self,curve, index=index, pos=pos)


self.setFlags(self.flags() | self.ItemIgnoresTransformations | self.ItemIsSelectable | self.ItemIsMovable)

self.setAcceptHoverEvents(True)


def mouseDragEvent(self, event):

print(event)

event.accept()


def hoverEnterEvent(self, event):

print(event)

event.accept()


def mouseClickEvent(self, event):

print("clicked")

event.accept()


def hoverEvent(self, event):

print("clicked")

event.accept()



If I create an object of  CurveMarker it appears on the plot, but I can't select it by mouse. No one the overridden events work.

Can somebody give me a hint, how to make the arrows movable.

Thank You
Best regards
Stanislav

Reply all
Reply to author
Forward
0 new messages