MCPcopy Create free account
hub / github.com/MITK/MITK / index

Method index

Plugins/org.blueberry.ui.qt/src/model/berryViewTreeModel.cpp:268–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268QModelIndex ViewTreeModel::index(int row, int column, const QModelIndex& parent) const
269{
270 if (!hasIndex(row, column, parent))
271 {
272 return QModelIndex();
273 }
274
275 ViewTreeItem* parentItem = nullptr;
276 if (!parent.isValid())
277 {
278 parentItem = d->rootItem.data();
279 }
280 else
281 {
282 parentItem = static_cast<ViewTreeItem*>(parent.internalPointer());
283 }
284
285 ViewTreeItem* childItem = parentItem->childItem(row);
286 if (childItem)
287 {
288 return createIndex(row, column, childItem);
289 }
290 return QModelIndex();
291}
292
293QModelIndex ViewTreeModel::parent(const QModelIndex& child) const
294{

Callers 6

filterAcceptsRowMethod · 0.45
RestoreExpandedStateMethod · 0.45
RestoreStateMethod · 0.45
SetInitialSelectionMethod · 0.45

Calls 3

childItemMethod · 0.80
QModelIndexClass · 0.50
dataMethod · 0.45

Tested by 3

SetInitialSelectionMethod · 0.36