| 37 | } |
| 38 | |
| 39 | void ColorPickerDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const |
| 40 | { |
| 41 | QColorDialog *colorDialog = static_cast<QColorDialog*>(editor); |
| 42 | const QColor color = index.model()->data(index, Qt::DecorationRole).value<QColor>(); |
| 43 | |
| 44 | colorDialog->setCurrentColor(color); |
| 45 | } |
| 46 | |
| 47 | void ColorPickerDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const |
| 48 | { |