| 255 | } |
| 256 | |
| 257 | void QmitkForm::UpdateQuestionWidgets() |
| 258 | { |
| 259 | if (m_HasBeenSubmitted || m_Ui->sectionWidget->currentIndex() == -1) |
| 260 | { |
| 261 | m_Ui->sectionWidget->hide(); |
| 262 | return; |
| 263 | } |
| 264 | else |
| 265 | { |
| 266 | m_Ui->sectionWidget->show(); |
| 267 | } |
| 268 | |
| 269 | int currentSectionIndex = m_Ui->sectionWidget->currentIndex(); |
| 270 | int numberOfSections = m_Ui->sectionWidget->count(); |
| 271 | |
| 272 | for (int sectionIndex = 0; sectionIndex < numberOfSections; ++sectionIndex) |
| 273 | { |
| 274 | auto sectionWidget = m_Ui->sectionWidget->widget(sectionIndex); |
| 275 | auto questionWidgets = sectionWidget->findChildren<QmitkQuestionWidget*>(); |
| 276 | |
| 277 | for (auto questionWidget : questionWidgets) |
| 278 | questionWidget->setVisible(sectionIndex == currentSectionIndex); |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | void QmitkForm::UpdateFormButtons() |
| 283 | { |