| 110 | } |
| 111 | |
| 112 | QModelIndex QmitkDataStorageTreeModel::parent(const QModelIndex &index) const |
| 113 | { |
| 114 | if (!index.isValid()) |
| 115 | return QModelIndex(); |
| 116 | |
| 117 | TreeItem *childItem = this->TreeItemFromIndex(index); |
| 118 | TreeItem *parentItem = childItem->GetParent(); |
| 119 | |
| 120 | if (parentItem == m_Root) |
| 121 | return QModelIndex(); |
| 122 | |
| 123 | return this->createIndex(parentItem->GetIndex(), 0, parentItem); |
| 124 | } |
| 125 | |
| 126 | QmitkDataStorageTreeModel::TreeItem *QmitkDataStorageTreeModel::TreeItemFromIndex(const QModelIndex &index) const |
| 127 | { |
nothing calls this directly
no test coverage detected