| 71 | } |
| 72 | |
| 73 | void QmitkDoseValueDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const |
| 74 | { |
| 75 | QVariant data = index.data(Qt::EditRole); |
| 76 | |
| 77 | if(data.isValid()) |
| 78 | { |
| 79 | |
| 80 | QDoubleSpinBox* spinBox = qobject_cast<QDoubleSpinBox *>(editor); |
| 81 | if (spinBox) |
| 82 | { |
| 83 | spinBox->setValue(data.toDouble()); |
| 84 | } |
| 85 | else |
| 86 | { |
| 87 | QStyledItemDelegate::setEditorData(editor, index); |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | void QmitkDoseValueDelegate::setModelData(QWidget *editor, QAbstractItemModel* model |
| 93 | , const QModelIndex &index) const |