forked from magnocube/POV-Globe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
customimage.h
50 lines (37 loc) · 990 Bytes
/
customimage.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
#ifndef CUSTOMIMAGE_H
#define CUSTOMIMAGE_H
#include <QGraphicsObject>
#include <QPainter>
#include <QDateTime>
#include <QMessageBox>
#include "customimage_editor.h"
#include <QDebug>
class CustomImage : public QGraphicsObject
{
Q_OBJECT
public:
CustomImage();
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
void resize(int w, int h);
void setImage(QImage image);
private:
int x_location;
int y_location;
int width;
int height;
QColor color;
int rotation;
QColor lineColor;
int lineThickness;
int borderRadius;
QImage originalImage;
QImage resisedImage;
signals:
void updateGraphics();
public slots:
void newProperties(int width, int height, int lineThichness, int rotation, QColor backColor, QColor lineColor, int borderRadius);
protected:
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *e);
};
#endif // CUSTOMIMAGE_H