Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 def __init__(self, x, y, size=20, parent=None, scene=None):
     TableBase.__init__(self, x, y, size, parent, scene)
     self._halowidth = max(size / 4, 10)
     self._halo = Halo(x, y, size, self._halowidth, self, scene)
     self._tuberadius = size / 5
     p = QPointF(self._tuberadius, self._tuberadius)
     s = QSizeF(2 * self._tuberadius, 2 * self._tuberadius)
     self._tube = QGraphicsEllipseItem(QRectF(-p, s), self)
     self._tube.setPen(QPen(QColor('black'), 3))
     self._tube.setBrush(QBrush(QColor('white')))
     self._tube.setZValue(20)
Exemplo n.º 3
0
 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))
Exemplo n.º 4
0
 def __init__(self, width, parent=None, scene=None):
     w = width + 2
     if parent and isinstance(parent, QGraphicsRectItem):
         rect = parent.rect()
         size = rect.size()
         size += QSizeF(w, w)
         rect.setSize(size)
     else:
         rect = QRectF()
     QGraphicsRectItem.__init__(self, rect, parent)
     transform = QTransform()
     transform.translate(-w / 2, -w / 2)
     self.setTransform(transform)
     self.setBrush(QBrush(statuscolor[status.OK]))
     self.setPen(QPen(statuscolor[status.OK], width))