main.cpp 912 Bytes
Newer Older
1
#include <QApplication>
Camilo Higuita's avatar
Camilo Higuita committed
2
#include <QQmlApplicationEngine>
Camilo Higuita's avatar
Camilo Higuita committed
3
#include <QFontDatabase>
4
#include <QQmlContext>
Camilo Higuita's avatar
Camilo Higuita committed
5
#include <QQuickStyle>
6
#include "src/pix.h"
7

8 9 10
#ifdef Q_OS_ANDROID
#include "./3rdparty/kirigami/src/kirigamiplugin.h"
#endif
Camilo Higuita's avatar
Camilo Higuita committed
11 12 13 14 15

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

16
    QApplication app(argc, argv);
Camilo Higuita's avatar
Camilo Higuita committed
17

Camilo Higuita's avatar
Camilo Higuita committed
18 19
    QFontDatabase::addApplicationFont(":/utils/materialdesignicons-webfont.ttf");

20 21
#ifdef Q_OS_ANDROID
    KirigamiPlugin::getInstance().registerTypes();
22 23 24
#else
//    if(QQuickStyle::availableStyles().contains("nomad"))
//        QQuickStyle::setStyle("nomad");
25
#endif
26

Camilo Higuita's avatar
Camilo Higuita committed
27
    QQmlApplicationEngine engine;
28 29 30
    auto context = engine.rootContext();

    Pix pix;
Camilo Higuita's avatar
Camilo Higuita committed
31
    context->setContextProperty("pix", &pix);
32

Camilo Higuita's avatar
Camilo Higuita committed
33 34 35 36 37 38
    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
    if (engine.rootObjects().isEmpty())
        return -1;

    return app.exec();
}