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

Method duObjectForIndex

kdevplatform/language/classmodel/classmodel.cpp:179–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179KDevelop::DUChainBase* ClassModel::duObjectForIndex(const QModelIndex& a_index)
180{
181 if (!a_index.isValid())
182 return nullptr;
183
184 Node* node = static_cast<Node*>(a_index.internalPointer());
185
186 if (auto* identifierNode = dynamic_cast<IdentifierNode*>(node))
187 return identifierNode->declaration();
188
189 // Non was found.
190 return nullptr;
191}
192
193QModelIndex ClassModel::indexForIdentifier(const KDevelop::IndexedQualifiedIdentifier& a_id)
194{

Callers 3

contextMenuEventMethod · 0.80
eventMethod · 0.80
itemActivatedMethod · 0.80

Calls 2

isValidMethod · 0.45
declarationMethod · 0.45

Tested by

no test coverage detected