Fail was here…
QQuickView *view = new QQuickView;
view->rootContext()->setContextProperty("translation", (QObject *)&translation_obj);
view->rootContext()->setContextProperty("json", (QObject *)&file_obj); // Moved up this line... :D
view->setSource(QStringLiteral("qml/Main.qml"));
view->show();
Now everything works fine ;)
↧