-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcapturer.h
65 lines (47 loc) · 1.33 KB
/
capturer.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
62
63
64
65
#ifndef CAPTURER_H
#define CAPTURER_H
#include <QImage>
#include <QQuickPaintedItem>
#include <QString>
class QPainter;
class QQuickItem;
class saveAbleImage : public QQuickPaintedItem
{
Q_OBJECT
Q_PROPERTY(QString source READ source WRITE setSource NOTIFY sourceChanged)
Q_PROPERTY(bool smooth READ smooth WRITE setSmooth NOTIFY smoothChanged)
Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged)
Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged)
public:
saveAbleImage(QQuickItem *parent = 0);
saveAbleImage(saveAbleImage const&);
saveAbleImage& operator=(saveAbleImage const&);
virtual void paint(QPainter *painter);
//properties of READ
int height() const;
bool smooth() const;
QString source() const;
int width() const;
//properties of READ
//properties of WRITE
void setHeight(int height);
void setSource(QString const &source);
void setSmooth(bool smooth);
void setWidth(int width);
//properties of WRITE
public slots:
void save(QString const &path) const;
signals:
void heightChanged();
void smoothChanged();
void sourceChanged();
void widthChanged();
private:
int height_;
QImage image_;
QImage imageBuffer_;
bool smooth_;
QString source_;
int width_;
};
#endif // CAPTURER_H