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

Method SetQuestion

Modules/FormsUI/src/QmitkQuestionWidget.cpp:43–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43void QmitkQuestionWidget::SetQuestion(mitk::Forms::Question* question)
44{
45 if (question == nullptr)
46 mitkThrow() << "Invalid question: cannot be nullptr!";
47
48 auto text = QString::fromStdString(question->GetQuestionText());
49
50 if (question->IsRequired())
51 {
52 if (!text.isEmpty())
53 text.append(' ');
54
55 text.append("<span style=\"color: red;\">*</span>");
56 }
57
58 m_QuestionLabel->setText(QString("<h4>%1</h4>").arg(text));
59 m_RequiredLabel->setText(QString("<span style=\"color: red;\">%1</span>").arg(QString::fromStdString(question->GetRequiredText())));
60}
61
62void QmitkQuestionWidget::Reset()
63{

Callers 1

CreateMethod · 0.45

Calls 5

GetQuestionTextMethod · 0.80
IsRequiredMethod · 0.80
GetRequiredTextMethod · 0.80
QStringClass · 0.50
setTextMethod · 0.45

Tested by

no test coverage detected