main.cpp 692 Bytes
Newer Older
Michael Winkelmann's avatar
Michael Winkelmann committed
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 <QQmlApplicationEngine>
#include <QFontDatabase>

#include "GradientImageProvider.h"

int main(int argc, char *argv[])
{
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    QGuiApplication app(argc, argv);

    // Install Icons font
    QFontDatabase db;
    auto id = db.addApplicationFont(":/icons.ttf");
    if (id == -1) {
        return EXIT_FAILURE;
    }

    QQmlApplicationEngine engine;

    // Install image provider
    engine.addImageProvider("gradients", new GradientImageProvider);

    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
    if (engine.rootObjects().isEmpty())
        return -1;

    return app.exec();
}