def METHOD_NAME(self, painter, option, index):
    painter.save()
    if option.state & QStyle.State_Selected:
        painter.fillRect(option.rect, option.palette.highlight())
        text_color = option.palette.highlightedText()
    else:
        text_color = option.palette.text()
    self._translation_char_format.setForeground(text_color)
    self._strokes_char_format.setForeground(text_color)
    painter.translate(option.rect.topLeft())
    self._doc.clear()
    cursor = QTextCursor(self._doc)
    translation, strokes = self._format_suggestion(index)
    cursor.insertText(translation, self._translation_char_format)
    if strokes is not None:
        cursor.insertText(strokes, self._strokes_char_format)
    self._doc.drawContents(painter)
    painter.restore()