def __init__(self, curve, index=0, pos=None, rotate=True):
"""Position can be set either as an index referring to the sample number or
the position 0.0 - 1.0
If *rotate* is True, then the item rotates to match the tangent of the curve.
"""
GraphicsObject.__init__(self)
#QObjectWorkaround.__init__(self)
self._rotate = rotate
self.curve = weakref.ref(curve)
self.setParentItem(curve)
self.setProperty('position', 0.0)
self.setProperty('index', 0)
if hasattr(self, 'ItemHasNoContents'):
self.setFlags(self.flags() | self.ItemHasNoContents)
if pos is not None:
self.setPos(pos)
else:
self.setIndex(index)
评论列表
文章目录