| 64 | } |
| 65 | |
| 66 | void matchingIndexes(const QAbstractItemModel* m, const QString& match, const QModelIndex& idx, QList<QModelIndex>& ret, int& preferred) |
| 67 | { |
| 68 | if (m->hasChildren(idx)) { |
| 69 | for (int i = 0, rows = m->rowCount(); i < rows; i++) { |
| 70 | matchingIndexes(m, match, m->index(i, 0, idx), ret, preferred); |
| 71 | } |
| 72 | } else { |
| 73 | int index = idx.data().toString().indexOf(match, 0, Qt::CaseInsensitive); |
| 74 | if (index == 0) { |
| 75 | ret.insert(preferred++, idx); |
| 76 | } else if (index > 0) { |
| 77 | ret.append(idx); |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | DocumentationQuickOpenProvider::DocumentationQuickOpenProvider() |
no test coverage detected