-
Notifications
You must be signed in to change notification settings - Fork 13
/
main.cpp
45 lines (34 loc) · 1.18 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
40
41
42
43
44
45
/*
* qt-kiosk-browser
* Copyright (C) 2018
* O.S. Systems Sofware LTDA: [email protected]
*
* SPDX-License-Identifier: GPL-3.0
*/
#include <QtQml/qqml.h>
#include <QtWebEngineQuick/qtwebenginequickglobal.h>
#include <QtQml/QQmlApplicationEngine>
#include <QtQml/QQmlContext>
#include <QtGui/QGuiApplication>
#include <QNetworkProxyFactory>
#include "proxyhandler.hpp"
#include "inputeventhandler.hpp"
#include "browser.hpp"
int main(int argc, char *argv[])
{
QCoreApplication::setApplicationName("QT kiosk browser");
qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
qputenv("QML_XHR_ALLOW_FILE_READ", QByteArray("1"));
QtWebEngineQuick::initialize();
QGuiApplication app(argc, argv);
ProxyHandler proxyHandler;
proxyHandler.useSystemProxy();
proxyHandler.printCurrentProxySettings();
qmlRegisterSingletonType<InputEventHandler>("Browser", 1, 0, "Browser", [](QQmlEngine *, QJSEngine *) -> QObject * {
return new Browser();
});
qmlRegisterType<InputEventHandler>("Browser", 1, 0, "InputEventHandler");
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
return app.exec();
}