| 42 | } |
| 43 | |
| 44 | void ComboBoxDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const |
| 45 | { |
| 46 | QVariant value = index.model()->data(index, Qt::EditRole); |
| 47 | QComboBox *comboBox = static_cast<QComboBox*>(editor); |
| 48 | |
| 49 | comboBox->setCurrentIndex(comboBox->findData(value)); |
| 50 | } |
| 51 | |
| 52 | void ComboBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const |
| 53 | { |