Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkPipInstallAdvancedDialog.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 QmitkPipInstallAdvancedDialog_h
14 #define QmitkPipInstallAdvancedDialog_h
15 
17 
18 #include <mitkPipPackageInfo.h>
19 
20 #include <QDialog>
21 #include <vector>
22 
23 class QCheckBox;
24 class QGroupBox;
25 class QLineEdit;
26 class QPlainTextEdit;
27 class QVBoxLayout;
28 
38 {
39  Q_OBJECT
40 
41 public:
42  explicit QmitkPipInstallAdvancedDialog(const mitk::PipInstallSpec& spec, QWidget* parent = nullptr);
43 
46 
47 private slots:
48  void OnAddGroup();
49  void OnRemoveGroup();
50  void OnAddStep();
51  void OnRemoveStep();
52  void OnLoadSpec();
53  void OnSaveSpec();
54 
55 private:
56  struct GroupWidgets
57  {
58  QPlainTextEdit* requirements;
59  QLineEdit* indexUrl;
60  QLineEdit* extraPipArgs;
61  };
62 
63  struct StepWidgets
64  {
65  QLineEdit* displayName;
66  QPlainTextEdit* pythonCode;
67  QCheckBox* optionalCheckBox;
68  };
69 
70  QGroupBox* CreateGroupWidget(const mitk::PipInstallGroup& group, int index);
71  QGroupBox* CreateStepWidget(const mitk::PostInstallStep& step, int index);
72  void RenumberGroupTitles();
73  void RenumberStepTitles();
74  void RebuildFromSpec(const mitk::PipInstallSpec& spec);
75 
76  QLineEdit* m_NameEdit = nullptr;
77  QLineEdit* m_VenvNameEdit = nullptr;
78  QCheckBox* m_UpgradePipFirstCheckBox = nullptr;
79 
80  QVBoxLayout* m_GroupsLayout = nullptr;
81  QVBoxLayout* m_StepsLayout = nullptr;
82 
83  std::vector<GroupWidgets> m_GroupWidgets;
84  std::vector<QGroupBox*> m_GroupBoxes;
85 
86  std::vector<StepWidgets> m_StepWidgets;
87  std::vector<QGroupBox*> m_StepBoxes;
88 };
89 
90 #endif
#define MITKPYTHONINSTALLERUI_EXPORT
Dialog for editing a PipInstallSpec before installation.
mitk::PipInstallSpec GetInstallSpec() const
Return the edited install spec. Only meaningful after Accepted.
QmitkPipInstallAdvancedDialog(const mitk::PipInstallSpec &spec, QWidget *parent=nullptr)
A set of packages that share the same pip options.
Full specification for a pip installation run.
A Python command to run in the activated venv after pip install.