2024-09-11 17:09:26 +08:00
|
|
|
|
#ifndef MAINDIALOG_H
|
2024-09-10 16:55:41 +08:00
|
|
|
|
#define MAINDIALOG_H
|
2024-10-12 14:00:37 +08:00
|
|
|
|
#pragma execution_character_set("utf-8")
|
2024-09-10 16:55:41 +08:00
|
|
|
|
|
2024-09-11 17:09:26 +08:00
|
|
|
|
#include <QMainWindow>
|
|
|
|
|
#include <QListWidget>
|
|
|
|
|
#include <QListWidgetItem>
|
|
|
|
|
#include <QIcon>
|
|
|
|
|
#include <QStackedWidget>
|
|
|
|
|
#include <QToolBar>
|
2024-11-15 18:23:33 +08:00
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
|
2024-11-11 15:28:31 +08:00
|
|
|
|
#include <hv_tcpclient.h>
|
2024-09-10 16:55:41 +08:00
|
|
|
|
|
2024-10-12 14:00:37 +08:00
|
|
|
|
namespace Ui
|
|
|
|
|
{
|
2024-09-10 16:55:41 +08:00
|
|
|
|
class MainDialog;
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-11 17:09:26 +08:00
|
|
|
|
|
|
|
|
|
class MainDialog : public QMainWindow
|
2024-09-10 16:55:41 +08:00
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit MainDialog(QWidget *parent = nullptr);
|
|
|
|
|
~MainDialog();
|
|
|
|
|
|
2024-09-12 16:23:44 +08:00
|
|
|
|
void InitializeUI();
|
|
|
|
|
void loadWindowState();
|
|
|
|
|
|
2024-09-11 17:09:26 +08:00
|
|
|
|
public slots:
|
|
|
|
|
void changePage(QListWidgetItem *current, QListWidgetItem *previous);
|
|
|
|
|
|
2024-11-11 15:28:31 +08:00
|
|
|
|
//接收服务器返回消息的函数
|
|
|
|
|
void onMessage(const hv::SocketChannelPtr& channel, hv::Buffer* buf);
|
2024-09-11 17:09:26 +08:00
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void onToolButton1Clicked();
|
|
|
|
|
void onToolButton2Clicked();
|
2024-10-12 14:00:37 +08:00
|
|
|
|
void onToolRefreshClicked();
|
2024-09-11 17:09:26 +08:00
|
|
|
|
void onAboutButtonClicked();
|
|
|
|
|
|
2024-09-10 16:55:41 +08:00
|
|
|
|
private:
|
|
|
|
|
Ui::MainDialog *ui;
|
2024-09-11 17:09:26 +08:00
|
|
|
|
QListWidget *m_pDeviceListWidget;
|
|
|
|
|
QStackedWidget *m_pDevicestackedWidget;
|
|
|
|
|
QToolBar *m_pMainToolBar;
|
2024-11-15 18:23:33 +08:00
|
|
|
|
QVBoxLayout* m_pStackedWidgetLayout;
|
2024-09-11 17:09:26 +08:00
|
|
|
|
|
|
|
|
|
private:
|
2024-09-12 16:23:44 +08:00
|
|
|
|
|
2024-09-11 17:09:26 +08:00
|
|
|
|
void CreateToolbar();
|
|
|
|
|
void CreateIcon(const QIcon& icon,QString text);
|
|
|
|
|
void CreateTablePage();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void closeEvent(QCloseEvent *event) override;
|
|
|
|
|
void saveWindowState();
|
2024-09-10 16:55:41 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // MAINDIALOG_H
|