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

Method TreeItemFromIndex

Modules/QtWidgets/src/QmitkDataStorageSimpleTreeModel.cpp:159–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159QmitkDataStorageSimpleTreeModel::TreeItem *QmitkDataStorageSimpleTreeModel::TreeItemFromIndex(
160 const QModelIndex &index) const
161{
162 if (index.isValid() && index.model() == this)
163 {
164 auto item = static_cast<TreeItem *>(index.internalPointer());
165 auto finding = std::find(std::begin(m_TreeItems), std::end(m_TreeItems), item);
166 if (finding == std::end(m_TreeItems))
167 {
168 return nullptr;
169 }
170 return item;
171 }
172 else
173 return m_Root;
174}
175
176int QmitkDataStorageSimpleTreeModel::rowCount(const QModelIndex &parent) const
177{

Callers 5

parentMethod · 0.95
rowCountMethod · 0.95
dataMethod · 0.95
setDataMethod · 0.95
flagsMethod · 0.95

Calls 2

beginFunction · 0.85
endFunction · 0.85

Tested by

no test coverage detected