summaryrefslogtreecommitdiff
path: root/src/main/main.cpp
blob: 2469a46d860b80471a5eeff6b985566b0337cbf0 (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
36
37
38
39
40
#include <QGuiApplication>
#include <QQmlEngine>
#include <QQmlContext>
#include <QQmlComponent>

// networking
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QUrl>
#include <QUrlQuery>

// json parsing
#include <QJsonValue>
#include <QJsonDocument>
#include <QJsonObject>
#include <QVariantMap>
#include <QJsonArray>

// console output
#include <QDebug>
// #include <iostream>
#include "../model/SportModel.h"

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

    QQmlEngine engine;
    QQmlContext *objectContext = new QQmlContext(engine.rootContext());

    SportModel model;
    model.request("ARC");
    objectContext->setContextProperty("sports", &model);

    QQmlComponent component(&engine, "qrc:/qt/qml/itat/res/gui/application.qml");
    QObject *object = component.create(objectContext);

    return app.exec();
}