| 41 | } |
| 42 | |
| 43 | void 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 | |
| 62 | void QmitkQuestionWidget::Reset() |
| 63 | { |
no test coverage detected