proto-debuger/protoDebuger/main.cpp

36 lines
917 B
C++
Raw Normal View History

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>
2021-05-01 06:09:18 +00:00
#include <QtQuickWidgets/QQuickWidget>
2021-04-12 15:39:06 +00:00
#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
2021-04-04 02:57:36 +00:00
int main(int argc, char *argv[])
{
2021-05-01 06:09:18 +00:00
QApplication app(argc, argv);
2021-05-01 15:41:40 +00:00
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
2021-05-01 06:09:18 +00:00
QQuickWidget *m_quickWidget=new QQuickWidget();
QUrl source("qrc:/main.qml");
m_quickWidget->setResizeMode(QQuickWidget::SizeRootObjectToView );
m_quickWidget->setSource(source);
m_quickWidget->rootContext()->setContextProperty("DataWrap",&gGlobal);
m_quickWidget->show();
gGlobal.SetQuickView(m_quickWidget);
2021-04-12 15:39:06 +00:00
2021-04-04 02:57:36 +00:00
return app.exec();
}