ctkDICOMTableManager.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 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. public:
  34. typedef QWidget Superclass;
  35. explicit ctkDICOMTableManager(QWidget* parent = 0);
  36. ctkDICOMTableManager(ctkDICOMDatabase* db, QWidget* parent = 0);
  37. virtual ~ctkDICOMTableManager();
  38. /**
  39. * @brief Set the ctkDICOMDatabase
  40. * @param db the dicom database which should be used
  41. */
  42. void setCTKDICOMDatabase(ctkDICOMDatabase* db);
  43. void setTableOrientation(const Qt::Orientation&) const;
  44. Qt::Orientation tableOrientation();
  45. /**
  46. * @brief Get the current selection of the dicomTableViews
  47. * @return a list with the uids of the selected items
  48. */
  49. QStringList currentPatientsSelection();
  50. QStringList currentStudiesSelection();
  51. QStringList currentSeriesSelection();
  52. public Q_SLOTS:
  53. void onPatientsQueryChanged(const QStringList&);
  54. void onStudiesQueryChanged(const QStringList&);
  55. void onPatientsSelectionChanged(const QStringList&);
  56. void onStudiesSelectionChanged(const QStringList&);
  57. Q_SIGNALS:
  58. /// Signals for propagating selection changes of the different tables
  59. void patientsSelectionChanged(const QItemSelection&, const QItemSelection&);
  60. void studiesSelectionChanged(const QItemSelection&, const QItemSelection&);
  61. void seriesSelectionChanged(const QItemSelection&, const QItemSelection&);
  62. void patientsSelectionChanged(const QStringList &uids);
  63. void studiesSelectionChanged(const QStringList &uids);
  64. void seriesSelectionChanged(const QStringList &uids);
  65. void seriesDoubleClicked(const QModelIndex&);
  66. protected:
  67. QScopedPointer<ctkDICOMTableManagerPrivate> d_ptr;
  68. private:
  69. Q_DECLARE_PRIVATE(ctkDICOMTableManager)
  70. Q_DISABLE_COPY(ctkDICOMTableManager)
  71. };
  72. #endif // __ctkDICOMTableManager_h