Fraxinus  22.04
An IGT application
cxOptionsWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXOPTIONSWIDGET_H_
13 #define CXOPTIONSWIDGET_H_
14 
15 #include "cxResourceWidgetsExport.h"
16 
17 #include <QStackedLayout>
18 #include "cxProperty.h"
20 
21 namespace cx {
22 
31 class cxResourceWidgets_EXPORT OptionsWidget : public QWidget
32 {
33  Q_OBJECT
34 public:
35  OptionsWidget(ViewServicePtr viewService, PatientModelServicePtr patientModelService, QWidget* parent);
36 
41  void setOptions(QString uid, std::vector<PropertyPtr> options, bool showAdvanced);
42  void setOptions(QString uid, std::vector<SelectDataStringPropertyBasePtr> options, bool showAdvanced);
43  QString getCurrentUid();
44  void showAdvanced(bool show); //whether or not to display adapters marked as advanced
45  void rebuild();
46  bool hasOptions() const;
47  bool hasAdvancedOptions() const;
48 
49 public slots:
50  void toggleAdvanced();
51 
52 private:
53  void clear();
54  void populate(bool showAdvanced);
55  QWidget* createGroupHeaderWidget(QString title);
56 
57  QStackedLayout* mStackedLayout;
58  std::vector<PropertyPtr> mOptions;
59  QString mUid;
60  bool mShowAdvanced;
61  ViewServicePtr mViewService;
62  PatientModelServicePtr mPatientModelService;
63 };
64 } /* namespace cx */
65 #endif /* CXOPTIONSWIDGET_H_ */
boost::shared_ptr< class ViewService > ViewServicePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Namespace for all CustusX production code.