-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
executable file
·39 lines (31 loc) · 1.31 KB
/
main.cpp
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
/// @author Sam Kenyon <sam@metadevo.com>
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QSurfaceFormat>
#include "FlowGraph.hpp"
#include "GlimpseImage.hpp"
#include "ImageFlipBehavior.hpp"
#include "ImageSequenceBehavior.hpp"
#include "NodeData.hpp"
#include "PropertyAccess.hpp"
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QSurfaceFormat format;
format.setSamples(8);
QSurfaceFormat::setDefaultFormat(format);
FlowGraph::registerBehaviorMaker("imgseq", BehaviorMakeFunc(ImageSequenceBehavior::makeBehavior));
FlowGraph::registerBehaviorMaker("imgflip", BehaviorMakeFunc(ImageFlipBehavior::makeBehavior));
qmlRegisterType<NodeData>("flowmatic", 1, 0, "NodeData");
qmlRegisterType<GlimpseImage>("flowmatic", 1, 0, "GlimpseImage");
qmlRegisterType<NodeProperty>("flowmatic", 1, 0, "NodeProperty");
PropertyAccess& nodeProperties = PropertyAccess::instance();
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("nodeProperties", &nodeProperties);
engine.load(QUrl(QStringLiteral("qrc:/gui/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}