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

Method paint

Modules/RTUI/src/QmitkDoseColorDelegate.cpp:26–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected