MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / indexForItem

Method indexForItem

src/plugins/debugger/interface/localtreemodel.cpp:217–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215}
216
217QModelIndex LocalTreeModel::indexForItem(const LocalTreeItem *item) const
218{
219 if (!item || item == rootItem) {
220 return QModelIndex();
221 }
222
223 LocalTreeItem *p = item->parent();
224 if (!p)
225 return QModelIndex();
226
227 auto mitem = const_cast<LocalTreeItem *>(item);
228 int row = p->indexOf(mitem);
229 return createIndex(row, 0, mitem);
230}

Callers 1

indexMethod · 0.80

Calls 3

QModelIndexClass · 0.50
parentMethod · 0.45
indexOfMethod · 0.45

Tested by

no test coverage detected