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

Method paint

Modules/RTUI/src/QmitkDoseVisualStyleDelegate.cpp:39–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39void QmitkDoseVisualStyleDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
40{
41 bool checkValue = index.data(Qt::DisplayRole).toBool();
42
43 QStyleOptionButton BtnStyle;
44 BtnStyle.state = QStyle::State_Enabled;
45
46 if(checkValue)
47 {
48 BtnStyle.state |= QStyle::State_On;
49 }
50 else
51 {
52 BtnStyle.state |= QStyle::State_Off;
53 }
54
55 BtnStyle.direction = QApplication::layoutDirection();
56 BtnStyle.rect = CheckBoxRect(option);
57 QApplication::style()->drawControl(QStyle::CE_CheckBox,&BtnStyle,painter );
58}
59
60bool QmitkDoseVisualStyleDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &,
61 const QModelIndex &index)

Callers

nothing calls this directly

Calls 2

CheckBoxRectFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected