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

Method parent

Modules/ImageStatisticsUI/src/QmitkImageStatisticsTreeModel.cpp:121–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121QModelIndex QmitkImageStatisticsTreeModel::parent(const QModelIndex &child) const
122{
123 if (!child.isValid())
124 return QModelIndex();
125
126 QmitkImageStatisticsTreeItem *childItem = static_cast<QmitkImageStatisticsTreeItem *>(child.internalPointer());
127 QmitkImageStatisticsTreeItem *parentItem = childItem->parentItem();
128
129 if (parentItem == m_RootItem.get())
130 return QModelIndex();
131
132 return createIndex(parentItem->row(), 0, parentItem);
133}
134
135Qt::ItemFlags QmitkImageStatisticsTreeModel::flags(const QModelIndex &index) const
136{

Callers

nothing calls this directly

Calls 3

QModelIndexClass · 0.50
parentItemMethod · 0.45
rowMethod · 0.45

Tested by

no test coverage detected