Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkForm.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 QmitkForm_h
14 #define QmitkForm_h
15 
16 #include <mitkForm.h>
17 
18 #include <MitkFormsUIExports.h>
19 
20 #include <QWidget>
21 #include <memory>
22 
23 namespace Ui
24 {
25  class QmitkForm;
26 }
27 
39 class MITKFORMSUI_EXPORT QmitkForm : public QWidget
40 {
41  Q_OBJECT
42 
43 public:
50  explicit QmitkForm(QWidget* parent = nullptr);
51 
59  explicit QmitkForm(mitk::Forms::Form* form, QWidget* parent = nullptr);
60 
63  ~QmitkForm() override;
64 
70 
80 
85  fs::path GetResponsesPath() const;
86 
94  void SetResponsesPath(const fs::path& csvPath);
95 
96 signals:
100  void Submit();
101 
102 private:
103  void CreateQuestionWidgets();
104  bool ValidateCurrentSection();
105  void Reset();
106 
107  void Update();
108  void UpdateFormHeader();
109  void UpdateSubmittedHeader();
110  void UpdateSectionHeader();
111  void UpdateQuestionWidgets();
112  void UpdateFormButtons();
113 
114  void OnBackButtonClicked();
115  void OnNextButtonClicked();
116  void OnSubmitButtonClicked();
117  void OnClearButtonClicked();
118  void OnSubmitAnotherButtonClicked();
119 
120  std::unique_ptr<Ui::QmitkForm> m_Ui;
121  mitk::Forms::Form* m_Form;
122  fs::path m_ResponsesPath;
123  bool m_HasBeenSubmitted;
124 };
125 
126 #endif
#define MITKFORMSUI_EXPORT
Qt widget that renders and manages an interactive mitk::Forms::Form.
Definition: QmitkForm.h:40
fs::path GetResponsesPath() const
Get the path where form responses are saved.
void SetResponsesPath(const fs::path &csvPath)
Set the path where form responses will be saved.
mitk::Forms::Form * GetForm() const
Get the currently associated form.
void SetForm(mitk::Forms::Form *form)
Set the form to display.
QmitkForm(mitk::Forms::Form *form, QWidget *parent=nullptr)
Construct the widget and associate it with the given form.
void Submit()
Emitted when the user clicks the submit button and all required questions in the final section are va...
QmitkForm(QWidget *parent=nullptr)
Construct the widget without a form.
~QmitkForm() override
Destructor.
A form consisting of questions possibly divided into multiple sections/pages.
Definition: mitkForm.h:41