-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathimagepopup.h
46 lines (35 loc) · 887 Bytes
/
imagepopup.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
#ifndef IMAGEPOPUP_H
#define IMAGEPOPUP_H
#include "libda_global.h"
#include <DLabel>
#include <DDialogCloseButton>
#include <QDialog>
DWIDGET_USE_NAMESPACE
LDA_BEGIN_NAMESPACE
/**
* @brief ImagePopup class is like the image viewer of Deepin Manual, show an image in FS.
*/
class LIBDA_SHARED_EXPORT ImagePopup : public QDialog
{
Q_OBJECT
public:
explicit ImagePopup(QWidget *parent = nullptr);
~ImagePopup() override;
public slots:
/**
* @brief Open/Show/Popup the image on the screen to let the user see it
* @param image
*/
void open(QImage &image);
protected:
void mousePressEvent(QMouseEvent *event) override;
void paintEvent(QPaintEvent *event) override;
private:
void init();
DLabel *img = nullptr;
DDialogCloseButton *close;
QImage data;
using QDialog::open;
};
LDA_END_NAMESPACE
#endif // IMAGEPOPUP_H