-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
26 lines (23 loc) · 871 Bytes
/
Copy pathmain.cpp
File metadata and controls
26 lines (23 loc) · 871 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
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QDebug>
#include "udpsock.h"
#include "message.h"
#include "MessengerCache.h"
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QCoreApplication::setApplicationName("Messenger");
QCoreApplication::setApplicationVersion("1.0.0");
QCoreApplication::setOrganizationName("Danil");
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
qmlRegisterType<Message>("my.porgram.message", 1, 0, "Message");
qmlRegisterType<UdpSock>("my.program.udpSock", 1, 0, "UdpSocket");
qmlRegisterType<History>("my.program.cache.history", 1, 0, "History");
qmlRegisterType<UserInfo>("my.program.cache.userInfo", 1, 0, "UserInfo");
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}