| 69 | } |
| 70 | |
| 71 | QModelIndex BinaryToolsModel::index(int row, int column, const QModelIndex &parent) const |
| 72 | { |
| 73 | if (column == 0 && parent.isValid()) { |
| 74 | bool found; |
| 75 | QString group = groupForIndex(parent, &found); |
| 76 | if (found) { |
| 77 | auto items = binaryTools.value(group); |
| 78 | if (row < items.count()) { |
| 79 | auto &item = items.at(row); |
| 80 | return createIndex(row, 0, const_cast<ToolInfo *>(&item)); |
| 81 | } |
| 82 | } |
| 83 | } else if (column == 0 && row < binaryTools.size()) { |
| 84 | return createIndex(row, 0); |
| 85 | } |
| 86 | |
| 87 | return QModelIndex(); |
| 88 | } |
| 89 | |
| 90 | QModelIndex BinaryToolsModel::parent(const QModelIndex &child) const |
| 91 | { |
no test coverage detected