def __init__(self, details, fp, anchor, style): if details.SequenceNr: text = '%s: %s'%(details.SequenceNr, fp.Name) else: text = fp.Name role = details.style_role self.anchor = anchor self.details = details self.fp = fp self.arrow = None Text.__init__(self, text, style, role, apply=False) self.setFlag(QtGui.QGraphicsItem.ItemIsSelectable) self.setFlag(QtGui.QGraphicsItem.ItemIsMovable) if isinstance(self.anchor, BlockItem): self.arrow = None else: # Add the arrow. length = style.getFloat('%s-arrow-%s-length'%(role, self.ROLE), 1.0) self.arrow = Line(-10*length, 0, 0, 0, self, style, (role, self.ROLE)) self.applyStyle()