aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/painterpathquickshape/main.cpp
blob: 5f45be81b81c55774149f4f2f269721458117d0c (plain)
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
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QFontDatabase>

#include "svgpathloader.h"
#include "debugpaintitem.h"
#include "debugvisualizationcontroller.h"

int main(int argc, char *argv[])
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
    QGuiApplication app(argc, argv);
    app.setOrganizationName("QtProject");

    qmlRegisterType<DebugPaintItem>("io.qt", 1, 0, "DebugPaintItem");
    qmlRegisterType<SvgPathLoader>("io.qt", 1, 0, "SvgPathLoader");
    qmlRegisterType<DebugVisualizationController>("io.qt", 1, 0, "DebugVisualizationController");

    QFontDatabase::addApplicationFont(":/Graziano.ttf");
    QQmlApplicationEngine engine;
    const QUrl url(QStringLiteral("qrc:/main.qml"));
    QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
                     &app, [url](QObject *obj, const QUrl &objUrl) {
        if (!obj && url == objUrl)
            QCoreApplication::exit(-1);
    }, Qt::QueuedConnection);
    engine.load(url);

    return app.exec();
}