| 349 | } |
| 350 | |
| 351 | void QmitkMultiLabelInspector::UpdateSelectionModel(const LabelValueVectorType& selectedLabels) |
| 352 | { |
| 353 | // create new selection by retrieving the corresponding indexes of the labels |
| 354 | QItemSelection newCurrentSelection; |
| 355 | for (const auto& labelID : selectedLabels) |
| 356 | { |
| 357 | QModelIndexList matched = m_Model->match(m_Model->index(0, 0), QmitkMultiLabelTreeModel::ItemModelRole::LabelInstanceValueRole, QVariant(labelID), 1, Qt::MatchRecursive); |
| 358 | if (!matched.empty()) |
| 359 | { |
| 360 | newCurrentSelection.select(matched.front(), matched.front()); |
| 361 | } |
| 362 | } |
| 363 | |
| 364 | m_Controls->view->selectionModel()->select(newCurrentSelection, QItemSelectionModel::ClearAndSelect|QItemSelectionModel::Current); |
| 365 | } |
| 366 | |
| 367 | void QmitkMultiLabelInspector::SetSelectedLabel(mitk::MultiLabelSegmentation::LabelValueType selectedLabel) |
| 368 | { |
no test coverage detected