CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkDICOMTableManager.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0.txt
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 
21 #ifndef __ctkDICOMTableManager_h
22 #define __ctkDICOMTableManager_h
23 
24 #include "ctkDICOMWidgetsExport.h"
25 #include "ctkDICOMDatabase.h"
26 
27 // Qt includes
28 #include <QWidget>
29 #include <QSharedPointer>
30 
31 class ctkDICOMTableManagerPrivate;
32 class ctkDICOMDatabase;
33 class ctkDICOMTableView;
34 class QItemSelection;
35 class QModelIndex;
36 
38 
39 class CTK_DICOM_WIDGETS_EXPORT ctkDICOMTableManager : public QWidget
40 {
41  Q_OBJECT
42 
46  Q_PROPERTY(Qt::Orientation tableOrientation READ tableOrientation WRITE setTableOrientation)
51  Q_PROPERTY(bool dynamicTableLayout READ dynamicTableLayout WRITE setDynamicTableLayout)
52 
56  Q_PROPERTY( ctkDICOMTableView* patientsTable READ patientsTable )
57  Q_PROPERTY( ctkDICOMTableView* studiesTable READ studiesTable )
58  Q_PROPERTY( ctkDICOMTableView* seriesTable READ seriesTable )
59 
60  Q_ENUMS(DisplayDensity)
66  Q_PROPERTY(ctkDICOMTableManager::DisplayDensity displayDensity READ displayDensity WRITE setDisplayDensity);
67 
68 public:
69  typedef QWidget Superclass;
70 
71  explicit ctkDICOMTableManager(QWidget* parent = 0);
72  ctkDICOMTableManager(ctkDICOMDatabase* db, QWidget* parent = 0);
73  virtual ~ctkDICOMTableManager();
74 
79  void setDICOMDatabase(ctkDICOMDatabase* db);
80 
81  void setTableOrientation(const Qt::Orientation&) const;
82  Qt::Orientation tableOrientation();
83 
88  QStringList currentPatientsSelection();
89  QStringList currentStudiesSelection();
90  QStringList currentSeriesSelection();
91 
92  void setDynamicTableLayout(bool);
93  bool dynamicTableLayout() const;
94 
95  void updateTableViews();
96 
98  {
99  Compact = 0,
100  Cozy = 1,
101  Comfortable = 2
102  };
103 
104  DisplayDensity displayDensity();
105  void setDisplayDensity(DisplayDensity density);
106 
107  ctkDICOMTableView* patientsTable();
108  ctkDICOMTableView* studiesTable();
109  ctkDICOMTableView* seriesTable();
110 
111 
112 public Q_SLOTS:
113 
114  void onPatientsQueryChanged(const QStringList&);
115  void onStudiesQueryChanged(const QStringList&);
116  void onPatientsSelectionChanged(const QStringList&);
117  void onStudiesSelectionChanged(const QStringList&);
118 
119 Q_SIGNALS:
121  void patientsSelectionChanged(const QItemSelection&, const QItemSelection&);
122  void studiesSelectionChanged(const QItemSelection&, const QItemSelection&);
123  void seriesSelectionChanged(const QItemSelection&, const QItemSelection&);
124 
125  void patientsSelectionChanged(const QStringList &uids);
126  void studiesSelectionChanged(const QStringList &uids);
127  void seriesSelectionChanged(const QStringList &uids);
128 
129  void patientsDoubleClicked( const QModelIndex&);
130  void studiesDoubleClicked( const QModelIndex&);
131  void seriesDoubleClicked(const QModelIndex&);
132 
133  // signals to propagate the context menu requests from
134  // the individual tables
135  void patientsRightClicked(const QPoint&);
136  void studiesRightClicked(const QPoint&);
137  void seriesRightClicked(const QPoint&);
138 
139 
140 protected:
141 
142  virtual void resizeEvent(QResizeEvent *);
143 
144  QScopedPointer<ctkDICOMTableManagerPrivate> d_ptr;
145 
146 private:
147 
148  Q_DECLARE_PRIVATE(ctkDICOMTableManager)
149  Q_DISABLE_COPY(ctkDICOMTableManager)
150 };
151 
152 #endif // __ctkDICOMTableManager_h
The ctkDICOMTableView displays the content of a specific table of the ctkDICOMDatabase.
QScopedPointer< ctkDICOMTableManagerPrivate > d_ptr