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

Method setModelData

Modules/ModelFitUI/src/QmitkSimpleBarrierTypeDelegate.cpp:69–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67}
68
69void QmitkSimpleBarrierTypeDelegate::setModelData(QWidget* editor, QAbstractItemModel* model
70 , const QModelIndex& index) const
71{
72 QVariant data = index.data(Qt::EditRole);
73
74 if (data.isValid())
75 {
76 QComboBox* cmbBox = qobject_cast<QComboBox*>(editor);
77 int selection = cmbBox->currentIndex();
78
79 QVariant selectionVariant(selection);
80 model->setData(index, selectionVariant);
81 }
82 else
83 {
84 QStyledItemDelegate::setModelData(editor, model, index);
85 }
86}

Callers

nothing calls this directly

Calls 2

dataMethod · 0.45
setDataMethod · 0.45

Tested by

no test coverage detected