#include "widget.h" #include #include "dataupdatethread.h" #include "buttonclickthread.h" #include #include #include #include "pdu_ctrl.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); //窗口初始化 pdu_Ctrl::instance(); Widget w; qDebug()<<"widget End"; QGraphicsScene *scene = new QGraphicsScene; QGraphicsView *gview = new QGraphicsView(scene); QGraphicsProxyWidget *g_proxy_widget; qDebug()<<"x:"<geometry(); // Rotation 90 degree g_proxy_widget = scene->addWidget((QWidget*)&w); g_proxy_widget->setRotation(0); // Set window size w.resize(screen_info.width(), screen_info.height()); qDebug()<<"Rect:x="<InitData(&w,g_proxy_widget,gview,screen_info.width(), screen_info.height()); gview->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); gview->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); gview->setStyleSheet("border:none"); gview->showFullScreen(); qDebug()<<"x:"<strSqliteAddress=appDirPath+"/pdu_dat.db"; pdu_Ctrl::instance()->ReadModbusInit(); //============================线程开启==================================== //数据更新线程 DataUpdateThread thread_Update(nullptr); thread_Update.pwidget=&w; //QString appDirPath = QCoreApplication::applicationDirPath(); //thread_Update.strSqliteAddress=appDirPath+"/pdu_dat.db"; thread_Update.initShm(); thread_Update.start(); //GPIO更新线程 ButtonClickThread thread_Button(nullptr); thread_Button.InitConnect(); thread_Button.start(); //thread_Button.InitConnect(); int ret=a.exec(); //析构 thread_Update.isRunStats=false; thread_Update.wait(); thread_Button.isRunning=false; thread_Button.wait(); pdu_Ctrl::distory(); return ret; }