feat:初始化wuhan_QT界面代码
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#ifndef DATACARD_H
|
||||
#define DATACARD_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QVector>
|
||||
|
||||
class QLabel;
|
||||
|
||||
// ===================== 数据卡片 =====================
|
||||
// 标题栏 + 若干“标签:值”行;支持指定字段红色闪烁告警
|
||||
class DataCard : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DataCard(const QString& title, QWidget* parent = nullptr);
|
||||
|
||||
void setTitle(const QString& t);
|
||||
int addField(const QString& label, const QString& value = "--", bool big = false);
|
||||
void setField(int index, const QString& value);
|
||||
void setAlarm(int index, bool on);
|
||||
void setHighlight(bool on); // 主色描边突出
|
||||
|
||||
private:
|
||||
QLabel* m_title = nullptr;
|
||||
QVector<QLabel*> m_values;
|
||||
QVector<QString> m_labels;
|
||||
};
|
||||
|
||||
#endif // DATACARD_H
|
||||
Reference in New Issue
Block a user