| 55 | } |
| 56 | |
| 57 | QVariant TreeModel::data(const QModelIndex &index, int role) const |
| 58 | { |
| 59 | if (!index.isValid()) |
| 60 | return QVariant(); |
| 61 | |
| 62 | auto *item = static_cast<TreeItem*>(index.internalPointer()); |
| 63 | if (role == ItemRole) |
| 64 | return QVariant::fromValue(item); |
| 65 | |
| 66 | return item->data(index.column(), role); |
| 67 | } |
| 68 | |
| 69 | Qt::ItemFlags TreeModel::flags(const QModelIndex &index) const |
| 70 | { |