NorMIT-nav  22.09
An IGT application
cxDataViewSelectionWidget.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 CXDATAVIEWSELECTIONWIDGET_H_
12 #define CXDATAVIEWSELECTIONWIDGET_H_
13 
14 #include "cxGuiExport.h"
15 
16 #include <QListWidget>
17 #include "cxForwardDeclarations.h"
18 class QLabel;
19 
20 namespace cx
21 {
31 class cxGui_EXPORT DataListWidget : public QListWidget
32 {
33  Q_OBJECT
34 
35 public:
36  DataListWidget(PatientModelServicePtr patientModelService, QWidget* parent = NULL);
37  virtual ~DataListWidget();
38  virtual QSize sizeHint() const;
39 
40 signals:
41  void userChangedList();
42  void listSizeChanged();
43 
44 protected:
45  void populate(QStringList dataUids);
46  void populateData(QString uid, bool indent=false, QListWidgetItem* after = NULL);
47 
49 
50 private slots:
51  void itemSelectionChangedSlot();
52 };
53 
54 //---------------------------------------------------------------------------------------------------------------------
55 
56 class cxGui_EXPORT AllDataListWidget : public DataListWidget
57 {
58  Q_OBJECT
59 
60 public:
61  AllDataListWidget(PatientModelServicePtr patientModelService, QWidget* parent = NULL);
62  virtual ~AllDataListWidget();
63 
64 protected:
65  void mousePressEvent(QMouseEvent *event);
66  void mouseMoveEvent(QMouseEvent *event);
67 
68 private slots:
69  void populateAllDataList();
70 
71 private:
72  QPoint startPos;
73 };
74 
75 //---------------------------------------------------------------------------------------------------------------------
76 
77 class cxGui_EXPORT SelectedDataListWidget : public DataListWidget
78 {
79  Q_OBJECT
80 
81 public:
82  SelectedDataListWidget(PatientModelServicePtr patientModelService, QWidget* parent = NULL);
83  virtual ~SelectedDataListWidget();
84  void setViewGroupData(ViewGroupDataPtr viewGroupData);
85 
86  virtual void dropEvent(QDropEvent* event);
87  QStringList getData();
88 
89 public slots:
90  void populateList();
91  void userChangedListSlot();
92 
93 private slots:
94  void deleteSlot();
95  void deleteItemSlot(QListWidgetItem* item);
96  void contextMenuSlot(const QPoint & point);
97  void keyPressEvent(QKeyEvent* event);
98 
99 protected:
100  QMap<int, QVariant> convertFromCustomQtMimeFormat(const QMimeData* mimeData) const;
101 
102 private:
103  QListWidgetItem* mItemToDelete;
104  ViewGroupDataPtr mViewGroupData;
105  QPoint startPos;
106 };
107 
112 class cxGui_EXPORT DataViewSelectionWidget : public QWidget
113 {
114  Q_OBJECT
115 public:
116  DataViewSelectionWidget(PatientModelServicePtr patientModelService, ViewServicePtr viewService, QWidget* parent = NULL);
117  virtual ~DataViewSelectionWidget();
118 
119 private slots:
120  void viewGroupChangedSlot();
121 
122 private:
123  SelectedDataListWidget* mSelectedDataListWidget;
124  AllDataListWidget* mAllDataListWidget;
125  QLabel* mVisibleLabel;
126  ViewServicePtr mViewService;
127 };
128 
132 }
133 
134 #endif /* CXDATAVIEWSELECTIONWIDGET_H_ */
cx::ViewGroupDataPtr
boost::shared_ptr< class ViewGroupData > ViewGroupDataPtr
Definition: cxViewGroup.h:29
cx::DataListWidget
Definition: cxDataViewSelectionWidget.h:31
cx
Namespace for all CustusX production code.
Definition: cx_dev_group_definitions.h:13
cxForwardDeclarations.h
cx::DataViewSelectionWidget
Definition: cxDataViewSelectionWidget.h:112
cx::AllDataListWidget
Definition: cxDataViewSelectionWidget.h:56
cx::PatientModelServicePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
Definition: cxLogicManager.h:25
cx::ViewServicePtr
boost::shared_ptr< class ViewService > ViewServicePtr
Definition: cxLogicManager.h:28
cx::SelectedDataListWidget
Definition: cxDataViewSelectionWidget.h:77
cx::DataListWidget::mPatientModelService
PatientModelServicePtr mPatientModelService
Definition: cxDataViewSelectionWidget.h:48