-
Notifications
You must be signed in to change notification settings - Fork 0
/
clickableimagelabel.h
61 lines (40 loc) · 1.18 KB
/
clickableimagelabel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef CLICKABLEIMAGELABEL_H
#define CLICKABLEIMAGELABEL_H
#include <QLabel>
#include <QImage>
#include <QMouseEvent>
#include <QDialog>
#include <QVBoxLayout>
#include <QLabel>
class ClickableImageLabel : public QLabel {
Q_OBJECT
public:
QImage* OriginalImage;
QString* pToOriginalFilePath;
explicit ClickableImageLabel(QWidget* parent = nullptr);
~ClickableImageLabel() override;
void loadImage(const QString& imagePath);
void SetImage(QImage* Img);
private:
bool OwnsImage;
protected:
void contextMenuEvent(QContextMenuEvent* event) override;
void mousePressEvent(QMouseEvent* event) override;
void dragEnterEvent(QDragEnterEvent* event) override;
void dropEvent(QDropEvent* event) override;
signals:
void OnMenuOpen(QMenu* InMenu);
void SendImageToInpaint(QImage* Img);
void SendImageToImg2Img(QImage* Img);
void SendImageToUpscale(QImage* Img);
private slots:
void showInFolder();
void OnClickSendToImg2Img();
void OnClickSendToInpaint();
void OnClickSendToUpscale();
private:
QAction* actSendToInpaint;
QAction* actSendToImg2Img;
QAction* actSendToUpscale;
};
#endif // CLICKABLEIMAGELABEL_H