2025-09-22 20:01:41 +08:00
|
|
|
|
#include <QMainWindow>
|
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
|
#include <QPushButton>
|
2025-09-25 19:20:25 +08:00
|
|
|
|
|
2025-09-24 19:06:31 +08:00
|
|
|
|
#include <QTimer>
|
2025-09-25 19:20:25 +08:00
|
|
|
|
|
2025-09-22 20:01:41 +08:00
|
|
|
|
#include <string>
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
2025-09-24 19:06:31 +08:00
|
|
|
|
#include <spdlog/sinks/base_sink.h>
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
#include <QPointer>
|
|
|
|
|
|
#include <QTextEdit>
|
|
|
|
|
|
#include <mutex>
|
|
|
|
|
|
|
2025-09-25 19:20:25 +08:00
|
|
|
|
#include "widgets/QWHome.h"
|
2025-09-29 18:31:44 +08:00
|
|
|
|
#include "widgets/QWMonitor.h"
|
2025-09-24 19:06:31 +08:00
|
|
|
|
|
2025-09-22 20:01:41 +08:00
|
|
|
|
class MainApp : public QWidget
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
|
|
|
|
|
MainApp();
|
2025-09-29 18:31:44 +08:00
|
|
|
|
void initMenu();
|
2025-09-22 20:01:41 +08:00
|
|
|
|
void setMyLayout();
|
|
|
|
|
|
|
2025-09-29 18:31:44 +08:00
|
|
|
|
void onActiveMenu(std::string name);
|
2025-09-24 19:06:31 +08:00
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
void onTimer();
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
2025-09-22 20:01:41 +08:00
|
|
|
|
struct {
|
|
|
|
|
|
std::shared_ptr<LabelPair> weburl {};
|
2025-09-29 18:31:44 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<QLabel> labelDT {};
|
|
|
|
|
|
std::shared_ptr<QWidget> widgetMenu;
|
|
|
|
|
|
std::vector<std::shared_ptr<QPushButton>> vecMenuItems;
|
|
|
|
|
|
std::shared_ptr<QGridLayout> layoutMenu;
|
|
|
|
|
|
std::shared_ptr<QPushButton> curActiveMenuBtn;
|
|
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<MyWidget> curActiveWidget = nullptr;
|
2025-09-25 19:20:25 +08:00
|
|
|
|
std::shared_ptr<MyWidget> wigetHome;
|
2025-09-29 18:31:44 +08:00
|
|
|
|
std::shared_ptr<MyWidget> wigetMonitor;
|
|
|
|
|
|
|
2025-09-22 20:01:41 +08:00
|
|
|
|
} ui;
|
|
|
|
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
|
std::shared_ptr<QGridLayout> main;
|
|
|
|
|
|
} layout;
|
|
|
|
|
|
|
2025-09-24 19:06:31 +08:00
|
|
|
|
std::shared_ptr<QTimer> timer;
|
2025-09-22 20:01:41 +08:00
|
|
|
|
};
|