-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
executable file
·43 lines (33 loc) · 1.08 KB
/
main.cpp
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
41
42
43
#include "mainwindow.h"
#include <memory>
#include <QApplication>
#include <QMessageBox>
#include <QGuiApplication>
#include <QtQml/QQmlApplicationEngine>
#include <QtQml/QQmlContext>
#include <QList>
#include <QtConcurrent/QtConcurrent>
#include "argoqmlcontext.h"
using namespace Argo;
ArgoQMLContext g_argoQmlContext;
void InitializeQMLContext(QQmlApplicationEngine& engine) {
// Get root context from the engine
QQmlContext* rootCtx = engine.rootContext();
rootCtx->setContextProperty("downloadListModel", g_argoQmlContext.getTorrentListModel());
// TODO: add a peers list model
rootCtx->setContextProperty("argoContext", &g_argoQmlContext);
}
int main(int argc, char *argv[])
{
// Load the main qml
QApplication app(argc, argv);
QQmlApplicationEngine engine;
// Setup context
InitializeQMLContext(engine);
// Add qml to the path. Support jbQuick.Charts 1.0
engine.addImportPath(QStringLiteral("qml"));
// Load the root qml
engine.load(QUrl(QStringLiteral("qrc:///ltdash.qml")));
// Run the application loop
return app.exec();
}