FemaLocalSoftware/sensorwidget.h

37 lines
714 B
C
Raw Normal View History

2024-11-28 08:02:59 +00:00
#ifndef SENSORWIDGET_H
#define SENSORWIDGET_H
2024-12-16 08:38:04 +00:00
#include "getsensors_r.h"
2024-11-28 08:02:59 +00:00
#include <QFrame>
#include <QLabel>
#include <QVBoxLayout>
class SensorWidget : public QFrame
{
Q_OBJECT
public:
explicit SensorWidget(QWidget *parent = nullptr,
2024-12-16 08:38:04 +00:00
const Sensor &sensor = Sensor());
2024-11-28 08:02:59 +00:00
2024-12-16 08:38:04 +00:00
void setErrorState();
Sensor getSensor() const;
void setSensor(const Sensor value);
signals:
void clicked(SensorWidget *sensor);
protected:
void mousePressEvent(QMouseEvent *event) override;
2024-11-28 08:02:59 +00:00
private:
2024-12-16 08:38:04 +00:00
Sensor sensor;
2024-11-28 08:02:59 +00:00
QLabel *titleLabel;
QLabel *valueLabel;
QLabel *incidentLabel;
QVBoxLayout *layout;
};
#endif // SENSORWIDGET_H