code: def paint(self, painter, option, widget):
          
          # following the arguments required by Qt
          # pylint: disable-msg=W0613
  
          painter.setOpacity(self.opacity())
  
          # show the connection selected
          if not self.isEnabled():
              pen = QPen(self.disabledPen())
          elif self.isSelected():
              pen = QPen(self.highlightPen())
          else:
              pen = QPen(self.pen())
  
          if self._textItem:
              self._textItem.setOpacity(self.opacity())
              self._textItem.setDefaultTextColor(pen.color().darker(110))
  
          # rebuild first if necessary
          if self.isDirty():
              self.setPath(self.rebuild())
  
          # store the initial hint
          hint = painter.renderHints()
          painter.setRenderHint(painter.Antialiasing)
  
          pen.setWidthF(1.25)
          painter.setPen(pen)
          painter.drawPath(self.path())
  
          # redraw the polys to force-fill them
          for poly in self._polygons:
              if not poly.isClosed():
                  continue
  
              painter.setBrush(pen.color())
              painter.drawPolygon(poly)
  
          # restore the render hints
          painter.setRenderHints(hint)
docs: Overloads the paint method from QGraphicsPathItem to \
          handle custom drawing of the path using this items \
          pens and polygons.
          
          :param      painter     <QPainter>
          :param      option      <QGraphicsItemStyleOption>
          :param      widget      <QWidget>