'Paint the shape and a progress meter.'

def paint(self, painter, option, widget):

    if (option.state & QStyle.State_Selected):
        option.state = (option.state ^ QStyle.State_Selected)
    GraphicsPathObject.paint(self, painter, option, widget)
    if (self.__progress >= 0):
        painter.save()
        painter.setClipPath(self.shape(), Qt.ReplaceClip)
        color = self.palette.color(QPalette.ButtonText)
        pen = QPen(color, 5)
        painter.setPen(pen)
        painter.setRenderHints(QPainter.Antialiasing)
        span = max(1, int((self.__progress * 57.6)))
        painter.drawArc(self.__shapeRect, (90 * 16), (- span))
        painter.restore()
