40 lines
1015 B
C++
40 lines
1015 B
C++
#include <QApplication>
|
|
#include <QQmlApplicationEngine>
|
|
#include <QTextCodec>
|
|
#include <QByteArray>
|
|
#include <QtWidgets/QApplication>
|
|
#include <QQuickView>
|
|
#include <QQmlComponent>
|
|
#include <QQmlContext>
|
|
#include <QtSerialPort/QSerialPort>
|
|
#include <QtSerialPort/QSerialPortInfo>
|
|
|
|
#include "sharedata.h"
|
|
#include "serialcontroller.h"
|
|
#include "lua_wraper.h"
|
|
|
|
|
|
ShareData gGlobal;
|
|
|
|
void RegisterQmlType(){
|
|
qmlRegisterSingletonInstance<ShareData>("ShareData", 1, 0, "DataWrap",&gGlobal);
|
|
}
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
|
QGuiApplication app(argc, argv);
|
|
SerialController *pSerial = new SerialController();
|
|
QQuickView view;
|
|
|
|
view.setResizeMode(QQuickView::SizeRootObjectToView);
|
|
view.setSource(QUrl("qrc:/main.qml"));
|
|
view.setTitle ("多用途通信协议调试器,基于lua");
|
|
view.rootContext()->setContextProperty("DataWrap",&gGlobal);
|
|
|
|
view.show();
|
|
gGlobal.SetQuickView(&view);
|
|
|
|
return app.exec();
|
|
}
|