2025-12-01 20:29:36 +08:00
|
|
|
|
#ifndef MONITORITEMPREVIEWDLG_H
|
|
|
|
|
|
#define MONITORITEMPREVIEWDLG_H
|
|
|
|
|
|
|
|
|
|
|
|
/*************运行时item显示预览*************/
|
|
|
|
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
#include <QSvgRenderer>
|
|
|
|
|
|
|
|
|
|
|
|
class MonitorItemPreviewDlg : public QWidget
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
|
|
|
|
|
MonitorItemPreviewDlg(QWidget *parent = nullptr);
|
|
|
|
|
|
~MonitorItemPreviewDlg();
|
|
|
|
|
|
|
|
|
|
|
|
void initial();
|
|
|
|
|
|
void setSvgFile(const QByteArray &bytSvg);
|
|
|
|
|
|
void setColors(const QColor &color);
|
2025-12-03 18:27:49 +08:00
|
|
|
|
void setCurType(const QString& str) {m_curDeviceType = str;}
|
|
|
|
|
|
void clearSvg();
|
2025-12-01 20:29:36 +08:00
|
|
|
|
QByteArray getCurSvg() {return _curSvg;}
|
|
|
|
|
|
protected:
|
|
|
|
|
|
void paintEvent(QPaintEvent *) override;
|
|
|
|
|
|
private:
|
|
|
|
|
|
QSvgRenderer m_renderer;
|
|
|
|
|
|
QByteArray _curSvg;
|
|
|
|
|
|
QColor m_Color;
|
2025-12-03 18:27:49 +08:00
|
|
|
|
QString m_curDeviceType; //当前设备类型,对应设备tag
|
2025-12-01 20:29:36 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|