Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkCheckboxesQuestionWidget.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 QmitkCheckboxesQuestionWidget_h
14 #define QmitkCheckboxesQuestionWidget_h
15 
16 #include <QmitkQuestionWidget.h>
17 #include <mitkCheckboxesQuestion.h>
18 
19 class QButtonGroup;
20 class QGridLayout;
21 class QLineEdit;
22 
31 {
32  Q_OBJECT
33 
34 public:
39  explicit QmitkCheckboxesQuestionWidget(QWidget* parent = nullptr);
40 
44 
50  QmitkQuestionWidget* CreateAnother(QWidget* parent = nullptr) const override;
51 
57 
63  void SetQuestion(mitk::Forms::Question* question) override;
64 
67  void Reset() override;
68 
69 private:
70  void CreateWidgets();
71  void RemoveWidgets();
72 
73  void OnIdToggled(int id, bool checked);
74  void OnTextEdited(const QString& text);
75  void OnEditingFinished();
76 
78 
79  QGridLayout* m_Layout;
80  QButtonGroup* m_ButtonGroup;
81  QLineEdit* m_OtherLineEdit;
82  int m_OtherId;
83 };
84 
85 #endif
#define MITKFORMSUI_EXPORT
Question widget for CheckboxesQuestion, displaying checkboxes with an optional "Other" field.
~QmitkCheckboxesQuestionWidget() override
Destructor.
QmitkCheckboxesQuestionWidget(QWidget *parent=nullptr)
Construct the widget.
QmitkQuestionWidget * CreateAnother(QWidget *parent=nullptr) const override
Create a new QmitkCheckboxesQuestionWidget instance.
void SetQuestion(mitk::Forms::Question *question) override
Initialize the widget for a CheckboxesQuestion.
mitk::Forms::Question * GetQuestion() const override
Get the associated CheckboxesQuestion.
void Reset() override
Uncheck all checkboxes, clear the "Other" text, and reset all responses.
Abstract base class for all types of question widgets used in a QmitkForm.
A Question whose possible responses are represented by checkboxes.
Abstract base class for all types of questions used in a Form.
Definition: mitkQuestion.h:38