-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
27 lines (23 loc) · 960 Bytes
/
main.cpp
File metadata and controls
27 lines (23 loc) · 960 Bytes
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
#include "httpclient.h"
#include "httppromise.h"
#include "httpsignal.h"
#include <QGuiApplication>
#include <qqml.h>
#include <QQmlApplicationEngine>
#include <QQmlContext>
int main(int argc, char *argv[]) {
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
QCoreApplication::setOrganizationName("Binaryify");
QCoreApplication::setOrganizationDomain("binaryify.cn");
QCoreApplication::setApplicationName("CloudMusicPlayer");
// qmlRegisterType<HttpClient>("Http", 1, 0, "HttpClient");
qmlRegisterType<HttpPromise>("Http", 1, 0, "HttpPromise");
qmlRegisterType<HttpSignal>("Http", 1, 0, "HttpSignal");
engine.rootContext()->setContextProperty("HttpClient", new HttpClient);
QObject::connect(
&engine, &QQmlApplicationEngine::objectCreationFailed, &app,
[]() { QCoreApplication::exit(-1); }, Qt::QueuedConnection);
engine.load(QUrl("qrc:/src/qml/Main.qml"));
return app.exec();
}