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

Method indexForItem

kdevplatform/debugger/util/treemodel.cpp:155–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155QModelIndex TreeModel::indexForItem(TreeItem *item, int column) const
156{
157 const auto* const parent = item->parent();
158 if (!parent) {
159 return QModelIndex();
160 }
161
162 /* FIXME: we might store row directly in item. */
163 int row = parent->childItems.indexOf(item);
164 Q_ASSERT(row != -1);
165
166 return createIndex(row, column, item);
167}
168
169void TreeModel::expanded(const QModelIndex &index)
170{

Callers 15

VariableTreeMethod · 0.80
VariableToolTipMethod · 0.80
appendChildMethod · 0.80
insertChildMethod · 0.80
reportChangeMethod · 0.80
removeChildMethod · 0.80
removeSelfMethod · 0.80
clearMethod · 0.80
setHasMoreMethod · 0.80
watchVariableIndexAtMethod · 0.80
localVariableIndexAtMethod · 0.80
testQListContainerMethod · 0.80

Calls 4

createIndexFunction · 0.85
QModelIndexClass · 0.50
parentMethod · 0.45
indexOfMethod · 0.45

Tested by 10

watchVariableIndexAtMethod · 0.64
localVariableIndexAtMethod · 0.64
testQListContainerMethod · 0.64
testQListPODMethod · 0.64
testKTextEditorTypesMethod · 0.64
testKDevelopTypesMethod · 0.64
variableChildCountMethod · 0.64
variableChildAtMethod · 0.64
watchVariableAtMethod · 0.64