summaryrefslogtreecommitdiff
path: root/src/main/main.cpp
blob: 7f4e9f72274860480ae46f02ac9b6a579f7e43ff (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/Sport.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();
}