| 46 | } |
| 47 | |
| 48 | QVariant ObjectEnumModel::data(const QModelIndex &index, int role) const |
| 49 | { |
| 50 | if (!index.parent().isValid()) |
| 51 | return SuperClass::data(index, role); |
| 52 | |
| 53 | if (role == Qt::DisplayRole) { |
| 54 | const QMetaEnum e = m_metaObject->enumerator(index.parent().row()); |
| 55 | if (index.column() == 0) |
| 56 | return e.key(index.row()); |
| 57 | if (index.column() == 1) |
| 58 | return e.value(index.row()); |
| 59 | } |
| 60 | |
| 61 | return QVariant(); |
| 62 | } |
| 63 | |
| 64 | QVariant ObjectEnumModel::metaData(const QModelIndex &index, const QMetaEnum &enumerator, |
| 65 | int role) const |