| 139 | } |
| 140 | |
| 141 | QModelIndex QmitkDataStorageSimpleTreeModel::parent(const QModelIndex &child) const |
| 142 | { |
| 143 | if (!child.isValid() || !m_Root || child.model() != this) |
| 144 | return QModelIndex(); |
| 145 | |
| 146 | TreeItem *childItem = this->TreeItemFromIndex(child); |
| 147 | |
| 148 | if (!childItem) |
| 149 | return QModelIndex(); |
| 150 | |
| 151 | TreeItem *parentItem = childItem->GetParent(); |
| 152 | |
| 153 | if (parentItem == m_Root) |
| 154 | return QModelIndex(); |
| 155 | |
| 156 | return this->createIndex(parentItem->GetIndex(), 0, parentItem); |
| 157 | } |
| 158 | |
| 159 | QmitkDataStorageSimpleTreeModel::TreeItem *QmitkDataStorageSimpleTreeModel::TreeItemFromIndex( |
| 160 | const QModelIndex &index) const |
nothing calls this directly
no test coverage detected