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

Method data

Modules/MatchPointRegistrationUI/src/QmitkMAPAlgorithmModel.cpp:54–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54QVariant QmitkMAPAlgorithmModel::data(const QModelIndex &index, int role) const
55{
56 if (!index.isValid())
57 return QVariant();
58
59 if (!m_pMetaInterface)
60 {
61 return QVariant();
62 }
63
64 QVariant result;
65
66 if (index.row() < static_cast<int>(m_MetaProperties.size()))
67 {
68 map::algorithm::MetaPropertyInfo *pInfo = m_MetaProperties[index.row()];
69
70 switch (index.column())
71 {
72 case 0:
73 if (Qt::DisplayRole == role && index.row() < static_cast<int>(m_MetaProperties.size()))
74 {
75 result = QVariant(pInfo->getName().c_str());
76 }
77 break;
78 case 1:
79 if (Qt::DisplayRole == role && !pInfo->isReadable())
80 {
81 result = QVariant("value is not accessible");
82 }
83 else if (pInfo->isReadable() && (Qt::DisplayRole == role || (Qt::EditRole == role && pInfo->isWritable())))
84 { // should also be readable to be sensible editable in the GUI
85 result = GetPropertyValue(pInfo, role);
86 }
87 break;
88 }
89 }
90
91 return result;
92}
93
94Qt::ItemFlags QmitkMAPAlgorithmModel::flags(const QModelIndex &index) const
95{

Callers 15

AppliesToMethod · 0.45
RGBToLabFunction · 0.45
SuggestNewLabelColorMethod · 0.45
CreateLabelMaskMethod · 0.45
CreateLabelClassMapMethod · 0.45
GenerateNewGroupImageMethod · 0.45
flagsMethod · 0.45
paintMethod · 0.45
createEditorMethod · 0.45
setEditorDataMethod · 0.45

Calls 3

GetPropertyValueFunction · 0.50
rowMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected