| 67 | } |
| 68 | |
| 69 | void 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 | } |