Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkShortAnswerQuestionWidget.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkShortAnswerQuestionWidget_h
14 #define QmitkShortAnswerQuestionWidget_h
15 
16 #include <QmitkQuestionWidget.h>
18 
19 class QLineEdit;
20 
28 {
29  Q_OBJECT
30 
31 public:
36  explicit QmitkShortAnswerQuestionWidget(QWidget* parent = nullptr);
37 
41 
47  QmitkQuestionWidget* CreateAnother(QWidget* parent = nullptr) const override;
48 
54 
60  void SetQuestion(mitk::Forms::Question* question) override;
61 
64  void Reset() override;
65 
66 private:
67  void OnTextEdited(const QString& text);
68 
70 
71  QVBoxLayout* m_Layout;
72  QLineEdit* m_LineEdit;
73 };
74 
75 #endif
#define MITKFORMSUI_EXPORT
Abstract base class for all types of question widgets used in a QmitkForm.
Question widget for ShortAnswerQuestion, displaying a single-line text input.
mitk::Forms::Question * GetQuestion() const override
Get the associated ShortAnswerQuestion.
void Reset() override
Clear the line edit and reset all responses.
void SetQuestion(mitk::Forms::Question *question) override
Initialize the widget for a ShortAnswerQuestion.
QmitkShortAnswerQuestionWidget(QWidget *parent=nullptr)
Construct the widget.
QmitkQuestionWidget * CreateAnother(QWidget *parent=nullptr) const override
Create a new QmitkShortAnswerQuestionWidget instance.
~QmitkShortAnswerQuestionWidget() override
Destructor.
Abstract base class for all types of questions used in a Form.
Definition: mitkQuestion.h:38
A Question whose possible response is a short single-line free text.