'Draw the icon of an ItemViewItem.'

def _draw_icon(self):

    icon_rect = self._style.subElementRect(self._style.SE_ItemViewItemDecoration, self._opt, self._opt.widget)
    if (not icon_rect.isValid()):
        return
    mode = QIcon.Normal
    if (not (self._opt.state & QStyle.State_Enabled)):
        mode = QIcon.Disabled
    elif (self._opt.state & QStyle.State_Selected):
        mode = QIcon.Selected
    state = (QIcon.On if (self._opt.state & QStyle.State_Open) else QIcon.Off)
    self._opt.icon.paint(self._painter, icon_rect, self._opt.decorationAlignment, mode, state)
