-
Notifications
You must be signed in to change notification settings - Fork 0
/
ERGraphicsView.h
57 lines (50 loc) · 1.16 KB
/
ERGraphicsView.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
#ifndef ERGRAPHICSVIEW_H
#define ERGRAPHICSVIEW_H
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QMenu>
#include<QContextMenuEvent>
#include <QAction>
#include <QDebug>
#include <EREnums.h>
/**
* @brief The ERGraphicsView class
* описывает холст для ER модели
*/
class ERGraphicsView: public QGraphicsView
{
Q_OBJECT
public:
ERGraphicsView(QGraphicsView * parent = 0);
/**
* @brief initView
* устанавливает параметры холста
*/
void initView();
/**
* @brief initMenu
* устанавливает меню на холст
*/
void initMenu();
/**
* @brief contextMenuEvent
* активирует контекстное меню
*/
void contextMenuEvent(QContextMenuEvent *event);
QGraphicsScene * getScene() const;
/**
* @brief wheelEvent
* масштабирует сцену
*/
void wheelEvent(QWheelEvent *event);
private:
QGraphicsScene * scene;
QMenu * topMenu;
QMenu * createSubMenu;
signals:
void doCreation(int type);
void doRelationOperation(int type);
public slots:
void whatCreate(QAction* action);
};
#endif // ERGRAPHICSVIEW_H