DPS/DataPlatform/mainwindow.h

69 lines
1.8 KiB
C
Raw Normal View History

2025-06-23 10:41:33 +08:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "EventModule.h"
#include "WebEngineView.h"
#include "QFramelessHelper.h"
class WebEngineView;
class DataManager;
class SettingDialog;
/**
2025-06-23 18:01:09 +08:00
* @brief
2025-06-23 10:41:33 +08:00
*/
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget* parent = nullptr);
~MainWindow();
/**
2025-06-23 18:01:09 +08:00
* @brief
* @param beOn true为标题栏false表示离开了标题栏
2025-06-23 10:41:33 +08:00
*/
void changeMaximize();
/**
*/
void openSettingDialog();
/**
2025-06-23 18:01:09 +08:00
* @brief WEB端当前主窗口的最大化状态
* @param beMax true为已经最大化 false当前为正常窗口
2025-06-23 10:41:33 +08:00
*/
/**
2025-06-23 18:01:09 +08:00
* @brief
* @param message
* @param type 0123
2025-06-23 10:41:33 +08:00
*/
void message(const QString& message, int type = 0);
/**
2025-06-23 18:01:09 +08:00
* @brief
2025-06-23 10:41:33 +08:00
*/
void initalApplication();
/**
2025-06-23 18:01:09 +08:00
* @brief
* @param moduleName
2025-06-23 10:41:33 +08:00
*/
void changeModule(const std::string& moduleName);
bool DBConnect(json& parameter);
void Close();
// DataManager* getDataRoot() { return _pDataRoot; }
protected:
bool onMessage(const std::string& eventName, json& parameter);
void changeEvent(QEvent* event);
#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
bool nativeEvent(const QByteArray& eventType, void* message, qintptr* result);
#else
bool nativeEvent(const QByteArray& eventType, void* message, long* result);
#endif
public slots:
private:
WebEngineView* _webView;
std::unique_ptr<SettingDialog> _settingDialog;
std::unique_ptr<QFramelessHelper> _frameless;
SignalEventModule* _eventModule;
// DataManager* _pDataRoot;
};
#endif // MAINWINDOW_H