18 const QStyleOptionViewItem& option,
19 const QModelIndex& index)
const
22 if (index.column() == 1)
24 if (index.data().canConvert(QMetaType::QColor))
26 val = index.data().value<QColor>();
28 painter->fillRect(option.rect, brush);
33 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.