def _on_before_paint(self, widget, model_index, style_options):
    if (style_options.state & QtGui.QStyle.State_Selected):
        widget.set_selected(True)
    else:
        widget.set_selected(False)
    icon = model_index.data(QtCore.Qt.DecorationRole)
    if (icon is not None):
        thumb = icon.pixmap(30)
        widget.set_thumbnail(thumb)
    widget.set_text(model_index.data(project_model.ProjectModel.DISPLAY_NAME_ROLE))
def _on_before_paint(self, widget, model_index, style_options):
    if (style_options.state & QtGui.QStyle.State_Selected):
        widget.set_selected(True)
    else:
        widget.set_selected(False)
    icon = model_index.data(QtCore.Qt.DecorationRole)
    if (icon is not None):
        thumb = icon.pixmap(30)
        widget.set_thumbnail(thumb)
    widget.set_text(model_index.data(project_model.ProjectModel.DISPLAY_NAME_ROLE))