def METHOD_NAME(self):
    digits = 1
    m = max(1, self.blockCount())
    while m > 10:
        m /= 10
        digits += 1
    return self._right_margin / 2 + self.fontMetrics().horizontalAdvance("9") * digits + self._right_margin