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

Method parent

Modules/SegmentationUI/src/QmitkMultiLabelTreeModel.cpp:621–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

619}
620
621QModelIndex QmitkMultiLabelTreeModel::parent(const QModelIndex &child) const
622{
623 if (!child.isValid())
624 return QModelIndex();
625
626 QmitkMultiLabelSegTreeItem *childItem = static_cast<QmitkMultiLabelSegTreeItem *>(child.internalPointer());
627 QmitkMultiLabelSegTreeItem *parentItem = childItem->ParentItem();
628
629 if (parentItem == m_RootItem.get())
630 return QModelIndex();
631
632 return createIndex(parentItem->Row(), 0, parentItem);
633}
634
635QModelIndex QmitkMultiLabelTreeModel::FirstLabelInstanceIndex(const QModelIndex& currentIndex) const
636{

Callers 4

AddNewLabelInternalMethod · 0.45
DeleteLabelInternalMethod · 0.45
RemoveGroupInternalMethod · 0.45

Calls 3

ParentItemMethod · 0.80
RowMethod · 0.80
QModelIndexClass · 0.50

Tested by 4

AddNewLabelInternalMethod · 0.36
DeleteLabelInternalMethod · 0.36
RemoveGroupInternalMethod · 0.36