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

Function findItemChild

plugins/git/repostatusmodel.cpp:152–162  ·  view source on GitHub ↗

Finds the immediate child of a `parent` item whose data with role `role` has value `value` */

Source from the content-addressed store, hash-verified

150
151/* Finds the immediate child of a `parent` item whose data with role `role` has value `value` */
152QStandardItem* findItemChild(const QStandardItem* parent, const QVariant& value, int role = Qt::DisplayRole)
153{
154 for (int i = 0; i < parent->rowCount(); i++) {
155 QStandardItem* curr = parent->child(i);
156
157 if (curr->data(role) == value)
158 return curr;
159 }
160
161 return nullptr;
162}
163
164QStandardItem* RepoStatusModel::findProject(const IProject* project) const
165{

Callers 2

findProjectMethod · 0.70
projectItemMethod · 0.70

Calls 3

rowCountMethod · 0.45
childMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected