ctkDICOMTableView.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 CTKDICOMTABLEVIEW_H
  15. #define CTKDICOMTABLEVIEW_H
  16. #include "ctkDICOMWidgetsExport.h"
  17. // ctkDICOMCore includes
  18. #include "ctkDICOMDatabase.h"
  19. // Qt includes
  20. #include <QWidget>
  21. #include <QItemSelection>
  22. class ctkDICOMTableViewPrivate;
  23. /// \ingroup DICOM_Widgets
  24. class CTK_DICOM_WIDGETS_EXPORT ctkDICOMTableView : public QWidget
  25. {
  26. Q_OBJECT
  27. public:
  28. typedef QWidget Superclass;
  29. explicit ctkDICOMTableView(QWidget* parent = 0, QString queryTableName = "Patients");
  30. ctkDICOMTableView (QSharedPointer<ctkDICOMDatabase> ctkDicomDataBase, QWidget* parent = 0, QString queryTableName = "Patients");
  31. virtual ~ctkDICOMTableView();
  32. void setCTKDicomDataBase(QSharedPointer<ctkDICOMDatabase> dicomDataBase);
  33. // Settings for querying the database
  34. void setQueryTableName(const QString &tableName);
  35. void setQueryForeignKey(const QString &foreignKey);
  36. void setQueryPrimaryKey(const QString &primaryKey);
  37. public Q_SLOTS:
  38. void onSelectionChanged();
  39. void onUpdateQuery(const QStringList &uids);
  40. protected Q_SLOTS:
  41. void onDatabaseChanged();
  42. void onFilterChanged();
  43. Q_SIGNALS:
  44. void signalSelectionChanged(const QStringList &uids);
  45. void signalFilterChanged(const QStringList &uids);
  46. void signalQueryChanged(const QStringList &uids);
  47. protected:
  48. QScopedPointer<ctkDICOMTableViewPrivate> d_ptr;
  49. private:
  50. QStringList getUIDsForAllRows();
  51. Q_DECLARE_PRIVATE(ctkDICOMTableView)
  52. Q_DISABLE_COPY(ctkDICOMTableView)
  53. };
  54. #endif // CTKDICOMTABLEVIEW_H