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

Method index

kdevplatform/debugger/util/treemodel.cpp:88–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88QModelIndex TreeModel::index(int row, int column, const QModelIndex &parent)
89 const
90{
91 Q_D(const TreeModel);
92
93 if (!hasIndex(row, column, parent))
94 return QModelIndex();
95
96 TreeItem *parentItem;
97
98 if (!parent.isValid())
99 parentItem = d->root;
100 else
101 parentItem = static_cast<TreeItem*>(parent.internalPointer());
102
103 TreeItem *childItem = parentItem->child(row);
104 if (childItem)
105 return createIndex(row, column, childItem);
106 else
107 return createIndex(row, column, nullptr);
108}
109
110QModelIndex TreeModel::parent(const QModelIndex &index) const
111{

Callers 1

breakpointHitMethod · 0.45

Calls 4

createIndexFunction · 0.85
QModelIndexClass · 0.50
isValidMethod · 0.45
childMethod · 0.45

Tested by

no test coverage detected