-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.h
46 lines (38 loc) · 1.04 KB
/
page.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 PAGE_H
#define PAGE_H
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QObject>
class Page : public QGraphicsScene
{
Q_OBJECT
Q_PROPERTY(QString Name READ GetName WRITE SetName)
Q_PROPERTY(QString Background READ GetBackground WRITE SetBackground)
public:
Page();
Page(QString Name, QString Background);
QString GetName();
void UpdateBackground();
void SetName(QString);
void SetBackground(QString);
QString GetBackground() {return m_background;}
QString Save();
void Refresh();
QPointF GetNewPosition(){ return m_newPos; }
static QGraphicsView *GenerateGraphicsView();
protected:
void drawBackground(QPainter *painter, const QRectF & );
private:
QString m_background;
QImage *m_backgroundImage;
QString m_name;
QPointF m_newPos;
int SCENE_HEIGHT;
int SCENE_WIDTH;
public slots:
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
void mousePressEvent(QGraphicsSceneMouseEvent *event);
signals:
void nameChanged(QString);
};
#endif // PAGE_H