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
43 lines (29 loc) · 787 Bytes
/
main.cpp
File metadata and controls
43 lines (29 loc) · 787 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
#include <nodes/NodeData>
#include <nodes/FlowScene>
#include <nodes/FlowView>
#include <QtWidgets/QApplication>
#include <nodes/DataModelRegistry>
#include "TextSourceDataModel.hpp"
#include "TextDisplayDataModel.hpp"
using QtNodes::DataModelRegistry;
using QtNodes::FlowView;
using QtNodes::FlowScene;
static std::shared_ptr<DataModelRegistry>
registerDataModels()
{
auto ret = std::make_shared<DataModelRegistry>();
ret->registerModel<TextSourceDataModel>();
ret->registerModel<TextDisplayDataModel>();
return ret;
}
int
main(int argc, char *argv[])
{
QApplication app(argc, argv);
FlowScene scene(registerDataModels());
FlowView view(&scene);
view.setWindowTitle("Node-based flow editor");
view.resize(800, 600);
view.show();
return app.exec();
}