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 
53 
54  Q_ENUMS(DisplayDensity)
60  Q_PROPERTY(ctkDICOMTableManager::DisplayDensity displayDensity READ displayDensity WRITE setDisplayDensity);
61 
62 public:
63  typedef QWidget Superclass;
64 
65  explicit ctkDICOMTableManager(QWidget* parent = 0);
66  ctkDICOMTableManager(ctkDICOMDatabase* db, QWidget* parent = 0);
68 
73  Q_INVOKABLE void setDICOMDatabase(ctkDICOMDatabase* db);
74 
75  void setTableOrientation(const Qt::Orientation&) const;
76  Qt::Orientation tableOrientation();
77 
82  Q_INVOKABLE QStringList currentPatientsSelection();
83  Q_INVOKABLE QStringList currentStudiesSelection();
84  Q_INVOKABLE QStringList currentSeriesSelection();
85 
87  bool dynamicTableLayout() const;
88 
89  Q_INVOKABLE void updateTableViews();
90 
92  {
93  Compact = 0,
94  Cozy = 1,
95  Comfortable = 2
96  };
97 
100 
104 
105 
106 public Q_SLOTS:
107 
108  void onPatientsQueryChanged(const QStringList&);
109  void onStudiesQueryChanged(const QStringList&);
110  void onPatientsSelectionChanged(const QStringList&);
111  void onStudiesSelectionChanged(const QStringList&);
112 
113 Q_SIGNALS:
115  void patientsSelectionChanged(const QItemSelection&, const QItemSelection&);
116  void studiesSelectionChanged(const QItemSelection&, const QItemSelection&);
117  void seriesSelectionChanged(const QItemSelection&, const QItemSelection&);
118 
119  void patientsSelectionChanged(const QStringList &uids);
120  void studiesSelectionChanged(const QStringList &uids);
121  void seriesSelectionChanged(const QStringList &uids);
122 
123  void patientsDoubleClicked( const QModelIndex&);
124  void studiesDoubleClicked( const QModelIndex&);
125  void seriesDoubleClicked(const QModelIndex&);
126 
127  // signals to propagate the context menu requests from
128  // the individual tables
129  void patientsRightClicked(const QPoint&);
130  void studiesRightClicked(const QPoint&);
131  void seriesRightClicked(const QPoint&);
132 
133 
134 protected:
135 
136  virtual void resizeEvent(QResizeEvent *);
137 
138  QScopedPointer<ctkDICOMTableManagerPrivate> d_ptr;
139 
140 private:
141 
142  Q_DECLARE_PRIVATE(ctkDICOMTableManager)
143  Q_DISABLE_COPY(ctkDICOMTableManager)
144 };
145 
146 #endif // __ctkDICOMTableManager_h
void setTableOrientation(const Qt::Orientation &) const
void seriesRightClicked(const QPoint &)
virtual ~ctkDICOMTableManager()
void patientsRightClicked(const QPoint &)
void studiesRightClicked(const QPoint &)
void onPatientsQueryChanged(const QStringList &)
Q_INVOKABLE QStringList currentPatientsSelection()
Get the current selection of the dicomTableViews.
ctkDICOMTableManager(ctkDICOMDatabase *db, QWidget *parent=0)
void patientsSelectionChanged(const QStringList &uids)
QScopedPointer< ctkDICOMTableManagerPrivate > d_ptr
Q_INVOKABLE QStringList currentSeriesSelection()
void studiesSelectionChanged(const QItemSelection &, const QItemSelection &)
void setDynamicTableLayout(bool)
ctkDICOMTableManager(QWidget *parent=0)
Qt::Orientation tableOrientation()
void patientsSelectionChanged(const QItemSelection &, const QItemSelection &)
Signals for propagating selection changes of the different tables.
void setDisplayDensity(DisplayDensity density)
void onStudiesQueryChanged(const QStringList &)
void seriesSelectionChanged(const QItemSelection &, const QItemSelection &)
Q_INVOKABLE ctkDICOMTableView * patientsTable()
void seriesDoubleClicked(const QModelIndex &)
void seriesSelectionChanged(const QStringList &uids)
Q_INVOKABLE ctkDICOMTableView * seriesTable()
virtual void resizeEvent(QResizeEvent *)
void onStudiesSelectionChanged(const QStringList &)
DisplayDensity displayDensity()
Q_INVOKABLE ctkDICOMTableView * studiesTable()
Q_INVOKABLE void updateTableViews()
bool dynamicTableLayout() const
Q_INVOKABLE void setDICOMDatabase(ctkDICOMDatabase *db)
Set the ctkDICOMDatabase.
Q_INVOKABLE QStringList currentStudiesSelection()
void studiesDoubleClicked(const QModelIndex &)
void patientsDoubleClicked(const QModelIndex &)
void studiesSelectionChanged(const QStringList &uids)
void onPatientsSelectionChanged(const QStringList &)
The ctkDICOMTableView displays the content of a specific table of the ctkDICOMDatabase.