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

Method UpdateSectionHeader

Modules/FormsUI/src/QmitkForm.cpp:223–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223void 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
257void QmitkForm::UpdateQuestionWidgets()
258{

Callers 1

UpdateMethod · 0.95

Calls 4

emptyMethod · 0.45
GetTitleMethod · 0.45
setTextMethod · 0.45
GetDescriptionMethod · 0.45

Tested by

no test coverage detected