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

Method paint

Modules/SegmentationUI/src/QmitkLabelToggleItemDelegate.cpp:27–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27void QmitkLabelToggleItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
28 const QModelIndex &index) const
29{
30 QVariant data = index.data(Qt::EditRole);
31
32 if (data.canConvert<bool>())
33 {
34 if (data.toBool())
35 {
36 m_OnIcon.paint(painter, option.rect);
37 }
38 else
39 {
40 m_OffIcon.paint(painter, option.rect);
41 }
42 }
43 else
44 {
45 QStyledItemDelegate::paint(painter, option, index);
46 }
47}
48
49QSize QmitkLabelToggleItemDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const
50{

Callers

nothing calls this directly

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected