mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-27 18:59:26 +08:00
54 lines
1.1 KiB
C++
54 lines
1.1 KiB
C++
#include <QMainWindow>
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
|
|
#include <QTimer>
|
|
|
|
#include <string>
|
|
using namespace std;
|
|
|
|
#include <spdlog/sinks/base_sink.h>
|
|
#include <QObject>
|
|
#include <QPointer>
|
|
#include <QTextEdit>
|
|
#include <mutex>
|
|
|
|
#include "widgets/QWHome.h"
|
|
#include "widgets/QWMonitor.h"
|
|
|
|
class MainApp : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
MainApp();
|
|
void initMenu();
|
|
void setMyLayout();
|
|
|
|
void onActiveMenu(std::string name);
|
|
|
|
private slots:
|
|
void onTimer();
|
|
|
|
public:
|
|
struct {
|
|
std::shared_ptr<LabelPair> weburl {};
|
|
|
|
|
|
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;
|
|
std::shared_ptr<MyWidget> wigetHome;
|
|
std::shared_ptr<MyWidget> wigetMonitor;
|
|
|
|
} ui;
|
|
|
|
struct {
|
|
std::shared_ptr<QGridLayout> main;
|
|
} layout;
|
|
|
|
std::shared_ptr<QTimer> timer;
|
|
}; |