| 221 | } |
| 222 | |
| 223 | void QmitkForm::UpdateSectionHeader() |
| 224 | { |
| 225 | if (m_HasBeenSubmitted || m_Ui->sectionWidget->currentIndex() == -1) |
| 226 | { |
| 227 | m_Ui->sectionHeaderFrame->hide(); |
| 228 | return; |
| 229 | } |
| 230 | |
| 231 | int sectionIndex = m_Ui->sectionWidget->currentIndex(); |
| 232 | |
| 233 | if (sectionIndex == 0) |
| 234 | { |
| 235 | m_Ui->sectionHeaderFrame->hide(); |
| 236 | return; |
| 237 | } |
| 238 | |
| 239 | const auto& section = m_Form->GetSection(sectionIndex); |
| 240 | bool showTitle = !section.GetTitle().empty(); |
| 241 | |
| 242 | m_Ui->sectionTitleLabel->setVisible(showTitle); |
| 243 | |
| 244 | if (showTitle) |
| 245 | m_Ui->sectionTitleLabel->setText(QString::fromStdString(section.GetTitle())); |
| 246 | |
| 247 | bool showDescription = !section.GetDescription().empty(); |
| 248 | |
| 249 | m_Ui->sectionDescriptionLabel->setVisible(showDescription); |
| 250 | |
| 251 | if (showDescription) |
| 252 | m_Ui->sectionDescriptionLabel->setText(QString::fromStdString(section.GetDescription())); |
| 253 | |
| 254 | m_Ui->sectionHeaderFrame->setVisible(showTitle || showDescription); |
| 255 | } |
| 256 | |
| 257 | void QmitkForm::UpdateQuestionWidgets() |
| 258 | { |
no test coverage detected