Add parent to ArrowItem's constructor signature

This commit is contained in:
Ales Erjavec 2020-08-17 09:27:23 +02:00
parent 52717fa8b7
commit 3d391d46e3

View File

@ -11,13 +11,13 @@ class ArrowItem(QtGui.QGraphicsPathItem):
"""
def __init__(self, **opts):
def __init__(self, parent=None, **opts):
"""
Arrows can be initialized with any keyword arguments accepted by
the setStyle() method.
"""
self.opts = {}
QtGui.QGraphicsPathItem.__init__(self, opts.pop('parent', None))
QtGui.QGraphicsPathItem.__init__(self, parent)
if 'size' in opts:
opts['headLen'] = opts['size']