Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

main.cpp 918 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 5 6 7 8
#include <QQmlContext>

#include "src/utils/pix.h"
#include "src/utils/utils.h"

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

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

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

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

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

Camilo Higuita's avatar
src  
Camilo Higuita committed
25
    QQmlApplicationEngine engine;
26 27 28 29 30 31 32 33
    auto context = engine.rootContext();

    Pix pix;
    context->setContextProperty("PIX", &pix);
    Utils util;
    context->setContextProperty("UTI", &util);


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

    return app.exec();
}