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

Method UpdateFormWidget

Modules/SegmentationUI/src/QmitkSegmentationTaskListWidget.cpp:698–734  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

696}
697
698void QmitkSegmentationTaskListWidget::UpdateFormWidget()
699{
700 if (!m_CurrentTaskIndex.has_value())
701 {
702 m_Ui->formWidget->hide();
703 return;
704 }
705
706 const auto current = m_CurrentTaskIndex.value();
707
708 if (!ActiveTaskIsShown() || !m_TaskList->HasForm(current))
709 {
710 m_Ui->formWidget->hide();
711 return;
712 }
713
714 auto form = m_TaskList->GetForm(current);
715
716 try
717 {
718 const auto formPath = m_TaskList->GetAbsolutePath(form.Path);
719 m_Form = nlohmann::json::parse(ReadFileAsString(QString::fromStdString(formPath.string())).toStdString());
720 }
721 catch (const mitk::Exception& e)
722 {
723 MITK_ERROR << e.GetDescription();
724 return;
725 }
726
727 m_Form.AddSupplement("Task");
728 m_Ui->formWidget->SetForm(&m_Form);
729
730 const auto responsesPath = m_TaskList->GetAbsolutePath(form.Result);
731 m_Ui->formWidget->SetResponsesPath(responsesPath);
732
733 m_Ui->formWidget->show();
734}
735
736void QmitkSegmentationTaskListWidget::OnFormSubmission()
737{

Callers 1

OnCurrentTaskChangedMethod · 0.95

Calls 9

GetFormMethod · 0.80
AddSupplementMethod · 0.80
SetFormMethod · 0.80
SetResponsesPathMethod · 0.80
showMethod · 0.80
ReadFileAsStringFunction · 0.70
valueMethod · 0.45
GetAbsolutePathMethod · 0.45
GetDescriptionMethod · 0.45

Tested by

no test coverage detected