| 35 | } |
| 36 | |
| 37 | QVariant ValueTableModel::data(const QModelIndex &index, int role) const |
| 38 | { |
| 39 | if (!index.isValid()) { |
| 40 | return QVariant(); |
| 41 | } |
| 42 | |
| 43 | if (role == Qt::DisplayRole || role == Qt::EditRole) { |
| 44 | ValueTableItem *item =rootItem->child(index.row()); |
| 45 | if(!item) |
| 46 | return QVariant(); |
| 47 | return item->data(index.column()); |
| 48 | } else { |
| 49 | return QVariant(); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | bool ValueTableModel::setData(const QModelIndex &index, const QVariant &value, int role) |
| 54 | { |