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

Method setModelData

Modules/ModelFitUI/src/QmitkInitialValuesDelegate.cpp:86–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void QmitkInitialValuesDelegate::setModelData(QWidget* editor, QAbstractItemModel* model
87 , const QModelIndex& index) const
88{
89 QVariant data = index.data(Qt::EditRole);
90
91 if (data.isValid() && valueType(index) == 1)
92 {
93 QmitkDataStorageComboBox* box = qobject_cast<QmitkDataStorageComboBox*>(editor);
94 QVariant newNode = QVariant::fromValue(static_cast<void*>(box->GetSelectedNode().GetPointer()));
95 model->setData(index, newNode);
96 }
97 else
98 {
99 QStyledItemDelegate::setModelData(editor, model, index);
100 }
101}
102
103void QmitkInitialValuesDelegate::
104setDataStorage(mitk::DataStorage* storage)

Callers

nothing calls this directly

Calls 4

GetPointerMethod · 0.80
dataMethod · 0.45
GetSelectedNodeMethod · 0.45
setDataMethod · 0.45

Tested by

no test coverage detected