Label.h 395 B

1234567891011121314151617181920212223242526
  1. #ifndef LABEL_H
  2. #define LABEL_H
  3. #include <QLabel>
  4. class PixmapLabel : public QLabel
  5. {
  6. Q_OBJECT
  7. public:
  8. explicit PixmapLabel(QWidget *parent = nullptr);
  9. void setPixmap(const QPixmap &pixmap);
  10. QPixmap pixmap() const;
  11. // QWidget interface
  12. protected:
  13. virtual void paintEvent(QPaintEvent *event) override;
  14. signals:
  15. private:
  16. QPixmap m_pixmap;
  17. };
  18. #endif // LABEL_H