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

Method parent

kdevplatform/language/codecompletion/codecompletionmodel.cpp:400–413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398}
399
400QModelIndex CodeCompletionModel::parent(const QModelIndex& index) const
401{
402 if (rowCount() == 0)
403 return QModelIndex();
404
405 if (index.isValid()) {
406 auto* element = static_cast<CompletionTreeElement*>(index.internalPointer());
407
408 if (element->parent())
409 return createIndex(element->rowInParent(), element->columnInParent(), element->parent());
410 }
411
412 return QModelIndex();
413}
414
415int CodeCompletionModel::rowCount(const QModelIndex& parent) const
416{

Callers 1

Calls 5

createIndexFunction · 0.85
rowInParentMethod · 0.80
columnInParentMethod · 0.80
QModelIndexClass · 0.70
isValidMethod · 0.45

Tested by

no test coverage detected