Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkShortAnswerQuestionWidget Class Reference

Question widget for ShortAnswerQuestion, displaying a single-line text input. More...

#include <QmitkShortAnswerQuestionWidget.h>

Inheritance diagram for QmitkShortAnswerQuestionWidget:
Collaboration diagram for QmitkShortAnswerQuestionWidget:

Public Member Functions

 QmitkShortAnswerQuestionWidget (QWidget *parent=nullptr)
 Construct the widget. More...
 
 ~QmitkShortAnswerQuestionWidget () override
 Destructor. More...
 
QmitkQuestionWidget * CreateAnother (QWidget *parent=nullptr) const override
 Create a new QmitkShortAnswerQuestionWidget instance. More...
 
mitk::Forms::Question * GetQuestion () const override
 Get the associated ShortAnswerQuestion. More...
 
void SetQuestion (mitk::Forms::Question *question) override
 Initialize the widget for a ShortAnswerQuestion. More...
 
void Reset () override
 Clear the line edit and reset all responses. More...
 
- Public Member Functions inherited from QmitkQuestionWidget
 QmitkQuestionWidget (QWidget *parent=nullptr)
 Construct the question widget with common GUI elements. More...
 
 ~QmitkQuestionWidget () override
 Destructor. More...
 
void SetRequirementVisible (bool visible)
 Show or hide the requirement reminder. More...
 
void ShowRequirement ()
 Show the requirement reminder label and highlight the widget border in red. More...
 
void HideRequirement ()
 Hide the requirement reminder label and reset the widget border style. More...
 

Additional Inherited Members

- Protected Member Functions inherited from QmitkQuestionWidget
void InsertLayout (QLayout *layout)
 Insert a layout containing all GUI elements specific to the derived question widget type. More...
 

Detailed Description

Question widget for ShortAnswerQuestion, displaying a single-line text input.

The widget uses a QLineEdit with a "Your answer" placeholder text.

See also
mitk::Forms::ShortAnswerQuestion, QmitkQuestionWidget

Definition at line 27 of file QmitkShortAnswerQuestionWidget.h.

Constructor & Destructor Documentation

◆ QmitkShortAnswerQuestionWidget()

QmitkShortAnswerQuestionWidget::QmitkShortAnswerQuestionWidget ( QWidget *  parent = nullptr)
explicit

Construct the widget.

Parameters
[in]parentThe parent widget.

◆ ~QmitkShortAnswerQuestionWidget()

QmitkShortAnswerQuestionWidget::~QmitkShortAnswerQuestionWidget ( )
override

Destructor.

Member Function Documentation

◆ CreateAnother()

QmitkQuestionWidget* QmitkShortAnswerQuestionWidget::CreateAnother ( QWidget *  parent = nullptr) const
overridevirtual

Create a new QmitkShortAnswerQuestionWidget instance.

Parameters
[in]parentThe parent widget.
Returns
A pointer to the new widget. The caller takes ownership.

Implements QmitkQuestionWidget.

◆ GetQuestion()

mitk::Forms::Question* QmitkShortAnswerQuestionWidget::GetQuestion ( ) const
overridevirtual

Get the associated ShortAnswerQuestion.

Returns
A pointer to the ShortAnswerQuestion, or nullptr if not set.

Implements QmitkQuestionWidget.

◆ Reset()

void QmitkShortAnswerQuestionWidget::Reset ( )
overridevirtual

Clear the line edit and reset all responses.

Implements QmitkQuestionWidget.

◆ SetQuestion()

void QmitkShortAnswerQuestionWidget::SetQuestion ( mitk::Forms::Question *  question)
overridevirtual

Initialize the widget for a ShortAnswerQuestion.

Parameters
[in]questionMust be a ShortAnswerQuestion. The widget does not take ownership.
Exceptions
mitk::ExceptionIf question is not a ShortAnswerQuestion.

Implements QmitkQuestionWidget.


The documentation for this class was generated from the following file: