2025-12-01 20:29:36 +08:00
|
|
|
#ifndef MONITORDISPLAYSETTINGDLG_H
|
|
|
|
|
#define MONITORDISPLAYSETTINGDLG_H
|
|
|
|
|
|
|
|
|
|
/*******************监控图元设置界面**********************/
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
#include "global.h"
|
|
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
namespace Ui { class monitorDisplaySettingDlg; }
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
class MonitorPanel;
|
|
|
|
|
|
|
|
|
|
class MonitorDisplaySettingDlg : public QDialog
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
MonitorDisplaySettingDlg(QWidget *parent = nullptr);
|
|
|
|
|
~MonitorDisplaySettingDlg();
|
|
|
|
|
|
|
|
|
|
void initial();
|
|
|
|
|
void showDlg();
|
|
|
|
|
public slots:
|
|
|
|
|
void onSaveClicked();
|
|
|
|
|
void onCancelClicked();
|
|
|
|
|
void onIconSelectClicked();
|
|
|
|
|
|
|
|
|
|
void onCheckboxToggled(bool);
|
2025-12-03 18:27:49 +08:00
|
|
|
void onDeviceComboBoxChanged(const QString&);
|
|
|
|
|
void onStateComboBoxChanged(const QString&);
|
2025-12-01 20:29:36 +08:00
|
|
|
|
|
|
|
|
private:
|
2025-12-03 18:27:49 +08:00
|
|
|
void loadSetting(monitorItemTypeStruct type, monitorItemStateStruct state);
|
|
|
|
|
bool saveCurrentSettingsWithIcon();
|
|
|
|
|
void loadFirstStateSafely();
|
2025-12-01 20:29:36 +08:00
|
|
|
|
2025-12-03 18:27:49 +08:00
|
|
|
// 图片处理
|
2025-12-01 20:29:36 +08:00
|
|
|
void clearStateDisplay();
|
2025-12-03 18:27:49 +08:00
|
|
|
void updateIconDisplay(const QByteArray& svgData);
|
|
|
|
|
void clearIconDisplay();
|
|
|
|
|
bool validateSvgData(const QByteArray& svgData) const;
|
|
|
|
|
|
|
|
|
|
// 辅助方法
|
|
|
|
|
bool validateCurrentDeviceState() const;
|
2025-12-01 20:29:36 +08:00
|
|
|
private:
|
|
|
|
|
Ui::monitorDisplaySettingDlg *ui;
|
|
|
|
|
MonitorPanel* _parent;
|
|
|
|
|
monitorItemTypeStruct _curType; //当前类型
|
|
|
|
|
monitorItemStateStruct _curState; //当前状态
|
|
|
|
|
QColor _curColor;
|
|
|
|
|
QString _curMeta;
|
|
|
|
|
QString _curModel;
|
|
|
|
|
QMap<monitorItemTypeStruct,QMap<monitorItemStateStruct,monitorItemDisplayInfo>> _tempSetting;
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|