'Override Qt method.
Painting line number area'

def paintEvent(self, event):

    painter = QPainter(self)
    painter.fillRect(event.rect(), self.editor.sideareas_color)
    font = self.editor.font()
    font_height = self.editor.fontMetrics().height()
    active_block = self.editor.textCursor().block()
    active_line_number = (active_block.blockNumber() + 1)
    def draw_pixmap(ytop, pixmap):
        if (not QT55_VERSION):
            pixmap_height = pixmap.height()
        else:
            pixmap_height = (pixmap.height() / pixmap.devicePixelRatio())
        painter.drawPixmap(0, (ytop + ((font_height - pixmap_height) / 2)), pixmap)
    for (top, line_number, block) in self.editor.visible_blocks:
        if self._margin:
            if (line_number == active_line_number):
                font.setWeight(font.Bold)
                painter.setFont(font)
                painter.setPen(self.editor.normal_color)
            else:
                font.setWeight(font.Normal)
                painter.setFont(font)
                painter.setPen(self.linenumbers_color)
            painter.drawText(0, top, self.width(), font_height, (Qt.AlignRight | Qt.AlignBottom), to_text_string(line_number))
        data = block.userData()
        if (self._markers_margin and data):
            if data.code_analysis:
                for (_message, error) in data.code_analysis:
                    if error:
                        break
                if error:
                    draw_pixmap(top, self.error_pixmap)
                else:
                    draw_pixmap(top, self.warning_pixmap)
            if data.todo:
                draw_pixmap(top, self.todo_pixmap)
            if data.breakpoint:
                if (data.breakpoint_condition is None):
                    draw_pixmap(top, self.bp_pixmap)
                else:
                    draw_pixmap(top, self.bpc_pixmap)
