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

Method SetPropertyValue

Modules/MatchPointRegistrationUI/src/QmitkMAPAlgorithmModel.cpp:281–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279};
280
281bool QmitkMAPAlgorithmModel::SetPropertyValue(const map::algorithm::MetaPropertyInfo *pInfo, const QVariant &value)
282{
283 if (!m_pMetaInterface)
284 {
285 return false;
286 }
287
288 bool result = CheckCastAndSetProp<bool>(pInfo, value);
289
290 if (!result)
291 result = CheckCastAndSetProp<int>(pInfo, value);
292 if (!result)
293 result = CheckCastAndSetProp<unsigned int>(pInfo, value);
294 if (!result)
295 result = CheckCastAndSetProp<long>(pInfo, value);
296 if (!result)
297 result = CheckCastAndSetProp<unsigned long>(pInfo, value);
298 if (!result)
299 result = CheckCastAndSetProp<float>(pInfo, value);
300 if (!result)
301 result = CheckCastAndSetProp<double>(pInfo, value);
302 if (!result && pInfo->getTypeInfo() == typeid(map::core::String))
303 {
304 map::core::String val = value.toString().toStdString();
305 map::core::MetaPropertyBase::Pointer spMetaProp = map::core::MetaProperty<map::core::String>::New(val).GetPointer();
306
307 result = m_pMetaInterface->setProperty(pInfo, spMetaProp);
308 };
309
310 return result;
311};

Callers

nothing calls this directly

Calls 4

GetPointerMethod · 0.80
setPropertyMethod · 0.80
NewFunction · 0.50
toStringMethod · 0.45

Tested by

no test coverage detected