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

Method UpdateComboBoxText

Modules/QtWidgets/src/QmitkDataStorageComboBox.cpp:440–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

438}
439
440void QmitkDataStorageComboBox::UpdateComboBoxText(const mitk::PropertyList* propertyList)
441{
442 mitk::PropertyList* dataNodePropertyList = nullptr;
443 mitk::PropertyList* baseDataPropertyList = nullptr;
444 mitk::BaseData* baseData;
445 for (const auto& node : m_Nodes)
446 {
447 dataNodePropertyList = node->GetPropertyList();
448
449 baseData = dynamic_cast<mitk::BaseData*>(node->GetData());
450 if (nullptr != baseData)
451 {
452 baseDataPropertyList = baseData->GetPropertyList();
453 }
454
455 if (propertyList == dataNodePropertyList
456 || propertyList == baseDataPropertyList)
457 {
458 // if one of the property list is the one that has just been modified
459 // get the node's index and set its text to the node name
460 // the node name might have been changed, depending on the modified property list
461 auto index = Find(node);
462 // update text in combobox
463 this->setItemText(index, QString::fromStdString(node->GetName()));
464 return;
465 }
466 }
467}

Callers

nothing calls this directly

Calls 3

GetPropertyListMethod · 0.45
GetDataMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected