-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
43 lines (34 loc) · 1.37 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 <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QQuickStyle>
// #include <QThread>
#include "websocket_manager.h"
#include "databasemanager.h"
#include "binance_manager.h"
#include "service_manager.h"
#include "m_account.h"
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQuickStyle::setStyle("Material");
// Включаем отладочные сообщения
qSetMessagePattern("[%{time h:mm:ss.zzz}] [%{type}] %{message}");
WebSocket_Manager *websocketManager = new WebSocket_Manager();
DatabaseManager db_manager;
BinanceManager *binanceManager = new BinanceManager();
DatabaseWorker *databaseWorker = new DatabaseWorker("app");
ServiceManager *serviceManager = new ServiceManager(websocketManager, binanceManager, databaseWorker);
QQmlApplicationEngine engine;
ModelAccount *modelAccount = new ModelAccount(binanceManager, databaseWorker, serviceManager);
engine.rootContext()->setContextProperty("modelAccount", modelAccount);
engine.rootContext()->setContextProperty("websocketManager", websocketManager);
QObject::connect(
&engine,
&QQmlApplicationEngine::objectCreationFailed,
&app,
[]() { QCoreApplication::exit(-1); },
Qt::QueuedConnection);
engine.loadFromModule("TestBinance", "Main");
return app.exec();
}