Sayonara Player
ImageButton.h
1#ifndef IMAGEBUTTON_H
2#define IMAGEBUTTON_H
3
4#include <QPushButton>
5#include "Utils/Pimpl.h"
6
7class QPixmap;
8
9namespace Gui
10{
12 public QObject
13 {
14 Q_OBJECT
16
17 signals:
18 void sigFinished();
19
20 public:
21 ByteArrayConverter(const QByteArray& data, const QString& mime);
23
24 QPixmap pixmap() const;
25
26 public slots:
27 void start();
28 };
29
30
31 class ImageButton : public QPushButton
32 {
33 Q_OBJECT
34 PIMPL(ImageButton)
35
36 signals:
37 void sigPixmapChanged();
38 void sigTriggered();
39
40 public:
41 explicit ImageButton(QWidget* parent=nullptr);
42 ~ImageButton() override;
43
44 QPixmap pixmap() const;
45 int verticalPadding() const;
46 void setFadingEnabled(bool b);
47
48 public slots:
49 void showDefaultPixmap();
50 void setPixmap(const QPixmap& pm);
51 void setPixmapPath(const QString& path);
52 void setCoverData(const QByteArray& data, const QString& mimetype);
53
54 private slots:
55 void timerTimedOut();
56 void byteconverterFinished();
57
58 private:
59 using QPushButton::setIcon;
60 using QPushButton::icon;
61
62 protected:
63 void paintEvent(QPaintEvent* e) override;
64 void resizeEvent(QResizeEvent* e) override;
65 void mouseMoveEvent(QMouseEvent* e) override;
66 void mouseReleaseEvent(QMouseEvent* event) override;
67 };
68}
69
70#endif // IMAGEBUTTON_H
Definition: ImageButton.h:13
Definition: ImageButton.h:32