Any reason why you can't use QStandardItemModel? in that case subclass QStyledItemDelegate and reimplement paint void QStyledItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { Q_ASSERT(index.isValid()); QStyleOptionViewItem opt = option; initStyleOption(&opt, index); ///////////////////////////////////// // Set the background based on the content if(index.data().toInt()==1) opt.backgroundBrush = QBrush(Qt::red); ///////////////////////////////////// const QWidget *widget = option.widget; QStyle *style = widget ? widget->style() : QApplication::style(); style->drawControl(QStyle::CE_ItemViewItem, &opt, painter, widget); }