MCPcopy Create free account
hub / github.com/KDE/kdevelop / matchingIndexes

Function matchingIndexes

plugins/quickopen/documentationquickopenprovider.cpp:66–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66void 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
83DocumentationQuickOpenProvider::DocumentationQuickOpenProvider()

Callers 1

setFilterTextMethod · 0.85

Calls 8

hasChildrenMethod · 0.45
rowCountMethod · 0.45
indexMethod · 0.45
indexOfMethod · 0.45
toStringMethod · 0.45
dataMethod · 0.45
insertMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected