2025-11-14 19:31:09 +08:00
|
|
|
#ifndef MONITORITEMSDLG_H
|
|
|
|
|
#define MONITORITEMSDLG_H
|
|
|
|
|
|
|
|
|
|
#include <QDialog>
|
2025-11-21 19:22:41 +08:00
|
|
|
#include <QTreeView>
|
2025-11-14 19:31:09 +08:00
|
|
|
#include "global.h"
|
|
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
namespace Ui { class monitorItemsDlg; }
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
class MonitorItemsDlg : public QDialog
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
MonitorItemsDlg(QWidget *parent = nullptr);
|
|
|
|
|
~MonitorItemsDlg();
|
|
|
|
|
|
|
|
|
|
void initial();
|
|
|
|
|
signals:
|
2025-11-21 19:22:41 +08:00
|
|
|
void generateMonitor(QString,QList<monitorRelationItem>); //生成监控
|
2025-11-14 19:31:09 +08:00
|
|
|
public slots:
|
|
|
|
|
void onUpdateItems(QList<monitorRelationItem>,bool refresh); //更新当前设备列表
|
2025-11-21 19:22:41 +08:00
|
|
|
void onSelectItems(QList<monitorRelationItem>); //更新当前选中的设备
|
2025-11-14 19:31:09 +08:00
|
|
|
void onGenerateClicked();
|
2025-11-21 19:22:41 +08:00
|
|
|
void onMonitorCreated(QList<monitorRelationItem>); //创建后的设备列表
|
2025-11-14 19:31:09 +08:00
|
|
|
void onItemChanged(QStandardItem *item); //item勾选事件
|
|
|
|
|
private:
|
|
|
|
|
void resetSelect(); //重置选中
|
|
|
|
|
void setChildrenCheckState(QStandardItem *parent, Qt::CheckState state);
|
2025-11-21 19:22:41 +08:00
|
|
|
void traverseSelectStandardItemModel(QStandardItemModel *model,Qt::CheckState); //遍历选中
|
|
|
|
|
void traverseSelectStandardItem(QStandardItem *item, int depth,Qt::CheckState); //遍历选中
|
|
|
|
|
|
|
|
|
|
QList<QStandardItem*> getCheckedItems(QStandardItem* parentItem); //返回checked对象
|
|
|
|
|
QList<QStandardItem*> getTreeViewCheckedItems(QTreeView* treeView); //返回checked对象
|
2025-11-14 19:31:09 +08:00
|
|
|
private:
|
|
|
|
|
Ui::monitorItemsDlg *ui;
|
|
|
|
|
QStandardItemModel* _modelAll; //图中所有item
|
|
|
|
|
QStandardItemModel* _modelSelect; //生成的item
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|