Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkDropdownQuestionWidget.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 QmitkDropdownQuestionWidget_h
14 #define QmitkDropdownQuestionWidget_h
15 
16 #include <QmitkQuestionWidget.h>
17 #include <mitkDropdownQuestion.h>
18 
19 class QComboBox;
20 
29 {
30  Q_OBJECT
31 
32 public:
37  explicit QmitkDropdownQuestionWidget(QWidget* parent = nullptr);
38 
42 
48  QmitkQuestionWidget* CreateAnother(QWidget* parent = nullptr) const override;
49 
55 
61  void SetQuestion(mitk::Forms::Question* question) override;
62 
65  void Reset() override;
66 
67 private:
68  void CreateWidgets();
69  void RemoveWidgets();
70 
71  void OnCurrentIndexChanged(int index);
72 
74 
75  QVBoxLayout* m_Layout;
76  QComboBox* m_ComboBox;
77 };
78 
79 #endif
#define MITKFORMSUI_EXPORT
Question widget for DropdownQuestion, displaying options in a QComboBox.
mitk::Forms::Question * GetQuestion() const override
Get the associated DropdownQuestion.
void Reset() override
Reset the combo box selection and clear all responses.
~QmitkDropdownQuestionWidget() override
Destructor.
QmitkDropdownQuestionWidget(QWidget *parent=nullptr)
Construct the widget.
QmitkQuestionWidget * CreateAnother(QWidget *parent=nullptr) const override
Create a new QmitkDropdownQuestionWidget instance.
void SetQuestion(mitk::Forms::Question *question) override
Initialize the widget for a DropdownQuestion.
Abstract base class for all types of question widgets used in a QmitkForm.
A Question whose possible responses are represented by a combo box.
Abstract base class for all types of questions used in a Form.
Definition: mitkQuestion.h:38