| 154 | } |
| 155 | |
| 156 | QModelIndex DeviceModel::index(int row, int column, |
| 157 | const QModelIndex &parent) const { |
| 158 | if (!hasIndex(row, column, parent)) |
| 159 | return {}; |
| 160 | Node *p = nodeFor(parent); |
| 161 | if (row < 0 || row >= p->children.size()) |
| 162 | return {}; |
| 163 | return createIndex(row, column, p->children[row]); |
| 164 | } |
| 165 | |
| 166 | QModelIndex DeviceModel::parent(const QModelIndex &child) const { |
| 167 | if (!child.isValid()) |
no outgoing calls
no test coverage detected