-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (20 loc) · 672 Bytes
/
main.cpp
File metadata and controls
35 lines (20 loc) · 672 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
#include <iostream>
#include <QApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
//
#include "documenthandler.h"
int main (int argc, char* argv[])
{
//File manipulation
qputenv("QML_XHR_ALLOW_FILE_READ","1");
qputenv("QML_XHR_ALLOW_FILE_WRITE","1");
//environment variables
QApplication app(argc, argv);
DocumentHandler document;
qmlRegisterType<DocumentHandler>("org.sample", 1, 0, "DocumentHandler");
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("documentHandler", &document);
engine.load(QStringLiteral("qml/MainWindow.qml"));
return app.exec();
}