def METHOD_NAME(self, editor, option, index):
    self.initStyleOption(option, index)
    option.showDecorationSelected = editor.style().styleHint(
        QtWidgets.QStyle.SH_ItemView_ShowDecorationSelected, None, editor
    )
    widget = option.widget
    style = widget.style() if widget else QtWidgets.QApplication.style()
    geo = style.subElementRect(
        QtWidgets.QStyle.SE_ItemViewItemText, option, widget
    )
    delta = self._q_smart_min_size(editor).width() - geo.width()
    if delta > 0:
        if editor.layoutDirection() == QtCore.Qt.RightToLeft:
            geo.adjust(-delta, 0, 0, 0)
        else:
            geo.adjust(0, 0, delta, 0)
    editor.setGeometry(geo)