调整菜单栏
This commit is contained in:
parent
5445380824
commit
6c7499efa4
File diff suppressed because it is too large
Load Diff
@ -29,6 +29,12 @@
|
|||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include "mqttclient.h"
|
#include "mqttclient.h"
|
||||||
#include "lightstripmanager.h"
|
#include "lightstripmanager.h"
|
||||||
|
#include <QMenuBar>
|
||||||
|
#include <QMenu>
|
||||||
|
#include <QAction>
|
||||||
|
#include <QMessageBox>
|
||||||
|
#include <QApplication> // 新增:用于获取系统调色板
|
||||||
|
#include <QPalette>
|
||||||
|
|
||||||
class MainWindow : public QMainWindow
|
class MainWindow : public QMainWindow
|
||||||
{
|
{
|
||||||
@ -37,9 +43,24 @@ class MainWindow : public QMainWindow
|
|||||||
public:
|
public:
|
||||||
MainWindow(QWidget *parent = nullptr);
|
MainWindow(QWidget *parent = nullptr);
|
||||||
~MainWindow();
|
~MainWindow();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void showAbout(); // 简化为关于对话框
|
||||||
|
void showUseGuide(); // 新增:使用说明对话框
|
||||||
|
|
||||||
|
private:
|
||||||
|
void setupUI();
|
||||||
|
void createMenus(); // 重命名为更清晰的函数名
|
||||||
|
|
||||||
|
// 不使用成员变量存储菜单指针,直接在函数中创建
|
||||||
|
// void setupMenuBar();
|
||||||
|
|
||||||
|
// 注释掉菜单相关成员变量
|
||||||
|
// QAction *versionUpdateAction;
|
||||||
|
|
||||||
// 新增:公共接口
|
// 新增:公共接口
|
||||||
QString getDeviceSn() const;
|
QString getDeviceSn() const;
|
||||||
|
QString getTextColorForTheme() const;
|
||||||
bool isMqttConnected() const;
|
bool isMqttConnected() const;
|
||||||
void publishMqttMessage(const QString &topic, const QString &message);
|
void publishMqttMessage(const QString &topic, const QString &message);
|
||||||
|
|
||||||
@ -65,8 +86,6 @@ private slots:
|
|||||||
void onLightStripManagerClosed(); // 新增:灯条管理器关闭时的处理
|
void onLightStripManagerClosed(); // 新增:灯条管理器关闭时的处理
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setupUI();
|
|
||||||
void setupMenuBar();
|
|
||||||
void setupToolBar();
|
void setupToolBar();
|
||||||
void updateConnectionStatus(bool connected);
|
void updateConnectionStatus(bool connected);
|
||||||
void processOtaMessage(const QJsonObject &otaData);
|
void processOtaMessage(const QJsonObject &otaData);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user