ctkDICOMThumbnailWidget.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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.commontk.org/LICENSE
  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 __ctkDICOMThumbnailWidget_h
  15. #define __ctkDICOMThumbnailWidget_h
  16. // Qt includes
  17. #include <QWidget>
  18. #include "ctkDICOMWidgetsExport.h"
  19. class ctkDICOMThumbnailWidgetPrivate;
  20. class CTK_DICOM_WIDGETS_EXPORT ctkDICOMThumbnailWidget : public QWidget
  21. {
  22. Q_OBJECT
  23. Q_PROPERTY(QString text READ text WRITE setText)
  24. Q_PROPERTY(QPixmap pixmap READ pixmap WRITE setPixmap)
  25. public:
  26. typedef QWidget Superclass;
  27. explicit ctkDICOMThumbnailWidget(QWidget* parent=0);
  28. virtual ~ctkDICOMThumbnailWidget();
  29. void setText(const QString& text);
  30. QString text()const;
  31. void setPixmap(const QPixmap& pixmap);
  32. const QPixmap* pixmap()const;
  33. void setSelected(bool selected);
  34. bool isSelected();
  35. protected:
  36. QScopedPointer<ctkDICOMThumbnailWidgetPrivate> d_ptr;
  37. virtual void mousePressEvent(QMouseEvent* event);
  38. private:
  39. Q_DECLARE_PRIVATE(ctkDICOMThumbnailWidget);
  40. Q_DISABLE_COPY(ctkDICOMThumbnailWidget);
  41. signals:
  42. void selected(const ctkDICOMThumbnailWidget& widget);
  43. };
  44. #endif