-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
25 lines (17 loc) · 722 Bytes
/
Copy pathmain.cpp
File metadata and controls
25 lines (17 loc) · 722 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
#include <QtCore/qglobal.h>
#include <QtGui/QGuiApplication>
#include <QtQml/QQmlApplicationEngine>
#include "listener.h"
int main(int argc, char *argv[]) {
QGuiApplication app(argc, argv);
qmlRegisterType<Listener>("TeamWuhanAlice", 1, 0, "Listener");
qmlRegisterType<mCanvas>("TeamWuhanAlice", 1, 0, "MCanvas");
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
/*********************************/
Listener * pL = engine.rootObjects().first()->findChild<Listener *>("m_listener");
mCanvas * pC = engine.rootObjects().first()->findChild<mCanvas *>("m_canvas");
pL->init_link(pC);
/*********************************/
return app.exec();
}