2022-06-08 12:47:24 +00:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
2024-02-23 14:41:04 +00:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
|
2015-11-06 08:57:30 +00:00
|
|
|
|
|
|
|
#include "touchsettings.h"
|
|
|
|
#include <QtGui/QGuiApplication>
|
2020-02-03 16:39:14 +00:00
|
|
|
#include <QOpenGLContext>
|
2015-11-06 08:57:30 +00:00
|
|
|
#include <QtQuick/QQuickView>
|
|
|
|
#include <QtQuick/QQuickItem>
|
|
|
|
#include <QtQml/QQmlContext>
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
2022-10-19 10:10:27 +00:00
|
|
|
qputenv("QML_XHR_ALLOW_FILE_READ", "1");
|
2020-02-12 15:37:26 +00:00
|
|
|
#ifdef Q_OS_ANDROID
|
|
|
|
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
|
|
#endif
|
2015-11-06 08:57:30 +00:00
|
|
|
QGuiApplication app(argc, argv);
|
|
|
|
|
|
|
|
QSurfaceFormat format;
|
|
|
|
if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
|
|
|
|
format.setVersion(3, 2);
|
|
|
|
format.setProfile(QSurfaceFormat::CoreProfile);
|
|
|
|
}
|
|
|
|
format.setDepthBufferSize(24);
|
|
|
|
format.setStencilBufferSize(8);
|
|
|
|
|
|
|
|
QQuickView view;
|
|
|
|
view.setFormat(format);
|
|
|
|
view.create();
|
|
|
|
|
|
|
|
TouchSettings touchSettings;
|
|
|
|
view.rootContext()->setContextProperty("touchSettings", &touchSettings);
|
|
|
|
|
|
|
|
view.setSource(QUrl("qrc:/main.qml"));
|
|
|
|
|
|
|
|
view.setResizeMode(QQuickView::SizeRootObjectToView);
|
|
|
|
view.setMaximumSize(QSize(1820, 1080));
|
|
|
|
view.setMinimumSize(QSize(300, 150));
|
|
|
|
view.show();
|
|
|
|
|
|
|
|
return app.exec();
|
|
|
|
}
|