2024-09-11 17:09:26 +08:00
|
|
|
|
#ifndef MAINDIALOG_H
|
2024-09-10 16:55:41 +08:00
|
|
|
|
#define MAINDIALOG_H
|
|
|
|
|
|
2024-09-11 17:09:26 +08:00
|
|
|
|
#include <QMainWindow>
|
|
|
|
|
#include <QListWidget>
|
|
|
|
|
#include <QListWidgetItem>
|
|
|
|
|
#include <QIcon>
|
|
|
|
|
#include <QStackedWidget>
|
|
|
|
|
#include <QToolBar>
|
2024-09-10 16:55:41 +08:00
|
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
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-11 17:09:26 +08:00
|
|
|
|
public slots:
|
|
|
|
|
void changePage(QListWidgetItem *current, QListWidgetItem *previous);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
void onToolButton1Clicked();
|
|
|
|
|
void onToolButton2Clicked();
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void InitializeUI();
|
|
|
|
|
void CreateToolbar();
|
|
|
|
|
void CreateIcon(const QIcon& icon,QString text);
|
|
|
|
|
void CreateTablePage();
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void closeEvent(QCloseEvent *event) override;
|
|
|
|
|
void saveWindowState();
|
|
|
|
|
void loadWindowState();
|
2024-09-10 16:55:41 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // MAINDIALOG_H
|