| 37 | } |
| 38 | |
| 39 | void SpinBoxDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const |
| 40 | { |
| 41 | int value = index.model()->data(index, Qt::EditRole).toInt(); |
| 42 | |
| 43 | QSpinBox *spinBox = static_cast<QSpinBox*>(editor); |
| 44 | spinBox->setValue(value); |
| 45 | } |
| 46 | |
| 47 | void SpinBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const |
| 48 | { |