def __init__(self, details, style, role, text=None, resizable=True): QtGui.QGraphicsRectItem.__init__(self, 0, 0, details.width, details.height) self.setFlag(QtGui.QGraphicsItem.ItemIsMovable) self.setFlag(QtGui.QGraphicsItem.ItemIsSelectable) self.connections = [] StyledItem.__init__(self, style, role) if text is None: text = '' self.text = Text(text, style, self.full_role, self) self.icon = None if resizable: self.corner = ResizeHandle(self) self.corner.setPos(QtCore.QPointF(details.width, details.height)) self.applyStyle()
def __init__(self, x1, y1, x2, y2, parent, style, role): QtGui.QGraphicsLineItem.__init__(self, x1, y1, x2, y2, parent) self.setFlag(QtGui.QGraphicsItem.ItemIsSelectable) self.__start = self.__end = None StyledItem.__init__(self, style, role)
def __init__(self, txt, style, role, parent=None, apply=True): QtGui.QGraphicsRectItem.__init__(self, parent=parent) self.text = QtGui.QGraphicsTextItem(txt, parent=self) self.style, self.role = style, role StyledItem.__init__(self, style, role, apply=parent is None and apply)
def __init__(self, parent, style, role, arrow_type): QtGui.QGraphicsPolygonItem.__init__(self, parent=parent) self.arrow_type = arrow_type StyledItem.__init__(self, style, role)