2021-04-04 18:32:21 +00:00
|
|
|
#include <QApplication>
|
2021-04-04 02:57:36 +00:00
|
|
|
#include <QQmlApplicationEngine>
|
2021-04-11 03:28:04 +00:00
|
|
|
#include <QTextCodec>
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QtWidgets/QApplication>
|
2021-04-12 15:39:06 +00:00
|
|
|
#include <QQuickView>
|
|
|
|
#include <QQmlComponent>
|
|
|
|
#include <QQmlContext>
|
|
|
|
#include <QtSerialPort/QSerialPort>
|
|
|
|
#include <QtSerialPort/QSerialPortInfo>
|
|
|
|
|
2021-04-11 03:28:04 +00:00
|
|
|
#include "sharedata.h"
|
|
|
|
#include "serialcontroller.h"
|
2021-04-12 15:39:06 +00:00
|
|
|
#include "lua_wraper.h"
|
|
|
|
|
|
|
|
|
|
|
|
ShareData gGlobal;
|
2021-04-11 03:28:04 +00:00
|
|
|
|
|
|
|
void RegisterQmlType(){
|
2021-04-12 15:39:06 +00:00
|
|
|
qmlRegisterSingletonInstance<ShareData>("ShareData", 1, 0, "DataWrap",&gGlobal);
|
2021-04-11 03:28:04 +00:00
|
|
|
}
|
2021-04-04 02:57:36 +00:00
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
2021-04-12 15:39:06 +00:00
|
|
|
QGuiApplication app(argc, argv);
|
|
|
|
SerialController *pSerial = new SerialController();
|
|
|
|
QQuickView view;
|
2021-04-17 17:57:39 +00:00
|
|
|
|
2021-04-12 15:39:06 +00:00
|
|
|
view.setResizeMode(QQuickView::SizeRootObjectToView);
|
|
|
|
view.setSource(QUrl("qrc:/main.qml"));
|
|
|
|
view.setTitle ("多用途通信协议调试器,基于lua");
|
|
|
|
view.rootContext()->setContextProperty("DataWrap",&gGlobal);
|
|
|
|
|
2021-04-14 16:33:28 +00:00
|
|
|
view.show();
|
2021-04-17 17:57:39 +00:00
|
|
|
gGlobal.SetQuickView(&view);
|
2021-04-12 15:39:06 +00:00
|
|
|
|
2021-04-04 02:57:36 +00:00
|
|
|
return app.exec();
|
|
|
|
}
|