def __init__(self, x, y, size=60, width=10, parent=None, scene=None): self._width = width s = size + width / 2 QGraphicsEllipseItem.__init__(self, QRectF(-QPoint(s, s), QSizeF(2 * s, 2 * s)), parent) self.setBrush(QBrush(statuscolor[status.OK])) if not parent and scene: scene.addItem(self) self.setPos(x, y) self.setState(status.OK)
def __init__(self, x, y, size=40, parent=None, scene=None): self._origin = QPoint(x, y) self._size = size self._radius = size / 2 if not self._color: self._color = QColor('white') QGraphicsEllipseItem.__init__(self, QRectF(-QPoint(size, size), QSizeF(2 * size, 2 * size)), parent) if not parent and scene: scene.addItem(self) self.setPos(x, y) self.setBrush(QBrush(self._color))