Exemple #1
0
 def paintEvent(self, event):
     """
     Handles the drawing for this widget and its selection region.
     
     :param      event | <QPaintEvent>
     """
     pen = QPen(Qt.DashLine)
     pen.setColor(QColor('red'))
     with XPainter(self) as painter:
         painter.setPen(pen)
         clr = QColor('black')
         clr.setAlpha(100)
         painter.setBrush(clr)
         
         painter.drawRect(self._region)
Exemple #2
0
 def paint( self, painter, option, widget ):
     """
     Paints this item.
     
     :param      painter | <QPainter>
                 option  | <QGraphicsOption>
                 widget  | <QWidget>
     """
     painter.save()
     pen = QPen(self.color())
     pen.setWidth(2)
     painter.setPen(pen)
     painter.drawPath(self._basePath)
     painter.setRenderHint(painter.Antialiasing)
     
     
     pen.setColor(QColor('white'))
     painter.setPen(pen)
     painter.setBrush(self.color())
     for ellipse in self._ellipses:
         painter.drawEllipse(ellipse, 6, 6)
     
     painter.restore()