-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
30 lines (21 loc) · 819 Bytes
/
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
#include <QtGui/QGuiApplication>
#include "qtquick2applicationviewer.h"
#include "client.h"
#include <QQmlContext>
#include <QtDeclarative/QDeclarativeEngine>
#include <QtDeclarative/QDeclarativeComponent>
#include <QtQml/QQmlApplicationEngine>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
// QtQuick2ApplicationViewer viewer;
qmlRegisterType<Client>("Clients", 1,0, "Client");
QQmlApplicationEngine engine;
Client client(static_cast<QObject*>(&app), &engine);
engine.rootContext()->setContextProperty("client", &client);
qDebug() << engine.rootContext()->contextProperty("connectionModel");
engine.load("qml/TheMaster/main.qml");
//engine.setMainQmlFile(QStringLiteral("qml/TheMaster/main.qml"));
//engine.showExpanded();
return app.exec();
}