MCPcopy Create free account
hub / github.com/MITK/MITK / paint

Method paint

Modules/SegmentationUI/src/QmitkLabelColorItemDelegate.cpp:23–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23void QmitkLabelColorItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
24 const QModelIndex &index) const
25{
26 QVariant data = index.data(Qt::EditRole);
27
28 if (data.canConvert<QColor>())
29 {
30 QColor color = data.value<QColor>();
31
32 painter->fillRect(option.rect, color);
33 }
34 else
35 {
36 QStyledItemDelegate::paint(painter, option, index);
37 }
38}
39
40bool QmitkLabelColorItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &,
41 const QModelIndex &index)

Callers

nothing calls this directly

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected