#ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace QtCharts; QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE typedef struct tagDB_Conn { QString DB_Type; QString db_HostName; qint32 db_Port; QString db_Name; QString db_UserName; QString db_Password; }stDB_CONN,*pDB_CONN; class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = nullptr); ~MainWindow(); QSettings *settings; QSqlDatabase db; stDB_CONN dbconn; bool dbopened=false; int DelayInit(); int Connect_DB(); int loadConfig(); int saveConfig(); int bfull =0; QSize oldsize; int flag = 1; int nPos=0; void InitDisplay(); void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE; void ShowParams(); void setChartAttribute(QChart *chart, QString title); QChart * CreateBarChart(); QChart * createPieChart(); QChart * createAreaChart(); QChart * createLineChart(); QChart * createSpLineChart(); QChart * createScatterChart(); void myDraw(QWidget * widget); protected: void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE; private slots: void timerProc(); void on_pushButton_scene1_clicked(); void on_pushButton_scene2_clicked(); void on_pushButton_scene3_clicked(); void on_pushButton_syscfg_clicked(); private: Ui::MainWindow *ui; QTextToSpeech *m_speech; QVector m_voices; }; #endif // MAINWINDOW_H