forked from paceholder/nodeeditor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
53 lines (39 loc) · 891 Bytes
/
main.cpp
File metadata and controls
53 lines (39 loc) · 891 Bytes
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
#include <nodes/GraphModel>
#include <nodes/GraphicsScene>
#include <nodes/GraphicsView>
#include <nodes/ConnectionStyle>
#include <QtWidgets/QApplication>
static
void
setStyle()
{
ConnectionStyle::setConnectionStyle(
R"(
{
"ConnectionStyle": {
"ConstructionColor": "gray",
"NormalColor": "black",
"SelectedColor": "gray",
"SelectedHaloColor": "deepskyblue",
"HoveredColor": "deepskyblue",
"LineWidth": 3.0,
"ConstructionLineWidth": 2.0,
"PointDiameter": 10.0,
"UseDataDefinedColors": true
}
}
)");
}
int
main(int argc, char *argv[])
{
QApplication app(argc, argv);
setStyle();
GraphModel graphModel;
auto scene = new GraphicsScene(graphModel);
GraphicsView view(scene);
view.setWindowTitle("Simplest model-based graph");
view.resize(800, 600);
view.showNormal();
return app.exec();
}