30 const QStyleOptionViewItem& option,
31 const QModelIndex& index)
const
34 if (index.column() == 1)
36 if (index.data().canConvert(QMetaType::QColor))
38 val = index.data().value<QColor>();
40 painter->fillRect(option.rect, brush);
45 QItemDelegate::paint(painter, option, index);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Overwrites the paint-method to set user-defined properties instead of the default properties.