CustusX  22.04-rc5
An IGT application
cxDataSelectWidget.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 #ifndef CXDATASELECTWIDGET_H
12 #define CXDATASELECTWIDGET_H
13 
14 #include "cxResourceWidgetsExport.h"
15 
16 #include "boost/shared_ptr.hpp"
17 #include "cxBaseWidget.h"
18 #include <QMouseEvent>
19 
20 
21 namespace cx
22 {
23 typedef boost::shared_ptr<class ViewGroupData> ViewGroupDataPtr;
24 typedef boost::shared_ptr<class SelectDataStringPropertyBase> SelectDataStringPropertyBasePtr;
25 typedef boost::shared_ptr<class ViewService> ViewServicePtr;
26 class EraseDataToolButton;
27 
38 class cxResourceWidgets_EXPORT DataSelectWidget : public BaseWidget
39 {
40  Q_OBJECT
41 public:
42  DataSelectWidget(ViewServicePtr viewService, PatientModelServicePtr patientModelService, QWidget* parent, SelectDataStringPropertyBasePtr data, QGridLayout* gridLayout = NULL, int row=0);
44 
45 private slots:
46  void toggleShowData();
47  void updateDataVisibility();
48  void viewGroupChangedSlot();
49 private:
50  void eraseData();
51  void setShowIcon();
52  ViewGroupDataPtr getActiveViewGroupData();
53  SelectDataStringPropertyBasePtr mData;
54  ViewGroupDataPtr mCurrentViewGroupData;
55  QAction* mToggleShowAction;
56  EraseDataToolButton* mRemoveButton;
57  ViewServicePtr mViewService;
58  PatientModelServicePtr mPatientModelService;
59 };
60 
64 
72 class cxResourceWidgets_EXPORT EraseDataToolButton : public CXSmallToolButton
73 {
74  Q_OBJECT
75 public:
76  EraseDataToolButton(QWidget* parent);
77  void reset();
78 signals:
79  void eraseData();
80 private:
81  void cancelRemovalSlot();
82  void setRemoveIcon();
83  void requestEraseData();
84  void mousePressEvent(QMouseEvent* e);
85  QAction* mRemoveAction;
86 };
87 
88 } // namespace cx
89 
90 #endif // CXDATASELECTWIDGET_H
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Definition: cxViewGroup.h:29
boost::shared_ptr< class ViewService > ViewServicePtr
boost::shared_ptr< class SelectDataStringPropertyBase > SelectDataStringPropertyBasePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:88
Namespace for all CustusX production code.