ctkDICOMTableManager.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0.txt
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkDICOMTableManager_h
  15. #define __ctkDICOMTableManager_h
  16. #include "ctkDICOMWidgetsExport.h"
  17. #include "ctkDICOMDatabase.h"
  18. // Qt includes
  19. #include <QWidget>
  20. #include <QSharedPointer>
  21. class ctkDICOMTableManagerPrivate;
  22. class ctkDICOMDatabase;
  23. class QItemSelection;
  24. class QModelIndex;
  25. /// \ingroup DICOM_Widgets
  26. class CTK_DICOM_WIDGETS_EXPORT ctkDICOMTableManager : public QWidget
  27. {
  28. Q_OBJECT
  29. /**
  30. * Property for setting the table layout either to vertical or horizontal alignment
  31. */
  32. Q_PROPERTY(Qt::Orientation tableOrientation READ tableOrientation WRITE setTableOrientation)
  33. Q_PROPERTY(bool m_DynamicLayout WRITE setDynamicTableLayout)
  34. public:
  35. typedef QWidget Superclass;
  36. explicit ctkDICOMTableManager(QWidget* parent = 0);
  37. ctkDICOMTableManager(ctkDICOMDatabase* db, QWidget* parent = 0);
  38. virtual ~ctkDICOMTableManager();
  39. /**
  40. * @brief Set the ctkDICOMDatabase
  41. * @param db the dicom database which should be used
  42. */
  43. void setCTKDICOMDatabase(ctkDICOMDatabase* db);
  44. void setTableOrientation(const Qt::Orientation&) const;
  45. Qt::Orientation tableOrientation();
  46. /**
  47. * @brief Get the current selection of the dicomTableViews
  48. * @return a list with the uids of the selected items
  49. */
  50. QStringList currentPatientsSelection();
  51. QStringList currentStudiesSelection();
  52. QStringList currentSeriesSelection();
  53. void setDynamicTableLayout(bool);
  54. public Q_SLOTS:
  55. void onPatientsQueryChanged(const QStringList&);
  56. void onStudiesQueryChanged(const QStringList&);
  57. void onPatientsSelectionChanged(const QStringList&);
  58. void onStudiesSelectionChanged(const QStringList&);
  59. Q_SIGNALS:
  60. /// Signals for propagating selection changes of the different tables
  61. void patientsSelectionChanged(const QItemSelection&, const QItemSelection&);
  62. void studiesSelectionChanged(const QItemSelection&, const QItemSelection&);
  63. void seriesSelectionChanged(const QItemSelection&, const QItemSelection&);
  64. void patientsSelectionChanged(const QStringList &uids);
  65. void studiesSelectionChanged(const QStringList &uids);
  66. void seriesSelectionChanged(const QStringList &uids);
  67. void seriesDoubleClicked(const QModelIndex&);
  68. protected:
  69. QScopedPointer<ctkDICOMTableManagerPrivate> d_ptr;
  70. private:
  71. void resizeEvent(QResizeEvent *);
  72. bool m_DynamicLayout;
  73. Q_DECLARE_PRIVATE(ctkDICOMTableManager)
  74. Q_DISABLE_COPY(ctkDICOMTableManager)
  75. };
  76. #endif // __ctkDICOMTableManager_h