#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 #ifdef RS485Type w.resize(screen_info.width()+2, screen_info.height()+2); qDebug()<<"Rect:x="<showFullScreen(); qDebug()<<"x:"<strSqliteAddress=appDirPath+"/pdu_dat.db"; pdu_Ctrl::instance()->ReadModbusInit(); //============================线程开启==================================== //数据更新线程 DataUpdateThread thread_Update(nullptr); thread_Update.SetShowWidget(&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(); //w.ShowMSGWidget("Temperature and humidity sensor 湿度 超过上限"); int ret=a.exec(); //析构 thread_Update.isRunStats=false; thread_Update.wait(); thread_Button.isRunning=false; thread_Button.wait(); pdu_Ctrl::distory(); return ret; }