| 90 | } |
| 91 | |
| 92 | void QmitkDoseValueDelegate::setModelData(QWidget *editor, QAbstractItemModel* model |
| 93 | , const QModelIndex &index) const |
| 94 | { |
| 95 | QVariant data = index.data(Qt::EditRole); |
| 96 | |
| 97 | if(data.isValid()) |
| 98 | { |
| 99 | QDoubleSpinBox* spinBox = qobject_cast<QDoubleSpinBox *>(editor); |
| 100 | double doubleValue = spinBox->value(); |
| 101 | |
| 102 | QVariant doubleValueVariant(doubleValue); |
| 103 | model->setData(index, doubleValueVariant); |
| 104 | } |
| 105 | else |
| 106 | { |
| 107 | QStyledItemDelegate::setModelData(editor, model, index); |
| 108 | } |
| 109 | } |