-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmycanvas.h
55 lines (43 loc) · 1.26 KB
/
mycanvas.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
#ifndef MYCANVAS_H
#define MYCANVAS_H
#include <QWidget>
#include <QGridLayout>
#include "slidepage.h"
#include "graph_view.h"
#include "graph_implement.h"
class MyCanvas : public QWidget
{
Q_OBJECT
private:
QString canvasName;
QString canvasDescription;
SlidePage *settings;
//For display
MyGraphicsView *view;
QHBoxLayout *mainLayout;
QWidget *infoWidget;
QLabel *pageName;
AbstractGraph *g;
int structure_type;
int type;
bool generateForest = false;
void CreateSettings(int r);
void Init();
void SaveToFile(const QString &path);
public:
enum { UDG = AbstractGraph::UDG, DG = AbstractGraph::DG };
enum { AL = 128, AML = 256 };
explicit MyCanvas(int radius, QString name = "", QString desc = "", int structure = AL, int _type = UDG, QWidget *parent = nullptr);
MyCanvas(QTextStream &ts, int radius, QWidget *parent = nullptr);
QString name(){return canvasName;}
QString description(){return canvasDescription;}
SlidePage *settingPage(){return settings;}
signals:
void nameChanged(QString name);
void descChanged(QString desc);
void setDel(MyCanvas* target);
private slots:
void addVex(MyGraphicsVexItem*);
void addArc(MyGraphicsLineItem*);
};
#endif // MYCANVAS_H