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

Method setSourceModel

Modules/SegmentationUI/src/QmitkFlatLabelInstanceProxyModel.cpp:21–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19}
20
21void QmitkFlatLabelInstanceProxyModel::setSourceModel(QAbstractItemModel* sourceModel)
22{
23 auto labelModel = dynamic_cast<QmitkMultiLabelTreeModel*>(sourceModel);
24 if (nullptr == labelModel)
25 mitkThrow() << "Error. QmitkFlatLabelInstanceProxyModel only accepts QmitkMultiLabelTreeModel as source.";
26 this->beginResetModel();
27 QAbstractProxyModel::setSourceModel(sourceModel);
28 endResetModel();
29
30 if (!sourceModel)
31 return;
32
33 connect(labelModel, &QAbstractItemModel::modelReset, this, &QmitkFlatLabelInstanceProxyModel::OnSourceModelReset);
34 connect(labelModel, &QmitkMultiLabelTreeModel::modelChanged, this, &QmitkFlatLabelInstanceProxyModel::OnSourceDataChanged);
35
36 this->RebuildMapping();
37}
38
39void QmitkFlatLabelInstanceProxyModel::RebuildMapping()
40{

Callers 15

setPresetsMethod · 0.80
RefreshCompleterMethod · 0.80
CreateQtPartControlMethod · 0.80
QtShowViewDialogMethod · 0.80
SavePerspectiveDialogMethod · 0.80
CreateQtPartControlMethod · 0.80
CreateQtPartControlMethod · 0.80
setModelMethod · 0.80
CreateQtPartControlMethod · 0.80

Calls 1

RebuildMappingMethod · 0.95

Tested by 3

RefreshCompleterMethod · 0.64
SavePerspectiveDialogMethod · 0.64