| 83 | } |
| 84 | |
| 85 | void QmitkForm::CreateQuestionWidgets() |
| 86 | { |
| 87 | while (m_Ui->sectionWidget->count() > 0) |
| 88 | { |
| 89 | auto sectionWidget = m_Ui->sectionWidget->widget(0); |
| 90 | m_Ui->sectionWidget->removeWidget(sectionWidget); |
| 91 | sectionWidget->deleteLater(); |
| 92 | } |
| 93 | |
| 94 | const int numberOfSections = m_Form->GetNumberOfSections(); |
| 95 | |
| 96 | for (int sectionIndex = 0; sectionIndex < numberOfSections; ++sectionIndex) |
| 97 | { |
| 98 | const auto& section = m_Form->GetSection(sectionIndex); |
| 99 | auto questions = section.GetQuestions(); |
| 100 | |
| 101 | auto sectionWidget = new QWidget; |
| 102 | m_Ui->sectionWidget->addWidget(sectionWidget); |
| 103 | |
| 104 | auto sectionLayout = new QVBoxLayout(sectionWidget); |
| 105 | sectionLayout->setContentsMargins(0, 0, 0, 0); |
| 106 | sectionLayout->setSpacing(8); |
| 107 | |
| 108 | for (auto question : questions) |
| 109 | { |
| 110 | auto questionWidget = UI::IQuestionWidgetFactory::GetInstance()->Create(question); |
| 111 | sectionLayout->addWidget(questionWidget); |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | bool QmitkForm::ValidateCurrentSection() |
| 117 | { |
no test coverage detected