Debian Codegraph @

tests/manual/graphicaleffects5/main.cpp

raw
1 // Copyright (C) 2020 The Qt Company Ltd.
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4 #include <QGuiApplication>
5 #include <QQmlApplicationEngine>
6
7 int main(int argc, char *argv[])
8 {
9 if (qEnvironmentVariableIsEmpty("QTGLESSTREAM_DISPLAY")) {
10 qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", QByteArray("213"));
11 qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", QByteArray("120"));
12
13 QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
14 }
15
16 QGuiApplication app(argc, argv);
17
18 QQmlApplicationEngine engine;
19 const QUrl url(QStringLiteral("qrc:/main.qml"));
20 QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
21 &app, [url](QObject *obj, const QUrl &objUrl) {
22 if (!obj && url == objUrl)
23 QCoreApplication::exit(-1);
24 }, Qt::QueuedConnection);
25 engine.load(url);
26
27 return app.exec();
28 }