DiagramDesigner/diagramCavas/include/monitorItemPreviewDlg.h

32 lines
780 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#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);
void setCurType(const QString& str) {m_curDeviceType = str;}
void clearSvg();
QByteArray getCurSvg() {return _curSvg;}
protected:
void paintEvent(QPaintEvent *) override;
private:
QSvgRenderer m_renderer;
QByteArray _curSvg;
QColor m_Color;
QString m_curDeviceType; //当前设备类型对应设备tag
};
#endif