ctkDICOMObjectListWidget.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Brigham and Women's Hospital (BWH).
  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 __ctkDICOMObjectListWidget_h
  15. #define __ctkDICOMObjectListWidget_h
  16. // Qt includes
  17. #include <QItemSelection>
  18. #include <QWidget>
  19. #include "ctkDICOMWidgetsExport.h"
  20. class ctkDICOMObjectListWidgetPrivate;
  21. /// \ingroup DICOM_Widgets
  22. class CTK_DICOM_WIDGETS_EXPORT ctkDICOMObjectListWidget : public QWidget
  23. {
  24. Q_OBJECT
  25. Q_PROPERTY(QString currentFile READ currentFile WRITE setCurrentFile)
  26. Q_PROPERTY(QStringList fileList READ fileList WRITE setFileList)
  27. public:
  28. typedef QWidget Superclass;
  29. explicit ctkDICOMObjectListWidget(QWidget* parent=0);
  30. virtual ~ctkDICOMObjectListWidget();
  31. QString currentFile();
  32. QStringList fileList();
  33. /// Get metadata tree as plain text
  34. QString metadataAsText(bool allFiles = false);
  35. /// Open DICOM tag definition in a web browser
  36. void openLookupUrl(QString tag);
  37. protected:
  38. QScopedPointer<ctkDICOMObjectListWidgetPrivate> d_ptr;
  39. private:
  40. Q_DECLARE_PRIVATE(ctkDICOMObjectListWidget);
  41. Q_DISABLE_COPY(ctkDICOMObjectListWidget);
  42. Q_SIGNALS:
  43. void doubleClicked(const QModelIndex&);
  44. public Q_SLOTS:
  45. void setCurrentFile(const QString& newFileName);
  46. void setFileList(const QStringList& fileList);
  47. protected Q_SLOTS:
  48. void itemDoubleClicked(const QModelIndex&);
  49. void onFilterChanged();
  50. void updateWidget();
  51. void copyPath();
  52. void copyMetadata();
  53. void copyAllFilesMetadata();
  54. };
  55. #endif