main.cpp 868 Bytes
Newer Older
1
#include <QApplication>
Camilo Higuita's avatar
src  
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 7
#include "src/utils/pix.h"

8 9 10
#ifdef Q_OS_ANDROID
#include "./3rdparty/kirigami/src/kirigamiplugin.h"
#endif
Camilo Higuita's avatar
src  
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
src  
Camilo Higuita committed
17

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

20 21 22
#ifdef Q_OS_ANDROID
    KirigamiPlugin::getInstance().registerTypes();
#endif
Camilo Higuita's avatar
Camilo Higuita committed
23

Camilo Higuita's avatar
src  
Camilo Higuita committed
24
    QQmlApplicationEngine engine;
25
    auto context = engine.rootContext();
26
            QQuickStyle::setStyle("qqc2-desktop-style");
27 28

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

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

    return app.exec();
}