FemaLocalSoftware/sensorwidget.h

33 lines
936 B
C
Raw Normal View History

2024-11-28 08:02:59 +00:00
#ifndef SENSORWIDGET_H
#define SENSORWIDGET_H
#include <QFrame>
#include <QLabel>
#include <QVBoxLayout>
class SensorWidget : public QFrame
{
Q_OBJECT
public:
//Конструктор
explicit SensorWidget(QWidget *parent = nullptr,
const QString &title = "Default sensor",
const QString &value = "1.01 #",
const QString &incident = "Default incident");
// Метод для изменения внешнего вида при ошибке
void setErrorState(bool hasError,
const QString &title = "Default error",
const QString &value = "Default error",
const QString &incident = "123 - 123");
private:
QLabel *titleLabel;
QLabel *valueLabel;
QLabel *incidentLabel;
QVBoxLayout *layout;
};
#endif // SENSORWIDGET_H