-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
29 lines (22 loc) · 783 Bytes
/
Copy pathmain.cpp
File metadata and controls
29 lines (22 loc) · 783 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
#include <QGuiApplication>
#include <QQmlContext>
#include <QQmlApplicationEngine>
#include <QtWebEngine/qtwebengineglobal.h>
#include "ghostwrapper.h"
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
QGuiApplication app(argc, argv);
app.setApplicationVersion("0.0.1");
app.setOrganizationDomain("https://github.com/antonioalecrim/webghost");
QtWebEngine::initialize();
QQmlApplicationEngine engine;
ghostWrapper gw;
engine.rootContext()->setContextProperty("ghost", &gw);
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
gw.init(&app, &engine);
return app.exec();
}