-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
31 lines (22 loc) · 825 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
31
#include <QtCore>
#include <QtDeclarative>
#include <time.h>
#include <stdlib.h>
#include "connectioncontroller.h"
using namespace std;
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QDeclarativeView view;
view.setSource(QUrl("qrc:/qml/qc_main_from/untitled.qml"));
srand(time(NULL));
UiController* uicontr = new UiController(view.rootObject());
ConnectionController* cc = new ConnectionController(uicontr);
view.rootContext()->setContextProperty("cc", cc);
view.rootContext()->setContextProperty("alice", cc->getTransmitterInstance());
view.rootContext()->setContextProperty("bob", cc->getReceiverInstance());
view.rootContext()->setContextProperty("eve", cc->getIntercepterInstance());
//cc->generateKey(100);
view.show();
return app.exec();
}